linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamal Hadi Salim <jhs@mojatatu.com>
To: Joe Burton <jevburton.kernel@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	bpf@vger.kernel.org
Cc: Petar Penkov <ppenkov@google.com>,
	Stanislav Fomichev <sdf@google.com>,
	Joe Burton <jevburton@google.com>
Subject: Re: [RFC PATCH v3 0/3] Introduce BPF map tracing capability
Date: Wed, 3 Nov 2021 06:34:08 -0400	[thread overview]
Message-ID: <aa6081aa-9741-be05-8051-e01909662ff1@mojatatu.com> (raw)
In-Reply-To: <20211102021432.2807760-1-jevburton.kernel@gmail.com>

On 2021-11-01 22:14, Joe Burton wrote:
> From: Joe Burton<jevburton@google.com>
> 
> This is the third version of a patch series implementing map tracing.
> 
> Map tracing enables executing BPF programs upon BPF map updates. This
> might be useful to perform upgrades of stateful programs; e.g., tracing
> programs can propagate changes to maps that occur during an upgrade
> operation.
> 
> This version uses trampoline hooks to provide the capability.
> fentry/fexit/fmod_ret programs can attach to two new functions:
>          int bpf_map_trace_update_elem(struct bpf_map* map, void* key,
>                  void* val, u32 flags);
>          int bpf_map_trace_delete_elem(struct bpf_map* map, void* key);
> 
> These hooks work as intended for the following map types:
>          BPF_MAP_TYPE_ARRAY
>          BPF_MAP_TYPE_PERCPU_ARRAY
>          BPF_MAP_TYPE_HASH
>          BPF_MAP_TYPE_PERCPU_HASH
>          BPF_MAP_TYPE_LRU_HASH
>          BPF_MAP_TYPE_LRU_PERCPU_HASH
> 
> The only guarantee about the semantics of these hooks is that they execute
> before the operation takes place. We cannot call them with locks held
> because the hooked program might try to acquire the same locks. Thus they
> may be invoked in situations where the traced map is not ultimately
> updated.

Sorry, I may have missed something obvious while staring at the patches,
but:
Dont you want the notification if the command actually was successful
on the map? If the command failed for whatever reason theres nothing
to synchronize? Unless you use that as an indicator to re-read the map?

cheers,
jamal

  parent reply	other threads:[~2021-11-03 10:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02  2:14 [RFC PATCH v3 0/3] Introduce BPF map tracing capability Joe Burton
2021-11-02  2:14 ` [RFC PATCH v3 1/3] bpf: Add map tracing functions and call sites Joe Burton
2021-11-02  2:14 ` [RFC PATCH v3 2/3] bpf: Add selftests Joe Burton
2021-11-04  6:32   ` Hou Tao
2021-11-09 18:17     ` Joe Burton
2021-11-02  2:14 ` [RFC PATCH v3 3/3] bpf: Add real world example for map tracing Joe Burton
2021-11-03  0:12 ` [RFC PATCH v3 0/3] Introduce BPF map tracing capability Alexei Starovoitov
2021-11-03 17:29   ` Yonghong Song
2021-11-03 17:45     ` Joe Burton
2021-11-03 17:49       ` Alexei Starovoitov
2021-11-04  4:23         ` Yonghong Song
2021-11-04  4:27           ` Alexei Starovoitov
2021-11-04 16:14           ` Alexei Starovoitov
2021-11-04 17:11             ` Yonghong Song
2021-11-03 10:34 ` Jamal Hadi Salim [this message]
2021-11-03 17:12   ` Joe Burton
2021-11-04 10:59     ` Jamal Hadi Salim
2021-11-04 11:08       ` Jamal Hadi Salim

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=aa6081aa-9741-be05-8051-e01909662ff1@mojatatu.com \
    --to=jhs@mojatatu.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jevburton.kernel@gmail.com \
    --cc=jevburton@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ppenkov@google.com \
    --cc=sdf@google.com \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /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).