[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1320876183.3272.8.camel@edumazet-laptop>
Date: Wed, 09 Nov 2011 23:03:03 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: bhutchings@...arflare.com, pstaszewski@...are.pl,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next] ipv4: PKTINFO doesnt need dst reference
Le mercredi 09 novembre 2011 à 16:37 -0500, David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@...il.com>
> Date: Wed, 09 Nov 2011 18:24:35 +0100
>
> > [PATCH net-next] ipv4: IP_PKTINFO doesnt need dst reference
> >
> > When a socket uses IP_PKTINFO notifications, we currently force a dst
> > reference for each received skb. Reader has to access dst to get needed
> > information (rt_iif & rt_spec_dst) and must release dst reference.
> >
> > We also forced a dst reference if skb was put in socket backlog, even
> > without IP_PKTINFO handling. This happens under stress/load.
> >
> > We can instead store the needed information in skb->cb[], so that only
> > softirq handler really access dst, improving cache hit ratios.
> >
> > This removes two atomic operations per packet, and false sharing as
> > well.
> >
> > On a benchmark using a mono threaded receiver (doing only recvmsg()
> > calls), I can reach 720.000 pps instead of 570.000 pps.
> >
> > IP_PKTINFO is typically used by DNS servers, and any multihomed aware
> > UDP application.
> >
> > Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
>
> Looks good, if it compiles I'll push it out to net-next :-)
Arg :( I cross my fingers :)
BTW, on my bnx2x adapter, even small UDP frames use more than PAGE_SIZE
bytes :
skb->truesize=4352 len=26 (payload only)
Truesize being now more precise, we hit badly the shared
udp_memory_allocated, even with single frames.
I wonder if we shouldnt increase SK_MEM_QUANTUM a bit to avoid
ping/pong...
-#define SK_MEM_QUANTUM ((int)PAGE_SIZE)
+#define SK_MEM_QUANTUM ((int)PAGE_SIZE * 2)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists