Re: [patch] networking ipv4: remove total socket usage count from/proc/net/sockstat

From: YOSHIFUJI Hideaki / 吉藤英明
Date: Mon Jan 16 2006 - 20:16:42 EST


In article <bdfc5d6e0601161433g1c51dd4dpbc5da4cd7581d5d6@xxxxxxxxxxxxxx> (at Mon, 16 Jan 2006 17:33:59 -0500), Andy Gospodarek <andy@xxxxxxxxxxxxx> says:

> On 1/16/06, Jesper Juhl <jesper.juhl@xxxxxxxxx> wrote:
> > >
> > Maybe if you described "your current problem" someone could suggest a
> > solution...
> >
>
> Sure, I'd be glad to. If I add up all the entries from the procfiles
> (in /proc/net) on my system
:
> I find there are a total of 54 sockets open on my system.
>
> Now this seems to differ from the value in /proc/net/sockstat:
> # cat sockstat
> sockets: used 59
:
> So we are off by 5. I added some code around the stat collection used
> in sockstat to get more detailed info about those sockets and the
> output is here. The values are family[protocol family][socket
> family].
:
> Total = 59
>
> All of these numbers match up with what we saw above, except the
> INET/RAW and INET6/RAW sockets. It seems they aren't being counted
> correctly -- which accounts for the 5 missing sockets. The
> decrementing of these values is in sock_release() and seems to get
> done correctly other times RAW sockets are created, but not for the 5
> sockets in question.

This is because we have several internal unhashed raw sockets in
kernel, which are not counted in the "raw" entry, but in "sockets."

--yoshfuji
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/