All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] udp: prefetch rmem_alloc in udp_queue_rcv_skb()
@ 2017-06-21  8:24 Paolo Abeni
  2017-06-21 15:41 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Abeni @ 2017-06-21  8:24 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller

On UDP packets processing, if the BH is the bottle-neck, it
always sees a cache miss while updating rmem_alloc; try to
avoid it prefetching the value as soon as we have the socket
available.

Performances under flood with multiple NIC rx queues used are
unaffected, but when a single NIC rx queue is in use, this
gives ~10% performance improvement.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/ipv4/udp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index f3450f0..067a607 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1949,6 +1949,7 @@ static int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
 		}
 	}
 
+	prefetch(&sk->sk_rmem_alloc);
 	if (rcu_access_pointer(sk->sk_filter) &&
 	    udp_lib_checksum_complete(skb))
 			goto csum_error;
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] udp: prefetch rmem_alloc in udp_queue_rcv_skb()
  2017-06-21  8:24 [PATCH net-next] udp: prefetch rmem_alloc in udp_queue_rcv_skb() Paolo Abeni
@ 2017-06-21 15:41 ` David Miller
  2017-06-21 16:07   ` Paolo Abeni
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2017-06-21 15:41 UTC (permalink / raw)
  To: pabeni; +Cc: netdev

From: Paolo Abeni <pabeni@redhat.com>
Date: Wed, 21 Jun 2017 10:24:40 +0200

> On UDP packets processing, if the BH is the bottle-neck, it
> always sees a cache miss while updating rmem_alloc; try to
> avoid it prefetching the value as soon as we have the socket
> available.
> 
> Performances under flood with multiple NIC rx queues used are
> unaffected, but when a single NIC rx queue is in use, this
> gives ~10% performance improvement.
> 
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Applied, but what about ipv6?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] udp: prefetch rmem_alloc in udp_queue_rcv_skb()
  2017-06-21 15:41 ` David Miller
@ 2017-06-21 16:07   ` Paolo Abeni
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Abeni @ 2017-06-21 16:07 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On Wed, 2017-06-21 at 11:41 -0400, David Miller wrote:
> From: Paolo Abeni <pabeni@redhat.com>
> Date: Wed, 21 Jun 2017 10:24:40 +0200
> 
> > On UDP packets processing, if the BH is the bottle-neck, it
> > always sees a cache miss while updating rmem_alloc; try to
> > avoid it prefetching the value as soon as we have the socket
> > available.
> > 
> > Performances under flood with multiple NIC rx queues used are
> > unaffected, but when a single NIC rx queue is in use, this
> > gives ~10% performance improvement.
> > 
> > Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> 
> Applied, but what about ipv6?

You are right, that was unintentionally left out. I'll do some tests
and send another patch for ipv6, too.

Thanks,

Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-21 16:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-21  8:24 [PATCH net-next] udp: prefetch rmem_alloc in udp_queue_rcv_skb() Paolo Abeni
2017-06-21 15:41 ` David Miller
2017-06-21 16:07   ` Paolo Abeni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.