[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DCFFC37E0@AcuExch.aculab.com>
Date: Fri, 31 Mar 2017 15:03:27 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Eric Dumazet' <eric.dumazet@...il.com>,
Paolo Abeni <pabeni@...hat.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>
Subject: RE: [PATCH net-next] udp: use sk_protocol instead of pcflag to
detect udplite sockets
From: Eric Dumazet
> Sent: 31 March 2017 14:25
> On Fri, 2017-03-31 at 11:47 +0200, Paolo Abeni wrote:
> > In the udp_sock struct, the 'forward_deficit' and 'pcflag' fields
> > share the same cacheline. While the first is dirtied by
> > udp_recvmsg, the latter is read, possibly several times, by the
> > bottom half processing to discriminate between udp and udplite
> > sockets.
> >
> > With this patch, sk->sk_protocol is used to check is the socket is
> > really an udplite one, avoiding some cache misses per
> > packet and improving the performance under udp_flood with
> > small packet up to 10%.
...
> I am pretty sure we agreed in the past that forward_deficit would need
> to be placed on a cache line of its own. Somehow we manage to not
> implement this properly.
>
> What about other fields like encap_rcv, encap_destroy, gro_receive,
> gro_complete. They really should have the same false sharing issue.
>
> Proper fix is :
...
> - /* This field is dirtied by udp_recvmsg() */
> - int forward_deficit;
> + /* This field is dirtied by udp_recvmsg().
> + * Make sure it wont share a cache line with prior fields.
> + */
> + int forward_deficit ____cacheline_aligned_in_smp;
Is that really sensible on systems with large cache lines?
David
Powered by blists - more mailing lists