From: Lorenzo Colitti <lore...@google.com> Date: Fri, 9 Sep 2016 09:48:27 +0900
> On Fri, Sep 9, 2016 at 8:13 AM, David Miller <da...@davemloft.net> wrote: >>> This adds the capability for a process that has CAP_NET_ADMIN on >>> a socket to see the socket mark in socket dumps. >> >> Applied, but the argument list of inet_sk_diag_fill is starting to get out >> of control. > > I think a lot of the parameters it takes are just a couple of pointer > lookups away from in_skb. I assumed it did not take in_skb directly > for performance reasons: this way the calling functions can calculate > many of these arguments just once per dump instead of once per socket. > But thinking about it some more the cost of those pointer lookups is > negligible compared to the cost of iterating over the hashtables, > marshalling the attributes, etc. > > I'll see if I can send something out to pass in in_skb instead. The other option is to have a "struct foo_info" object on the callers stack that holds all of these values, then pass a pointer to the foo_info to inet_sk_diag_fill.