[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAADnVQ+UpR9MbpbfXEknyGpQqg2diZth36HbtP+L3eYKq7ndwA@mail.gmail.com>
Date: Thu, 11 Apr 2019 14:47:39 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Daniel Borkmann <daniel@...earbox.net>
Cc: Alexei Starovoitov <ast@...nel.org>,
"Karlsson, Magnus" <magnus.karlsson@...el.com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH bpf-next] tools: add smp_* barrier variants to include infrastructure
On Tue, Apr 9, 2019 at 2:44 AM Daniel Borkmann <daniel@...earbox.net> wrote:
>
> Add the definition for smp_rmb(), smp_wmb(), and smp_mb() to the
> tools include infrastructure: this patch adds the implementation
> for x86-64 and arm64, and have it fall back as currently is for
> other archs which do not have it implemented at this point. The
> x86-64 one uses lock + add combination for smp_mb() with address
> below red zone.
>
> This is on top of 09d62154f613 ("tools, perf: add and use optimized
> ring_buffer_{read_head, write_tail} helpers"), which didn't touch
> smp_* barrier implementations. Magnus recently rightfully reported
> however that the latter on x86-64 still wrongly falls back to sfence,
> lfence and mfence respectively, thus fix that for applications under
> tools making use of these to avoid such ugly surprises. The main
> header under tools (include/asm/barrier.h) will in that case not
> select the fallback implementation.
>
> Reported-by: Magnus Karlsson <magnus.karlsson@...el.com>
> Signed-off-by: Daniel Borkmann <daniel@...earbox.net>
> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Applied. Thanks
Powered by blists - more mailing lists