Re: [PATCH bpf] bpf: avoid false sharing of map refcount with max_entries

2018-01-09 Thread Alexei Starovoitov
On Tue, Jan 09, 2018 at 04:23:08PM +, Edward Cree wrote: > > > > Quoting from Goolge's Project Zero blog [1]: > typo "Goolge". Applied with typo fixed, thanks Daniel!

Re: [PATCH bpf] bpf: avoid false sharing of map refcount with max_entries

2018-01-09 Thread Daniel Borkmann
On 01/09/2018 05:23 PM, Edward Cree wrote: > On 09/01/18 12:17, Daniel Borkmann wrote: >> In addition to commit b2157399cc98 ("bpf: prevent out-of-bounds >> speculation") also change the layout of struct bpf_map such that >> false sharing of fast-path members like max_entries is avoided >> when

Re: [PATCH bpf] bpf: avoid false sharing of map refcount with max_entries

2018-01-09 Thread Edward Cree
On 09/01/18 12:17, Daniel Borkmann wrote: > In addition to commit b2157399cc98 ("bpf: prevent out-of-bounds > speculation") also change the layout of struct bpf_map such that > false sharing of fast-path members like max_entries is avoided > when the maps reference counter is altered. Therefore

[PATCH bpf] bpf: avoid false sharing of map refcount with max_entries

2018-01-09 Thread Daniel Borkmann
In addition to commit b2157399cc98 ("bpf: prevent out-of-bounds speculation") also change the layout of struct bpf_map such that false sharing of fast-path members like max_entries is avoided when the maps reference counter is altered. Therefore enforce them to be placed into separate cachelines.