From: Song Liu <songliubraving@fb.com>
To: Martin Lau <kafai@fb.com>
Cc: bpf <bpf@vger.kernel.org>, Networking <netdev@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"ast@kernel.org" <ast@kernel.org>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
"andrii@kernel.org" <andrii@kernel.org>,
"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
"kpsingh@chromium.org" <kpsingh@chromium.org>,
Kernel Team <Kernel-team@fb.com>,
"haoluo@google.com" <haoluo@google.com>,
kernel test robot <lkp@intel.com>
Subject: Re: [PATCH bpf-next 1/4] bpf: enable task local storage for tracing programs
Date: Mon, 11 Jan 2021 23:41:26 +0000 [thread overview]
Message-ID: <4D0333B1-C729-41BF-AB1D-9AC233431094@fb.com> (raw)
In-Reply-To: <20210111185650.hsvfpoqmqc2mj7ci@kafai-mbp.dhcp.thefacebook.com>
> On Jan 11, 2021, at 10:56 AM, Martin Lau <kafai@fb.com> wrote:
>
> On Fri, Jan 08, 2021 at 03:19:47PM -0800, Song Liu wrote:
>
> [ ... ]
>
>> diff --git a/kernel/bpf/bpf_local_storage.c b/kernel/bpf/bpf_local_storage.c
>> index dd5aedee99e73..9bd47ad2b26f1 100644
>> --- a/kernel/bpf/bpf_local_storage.c
>> +++ b/kernel/bpf/bpf_local_storage.c
>> @@ -140,17 +140,18 @@ static void __bpf_selem_unlink_storage(struct bpf_local_storage_elem *selem)
>> {
>> struct bpf_local_storage *local_storage;
>> bool free_local_storage = false;
>> + unsigned long flags;
>>
>> if (unlikely(!selem_linked_to_storage(selem)))
>> /* selem has already been unlinked from sk */
>> return;
>>
>> local_storage = rcu_dereference(selem->local_storage);
>> - raw_spin_lock_bh(&local_storage->lock);
>> + raw_spin_lock_irqsave(&local_storage->lock, flags);
> It will be useful to have a few words in commit message on this change
> for future reference purpose.
>
> Please also remove the in_irq() check from bpf_sk_storage.c
> to avoid confusion in the future. It probably should
> be in a separate patch.
Do you mean we allow bpf_sk_storage_get_tracing() and
bpf_sk_storage_delete_tracing() in irq context? Like
diff --git i/net/core/bpf_sk_storage.c w/net/core/bpf_sk_storage.c
index 4edd033e899c0..14dd5e3c67402 100644
--- i/net/core/bpf_sk_storage.c
+++ w/net/core/bpf_sk_storage.c
@@ -425,7 +425,7 @@ BPF_CALL_4(bpf_sk_storage_get_tracing, struct bpf_map *, map, struct sock *, sk,
BPF_CALL_2(bpf_sk_storage_delete_tracing, struct bpf_map *, map,
struct sock *, sk)
{
- if (in_irq() || in_nmi())
+ if (in_nmi())
return -EPERM;
return ____bpf_sk_storage_delete(map, sk);
[...]
next prev parent reply other threads:[~2021-01-12 0:30 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210108231950.3844417-1-songliubraving@fb.com>
[not found] ` <20210108231950.3844417-2-songliubraving@fb.com>
2021-01-11 6:27 ` [PATCH bpf-next 1/4] bpf: enable task local storage for tracing programs Yonghong Song
2021-01-11 10:17 ` KP Singh
2021-01-11 15:56 ` Yonghong Song
2021-01-11 10:14 ` KP Singh
2021-01-11 23:16 ` Song Liu
2021-01-11 17:16 ` Yonghong Song
2021-01-11 18:56 ` Martin KaFai Lau
2021-01-11 21:35 ` KP Singh
2021-01-11 21:58 ` Martin KaFai Lau
2021-01-11 23:45 ` Song Liu
2021-01-12 16:32 ` Yonghong Song
2021-01-12 16:53 ` KP Singh
2021-01-15 23:34 ` Song Liu
2021-01-16 0:55 ` Yonghong Song
2021-01-16 1:12 ` Song Liu
2021-01-16 1:50 ` Yonghong Song
2021-01-11 23:41 ` Song Liu [this message]
2021-01-12 18:21 ` Martin KaFai Lau
[not found] ` <20210108231950.3844417-4-songliubraving@fb.com>
2021-01-11 17:37 ` [PATCH bpf-next 3/4] bpf: runqslower: prefer use local vmlinux Yonghong Song
[not found] ` <20210108231950.3844417-5-songliubraving@fb.com>
2021-01-11 17:49 ` [PATCH bpf-next 4/4] bpf: runqslower: use task local storage Yonghong Song
2021-01-11 22:54 ` Song Liu
2021-01-12 3:24 ` Yonghong Song
2021-01-12 7:14 ` Andrii Nakryiko
2021-01-12 7:33 ` Yonghong Song
[not found] ` <20210108231950.3844417-3-songliubraving@fb.com>
2021-01-11 17:30 ` [PATCH bpf-next 2/4] selftests/bpf: add non-BPF_LSM test for " Yonghong Song
2021-01-11 17:44 ` KP Singh
2021-01-11 22:50 ` Song Liu
2021-01-11 22:49 ` Song Liu
2021-01-12 7:06 ` Andrii Nakryiko
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=4D0333B1-C729-41BF-AB1D-9AC233431094@fb.com \
--to=songliubraving@fb.com \
--cc=Kernel-team@fb.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.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).