Re: [PATCH net-next 2/3] udp: avoid a cache miss on dequeue

2017-06-01 Thread Eric Dumazet
On Thu, 2017-06-01 at 22:35 +0200, Paolo Abeni wrote: > To make the code robust we would have to NULL all the other fields > (nfct, nf_bridge, destructor, sk) that are currently not cleared in > skb_release_head_state(), elsewhere if one day, after some change, any > that fields become non-NULL in

Re: [PATCH net-next 2/3] udp: avoid a cache miss on dequeue

2017-06-01 Thread Paolo Abeni
On Thu, 2017-06-01 at 09:40 -0700, Eric Dumazet wrote: > On Thu, Jun 1, 2017 at 9:21 AM, Paolo Abeni wrote: > > > I'm sorry, I do not follow. I'm concerned about the secpath field (skb- > > > sp), which is the only one that can be not NULL in > > > > __udp_queue_rcv_skb(). > > > > If the secpat

Re: [PATCH net-next 2/3] udp: avoid a cache miss on dequeue

2017-06-01 Thread Eric Dumazet
On Thu, Jun 1, 2017 at 9:21 AM, Paolo Abeni wrote: > I'm sorry, I do not follow. I'm concerned about the secpath field (skb- >>sp), which is the only one that can be not NULL in > __udp_queue_rcv_skb(). > > If the secpath is not NULL, calling there secpath_reset() (or the to- > be-introduced skb_

Re: [PATCH net-next 2/3] udp: avoid a cache miss on dequeue

2017-06-01 Thread Paolo Abeni
On Thu, 2017-06-01 at 08:58 -0700, Eric Dumazet wrote: > On Thu, 2017-06-01 at 12:39 +0200, Paolo Abeni wrote: > > On Wed, 2017-05-31 at 10:00 -0700, Eric Dumazet wrote: > > > On Mon, 2017-05-29 at 17:27 +0200, Paolo Abeni wrote: > > > > Since UDP no more uses sk->destructor, we can clear completel

Re: [PATCH net-next 2/3] udp: avoid a cache miss on dequeue

2017-06-01 Thread Eric Dumazet
On Thu, 2017-06-01 at 12:39 +0200, Paolo Abeni wrote: > On Wed, 2017-05-31 at 10:00 -0700, Eric Dumazet wrote: > > On Mon, 2017-05-29 at 17:27 +0200, Paolo Abeni wrote: > > > Since UDP no more uses sk->destructor, we can clear completely > > > the skb head state before enqueuing. > > > > ... > >

Re: [PATCH net-next 2/3] udp: avoid a cache miss on dequeue

2017-06-01 Thread Paolo Abeni
On Wed, 2017-05-31 at 10:00 -0700, Eric Dumazet wrote: > On Mon, 2017-05-29 at 17:27 +0200, Paolo Abeni wrote: > > Since UDP no more uses sk->destructor, we can clear completely > > the skb head state before enqueuing. > > ... > > > @@ -1739,6 +1740,9 @@ static int __udp_queue_rcv_skb(struct sock

Re: [PATCH net-next 2/3] udp: avoid a cache miss on dequeue

2017-05-31 Thread Eric Dumazet
On Mon, 2017-05-29 at 17:27 +0200, Paolo Abeni wrote: > Since UDP no more uses sk->destructor, we can clear completely > the skb head state before enqueuing. ... > @@ -1739,6 +1740,9 @@ static int __udp_queue_rcv_skb(struct sock *sk, struct > sk_buff *skb) > sk_mark_napi_id_once(sk

[PATCH net-next 2/3] udp: avoid a cache miss on dequeue

2017-05-29 Thread Paolo Abeni
Since UDP no more uses sk->destructor, we can clear completely the skb head state before enqueuing. All head states share a single cacheline, which is not normally used/accesses on dequeue. We can avoid entirely accessing such cacheline implementing and using in the UDP code a specialized skb free