netdev
[Top] [All Lists]

Re: netlink drops messages.

To: Andi Kleen <ak@xxxxxx>
Subject: Re: netlink drops messages.
From: Gleb Natapov <gleb@xxxxxxxxxxx>
Date: Wed, 17 Jan 2001 13:35:04 +0200
Cc: kuznet@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20010117120331.A1711@xxxxxxxxxx>; from ak@xxxxxx on Wed, Jan 17, 2001 at 12:03:31PM +0100
References: <20010116193553.B5122@xxxxxxxxxxx> <20010116210345.A8319@xxxxxxxxxx> <20010117100506.D5122@xxxxxxxxxxx> <20010117120331.A1711@xxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
On Wed, Jan 17, 2001 at 12:03:31PM +0100, Andi Kleen wrote:
> On Wed, Jan 17, 2001 at 09:06:34AM +0100, Gleb Natapov wrote:
> > On Tue, Jan 16, 2001 at 09:03:45PM +0100, Andi Kleen wrote:
> > > On Tue, Jan 16, 2001 at 06:38:28PM +0100, Gleb Natapov wrote:
> > > > Hello,
> > > > 
> > > >  Recently I noticed that when I simultaneously do 'up' to many network 
> > > > interfaces
> > > > (many is ~15) netlink drops part of the messages about interface state 
> > > > change and thus 
> > > > my userspace tools don't know that some interfaces are in up state now. 
> > > > The error that 
> > > > I get from netlink socket is "No buffer space available". 
> > > > 
> > > > After looking at the code I saw that the only way I can get such error 
> > > > from netlink
> > > > is if sk->rmem_allock is bigger than sk->rcvbuf. I can enlarge 
> > > > sk->rcvbuf, but for each
> > > > interface I receive six messages and each of this messages is smaller 
> > > > then 200 bytes.
> > > > the default size of sk->rcvbuf is 65535 bytes, so why messages about 15 
> > > > interfaces can't
> > > > fit in default buffer size?
> > > 
> > > Because the sk_buff header size is accounted too.
> > > sk_buffs are not lightweight.
> > >
> > 
> > Here is how NLMSG_GOODSIZE is defined:
> > #define NLMSG_GOODSIZE (PAGE_SIZE - ((sizeof(struct sk_buff)+0xF)&~0xF))
> > So sk_buff header is not an issue here.
> 
> I think you're misunderstanding what NLMSG_GOODSIZE is used for. It is 
> just used to avoid multi page allocations for netlink.
> 
> The header is still accounted.
I understand that, but what I said in my original post is that we allocate 
whole page
only for one short message. You say that we allocate whole page for one short 
message
plus sk_buff header, but this doesn't make my point less valid: in order to 
deliver
200 bytes to socket we steal 4096 bytes from rcvbuf.

> 
> It's also a bit buggy, because when the sk_buff header has an already rounded
> size it could forget to include the reference count in the data area, giving 
> a 2page allocation. It should probably be
> (PAGE_SIZE - ((sizeof(struct sk_buff)+sizeof(unsigned long)+0xF)&~0xF))
> 
> [+ even different for 2.5 zero copy pskbs] 
> 
> -Andi
> 
> -- 
> This is like TV. I don't like TV.
--
                        Gleb.

<Prev in Thread] Current Thread [Next in Thread>