On Mon, Aug 19, 2019 at 4:30 PM Yonghong Song <[email protected]> wrote:

> On Mon, Aug 19, 2019 at 1:54 PM <[email protected]> wrote:
> >
> > Hi all,
> >
> > I'm trying to verify that there are no concurrency issues with an
> approach I'm using cpu_id as a key to a HASH_MAP.   My understanding is
> that bcc disables preemption but the details are fuzzy and I haven't been
> able to find anything in the code.  Can anyone shed some light on this?
>
> preemption is a kernel thing, bcc does not disable it.  You need to
> check kernel configuration CONFIG_PREEMPT in your host.
>

When running bpf code from a kprobe / kretprobe, does anything ensure that
cpu_id doesn't change while the bpf is running (e.g. due to preemption)?
Does anything ensure that no other bpf code runs on this CPU while this
kprobe is running (e.g. due to an interrupt firing and hitting a different
kprobe)?  If either of those things can happen, it seems difficult to
atomically increment an entry in a HASH_MAP (even when using the cpu_id as
a key).

--matt

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#1777): https://lists.iovisor.org/g/iovisor-dev/message/1777
Mute This Topic: https://lists.iovisor.org/mt/32960072/21656
Group Owner: [email protected]
Unsubscribe: https://lists.iovisor.org/g/iovisor-dev/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to