[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161206.104237.412296597467530333.davem@davemloft.net>
Date: Tue, 06 Dec 2016 10:42:37 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: pabeni@...hat.com, netdev@...r.kernel.org, willemb@...gle.com
Subject: Re: [PATCH] net/udp: do not touch skb->peeked unless really needed
From: Eric Dumazet <eric.dumazet@...il.com>
Date: Mon, 05 Dec 2016 09:57:19 -0800
> From: Eric Dumazet <edumazet@...gle.com>
>
> In UDP recvmsg() path we currently access 3 cache lines from an skb
> while holding receive queue lock, plus another one if packet is
> dequeued, since we need to change skb->next->prev
>
> 1st cache line (contains ->next/prev pointers, offsets 0x00 and 0x08)
> 2nd cache line (skb->len & skb->peeked, offsets 0x80 and 0x8e)
> 3rd cache line (skb->truesize/users, offsets 0xe0 and 0xe4)
>
> skb->peeked is only needed to make sure 0-length packets are properly
> handled while MSG_PEEK is operated.
>
> I had first the intent to remove skb->peeked but the "MSG_PEEK at
> non-zero offset" support added by Sam Kumar makes this not possible.
>
> This patch avoids one cache line miss during the locked section, when
> skb->len and skb->peeked do not have to be read.
>
> It also avoids the skb_set_peeked() cost for non empty UDP datagrams.
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
Applied, thanks Eric.
Powered by blists - more mailing lists