Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-07 Thread Eric Dumazet
On Wed, 2016-12-07 at 18:37 +0100, Hannes Frederic Sowa wrote: > I had the same idea while discussing that with Paolo, merely using an > *atomic_t = kmalloc(sizeof(atomic_t)) out of band of the socket. > > My fear was that those could be aggregated by the slab cache into one > cache line, causing

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-07 Thread Eric Dumazet
On Wed, 2016-12-07 at 18:37 +0100, Hannes Frederic Sowa wrote: > I had the same idea while discussing that with Paolo, merely using an > *atomic_t = kmalloc(sizeof(atomic_t)) out of band of the socket. > > My fear was that those could be aggregated by the slab cache into one > cache line, causing

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-07 Thread Hannes Frederic Sowa
On Wed, Dec 7, 2016, at 18:32, Eric Dumazet wrote: > On Wed, 2016-12-07 at 17:09 +, David Laight wrote: > > From: Paolo Abeni > > > Sent: 06 December 2016 17:08 > > ... > > > @@ -79,6 +82,9 @@ struct udp_sock { > > > int (*gro_complete)(struct sock *sk, > > >

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-07 Thread Eric Dumazet
On Wed, 2016-12-07 at 17:09 +, David Laight wrote: > From: Paolo Abeni > > Sent: 06 December 2016 17:08 > ... > > @@ -79,6 +82,9 @@ struct udp_sock { > > int (*gro_complete)(struct sock *sk, > > struct sk_buff *skb, > >

RE: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-07 Thread David Laight
From: Paolo Abeni > Sent: 06 December 2016 17:08 ... > @@ -79,6 +82,9 @@ struct udp_sock { > int (*gro_complete)(struct sock *sk, > struct sk_buff *skb, > int nhoff); > + > + /*

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-06 Thread Eric Dumazet
On Tue, 2016-12-06 at 20:16 +0100, Paolo Abeni wrote: > On Tue, 2016-12-06 at 10:58 -0800, Eric Dumazet wrote: > > On Tue, 2016-12-06 at 19:31 +0100, Paolo Abeni wrote: > > > > > cacheline 2 boundary (128 bytes) is 8 bytes before sk_lock: cacheline 2 > > > includes also skc_refcnt and skc_rxhash f

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-06 Thread Paolo Abeni
On Tue, 2016-12-06 at 10:58 -0800, Eric Dumazet wrote: > On Tue, 2016-12-06 at 19:31 +0100, Paolo Abeni wrote: > > > cacheline 2 boundary (128 bytes) is 8 bytes before sk_lock: cacheline 2 > > includes also skc_refcnt and skc_rxhash from __sk_common (I use 'pahole > > -E ...' to get the full blown

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-06 Thread Eric Dumazet
On Tue, 2016-12-06 at 19:31 +0100, Paolo Abeni wrote: > cacheline 2 boundary (128 bytes) is 8 bytes before sk_lock: cacheline 2 > includes also skc_refcnt and skc_rxhash from __sk_common (I use 'pahole > -E ...' to get the full blown output). skc_rxhash is read for each > packet in inet_recvmsg()/

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-06 Thread Paolo Abeni
On Tue, 2016-12-06 at 09:47 -0800, Eric Dumazet wrote: > On Tue, 2016-12-06 at 18:08 +0100, Paolo Abeni wrote: > > On Tue, 2016-12-06 at 11:34 +0100, Paolo Abeni wrote: > > > On Mon, 2016-12-05 at 09:57 -0800, Eric Dumazet wrote: > > > > From: Eric Dumazet > > > > > > > > In UDP recvmsg() path we

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-06 Thread Eric Dumazet
On Tue, 2016-12-06 at 18:08 +0100, Paolo Abeni wrote: > On Tue, 2016-12-06 at 11:34 +0100, Paolo Abeni wrote: > > On Mon, 2016-12-05 at 09:57 -0800, Eric Dumazet wrote: > > > From: Eric Dumazet > > > > > > In UDP recvmsg() path we currently access 3 cache lines from an skb > > > while holding rec

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-06 Thread Paolo Abeni
On Tue, 2016-12-06 at 11:34 +0100, Paolo Abeni wrote: > On Mon, 2016-12-05 at 09:57 -0800, Eric Dumazet wrote: > > From: Eric Dumazet > > > > 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

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-06 Thread David Miller
From: Eric Dumazet Date: Mon, 05 Dec 2016 09:57:19 -0800 > From: Eric Dumazet > > 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 (contai

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-06 Thread Eric Dumazet
On Tue, 2016-12-06 at 13:10 +0100, Paolo Abeni wrote: > Please ignore the above dumb comment. I misread the 'skip condition'. > > I'm fine with the patch in its current form. > > Acked-by: Paolo Abeni No worries, I prefer having multiple eyes on this stuff before doing the next step ;) Thanks

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-06 Thread Eric Dumazet
On Tue, 2016-12-06 at 10:53 +0100, Paolo Abeni wrote: > Hi Eric, > I don't understand why we can avoid setting skb->peek if len > 0. I > think that will change the kernel behavior if: > - peek with offset is set > - 3 skbs with len > 0 are enqueued > - the u/s peek (with offset) the second one > -

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-06 Thread Paolo Abeni
On Tue, 2016-12-06 at 10:53 +0100, Paolo Abeni wrote: > On Mon, 2016-12-05 at 09:57 -0800, Eric Dumazet wrote: > > From: Eric Dumazet > > > > 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

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-06 Thread Paolo Abeni
Hi Eric, On Mon, 2016-12-05 at 09:57 -0800, Eric Dumazet wrote: > From: Eric Dumazet > > 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 (

Re: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-06 Thread Paolo Abeni
Hi Eric, On Mon, 2016-12-05 at 09:57 -0800, Eric Dumazet wrote: > From: Eric Dumazet > > 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 (

[PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-05 Thread Eric Dumazet
From: Eric Dumazet 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