From: Thomas Gleixner <tglx@linutronix.de>
To: Kunwu Chan <kunwu.chan@linux.dev>,
Kunwu Chan <kunwu.chan@linux.dev>,
ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org,
yonghong.song@linux.dev, john.fastabend@gmail.com,
kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com,
jolsa@kernel.org, bigeasy@linutronix.de, clrkwllms@kernel.org,
rostedt@goodmis.org
Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-rt-devel@lists.linux.dev,
syzbot+b506de56cbbb63148c33@syzkaller.appspotmail.com
Subject: Re: [PATCH] bpf: Convert lpm_trie::lock to 'raw_spinlock_t'
Date: Fri, 15 Nov 2024 23:29:31 +0100 [thread overview]
Message-ID: <87sersyvuc.ffs@tglx> (raw)
In-Reply-To: <1e5910b1-ea54-4b7a-a68b-a02634a517dd@linux.dev>
On Thu, Nov 14 2024 at 10:43, Kunwu Chan wrote:
> On 2024/11/12 23:08, Thomas Gleixner wrote:
>>> @@ -330,7 +330,7 @@ static long trie_update_elem(struct bpf_map *map,
>>> if (key->prefixlen > trie->max_prefixlen)
>>> return -EINVAL;
>>>
>>> - spin_lock_irqsave(&trie->lock, irq_flags);
>>> + raw_spin_lock_irqsave(&trie->lock, irq_flags);
>>>
>>> /* Allocate and fill a new node */
>> Making this a raw spinlock moves the problem from the BPF trie code into
>> the memory allocator. On RT the memory allocator cannot be invoked under
>> a raw spinlock.
> I'am newbiee in this field. But actually when i change it to a raw
> spinlock, the problem syzbot reported dispeared.
Yes, because the actual code path which is going to trigger this, is not
reached. But it will be reached at some point.
IIRC, BPF has it's own allocator which can be used everywhere.
Thanks,
tglx
next prev parent reply other threads:[~2024-11-15 22:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 6:32 [PATCH] bpf: Convert lpm_trie::lock to 'raw_spinlock_t' Kunwu Chan
2024-11-08 20:22 ` Alexei Starovoitov
2024-11-09 2:46 ` Hou Tao
2024-11-10 0:04 ` Alexei Starovoitov
2024-11-10 2:08 ` Hou Tao
2024-11-14 10:09 ` Sebastian Sewior
2024-11-12 15:08 ` Thomas Gleixner
2024-11-14 2:43 ` Kunwu Chan
2024-11-15 22:29 ` Thomas Gleixner [this message]
2024-11-16 9:21 ` Sebastian Andrzej Siewior
2024-11-16 16:01 ` Alexei Starovoitov
2024-11-16 16:15 ` Thomas Weißschuh
2024-11-16 16:42 ` Alexei Starovoitov
2024-11-17 1:24 ` Hou Tao
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=87sersyvuc.ffs@tglx \
--to=tglx@linutronix.de \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=bpf@vger.kernel.org \
--cc=clrkwllms@kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=kunwu.chan@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=martin.lau@linux.dev \
--cc=rostedt@goodmis.org \
--cc=sdf@fomichev.me \
--cc=song@kernel.org \
--cc=syzbot+b506de56cbbb63148c33@syzkaller.appspotmail.com \
--cc=yonghong.song@linux.dev \
/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