From: Ming Lei <tom.leiming@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Martin KaFai Lau <kafai@fb.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Alexei Starovoitov <ast@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Network Development <netdev@vger.kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>
Subject: Re: [PATCH 5/9] bpf: syscall: add percpu version of lookup/update elem
Date: Wed, 13 Jan 2016 22:56:38 +0800 [thread overview]
Message-ID: <CACVXFVPO4iN_oSce6J9uiSybZy2GV-x3h6TCca+zLP-sZn6sbA@mail.gmail.com> (raw)
In-Reply-To: <20160113053009.GC37858@ast-mbp.thefacebook.com>
On Wed, Jan 13, 2016 at 1:30 PM, Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
> On Wed, Jan 13, 2016 at 11:17:23AM +0800, Ming Lei wrote:
>> On Wed, Jan 13, 2016 at 10:22 AM, Martin KaFai Lau <kafai@fb.com> wrote:
>> > On Wed, Jan 13, 2016 at 08:38:18AM +0800, Ming Lei wrote:
>> >> > The userspace usually only aggregates value across all cpu every X seconds.
>> >>
>> >> That is just in your case, and Alexei worried the issue of data stale.
>> > I believe we are talking about validity of a value. How to
>> > make use of a less-stale but invalid data?
>>
>> About the 'invalidity' thing, it should be same between using
>> smp_call(run in IPI irq handler) and simple memcpy().
>>
>> When smp_call_function_single() is used to request to lookup element in
>> the specific CPU, the value of the element may be in updating in that CPU
>> and not completed yet in eBPF prog, then IPI comes and half updated
>> data is still returned to syscall.
>
> hmm. I'm not following. bpf programs are executing with preempt disabled,
> so smp_call_function_single suppose to execute when bpf is not running.
Preempt disabled doesn't mean irq disabled, does it? So when bpf prog is
running, the IPI irq for smp_call still may come on that CPU.
Also in current non-percpu hash, the situation exists too between
lookup elem syscall and updating value of element from bpf prog in
SMP.
--
Ming Lei
next prev parent reply other threads:[~2016-01-13 14:56 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-11 15:56 [PATCH 0/9] bpf: support percpu ARRAY map Ming Lei
2016-01-11 15:56 ` [PATCH 1/9] bpf: prepare for moving map common stuff into one place Ming Lei
2016-01-11 18:24 ` kbuild test robot
2016-01-11 15:56 ` [PATCH 2/9] bpf: array map: use pre-defined nop map function Ming Lei
2016-01-11 19:08 ` Alexei Starovoitov
2016-01-11 15:56 ` [PATCH 3/9] bpf: introduce percpu verion of lookup/update in bpf_map_ops Ming Lei
2016-01-11 15:56 ` [PATCH 4/9] bpf: add percpu version of lookup/update element helpers Ming Lei
2016-01-11 15:56 ` [PATCH 5/9] bpf: syscall: add percpu version of lookup/update elem Ming Lei
2016-01-11 19:02 ` Alexei Starovoitov
2016-01-12 5:00 ` Ming Lei
2016-01-12 5:49 ` Alexei Starovoitov
2016-01-12 11:05 ` Ming Lei
2016-01-12 19:10 ` Martin KaFai Lau
2016-01-13 0:38 ` Ming Lei
2016-01-13 2:22 ` Martin KaFai Lau
2016-01-13 3:17 ` Ming Lei
2016-01-13 5:30 ` Alexei Starovoitov
2016-01-13 14:56 ` Ming Lei [this message]
2016-01-14 1:19 ` Alexei Starovoitov
2016-01-14 2:42 ` Ming Lei
2016-01-14 5:08 ` Alexei Starovoitov
2016-01-14 7:16 ` Ming Lei
2016-01-11 15:56 ` [PATCH 6/9] bpf: arraymap: introduce BPF_MAP_TYPE_ARRAY_PERCPU Ming Lei
2016-01-11 19:14 ` Alexei Starovoitov
2016-01-11 15:56 ` [PATCH 7/9] sample/bpf: introduces helpers for percpu array example Ming Lei
2016-01-11 15:57 ` [PATCH 8/9] sample/bpf: sockex1: user percpu array map Ming Lei
2016-01-11 15:57 ` [PATCH 9/9] samples/bpf: test " Ming Lei
2016-01-12 15:44 ` David Laight
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACVXFVPO4iN_oSce6J9uiSybZy2GV-x3h6TCca+zLP-sZn6sbA@mail.gmail.com \
--to=tom.leiming@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=kafai@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).