[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20191019.122235.256708841075577482.davem@davemloft.net>
Date: Sat, 19 Oct 2019 12:22:35 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: edumazet@...gle.com
Cc: netdev@...r.kernel.org, eric.dumazet@...il.com,
oliver.sang@...el.com
Subject: Re: [PATCH net] net: reorder 'struct net' fields to avoid false
sharing
From: Eric Dumazet <edumazet@...gle.com>
Date: Fri, 18 Oct 2019 15:20:05 -0700
> Intel test robot reported a ~7% regression on TCP_CRR tests
> that they bisected to the cited commit.
>
> Indeed, every time a new TCP socket is created or deleted,
> the atomic counter net->count is touched (via get_net(net)
> and put_net(net) calls)
>
> So cpus might have to reload a contended cache line in
> net_hash_mix(net) calls.
>
> We need to reorder 'struct net' fields to move @hash_mix
> in a read mostly cache line.
>
> We move in the first cache line fields that can be
> dirtied often.
>
> We probably will have to address in a followup patch
> the __randomize_layout that was added in linux-4.13,
> since this might break our placement choices.
>
> Fixes: 355b98553789 ("netns: provide pure entropy for net_hash_mix()")
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Reported-by: kernel test robot <oliver.sang@...el.com>
Applied and queued up for -stable, thanks Eric.
Powered by blists - more mailing lists