mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Song Chen <chensong_2000@126.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>, bot+bpf-ci@kernel.org
Cc: Martin KaFai Lau <martin.lau@linux.dev>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>, Eduard <eddyz87@gmail.com>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Kaitao Cheng <kaitao.cheng@linux.dev>, bpf <bpf@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Martin KaFai Lau <martin.lau@kernel.org>,
	Chris Mason <clm@meta.com>,
	Ihor Solodrai <ihor.solodrai@linux.dev>
Subject: Re: [PATCH v3] kernel/bpf/btf.c: reject to register duplicated kfunc
Date: Mon, 25 May 2026 15:47:44 +0800	[thread overview]
Message-ID: <ea0903f9-8fe3-41eb-940d-00b469cef26e@126.com> (raw)
In-Reply-To: <CAADnVQKVwHLX8-jo48zAijROpJ_K1VqgF=gG2oxiO0Mw7EeObA@mail.gmail.com>

Hi,

在 2026/5/24 17:42, Alexei Starovoitov 写道:
> On Sun, May 24, 2026 at 11:15 AM <bot+bpf-ci@kernel.org> wrote:
>>
>>> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
>>> index 17d4ab0a8206..425c9f5c64fa 100644
>>> --- a/kernel/bpf/btf.c
>>> +++ b/kernel/bpf/btf.c
>>> @@ -8673,6 +8673,47 @@ static int btf_check_iter_kfuncs(struct btf *btf, const char *func_name,
>>>        return 0;
>>>   }
>>>
>>> +static int btf_check_kfunc_name(struct btf *btf, const char *func_name, u32 kind)
>>> +{
>>> +#ifdef CONFIG_DEBUG_INFO_BTF_MODULES
>>> +     struct btf_module *btf_mod, *tmp;
>>> +#endif
>>> +     s32 id;
>>> +     int ret = 0;
>>> +
>>> +     if (!btf_is_module(btf))
>>> +             goto out;
>>
>> During v2 review, Alexei Starovoitov suggested a different approach: instead
>> of rejecting duplicate kfunc registration, he proposed allowing module kfuncs
>> to override kernel kfuncs, similar to livepatching. He stated: "imo that's a
>> more interesting use case than helping out-of-tree module to produce nicier
>> error" and "I'm not convinced that we should be doing it... because ^^^ is
>> what I think we should be doing instead."
>>
>> The author requested implementation guidance on how the override mechanism
>> would determine which kfunc to call, but received no maintainer response.
>>
>> Should this implementation be reconsidered?
> 
> It was considered and I said later to defer this idea for now.
> AI should consider the whole discussion thread instead of immediate replies.
> I guess in this case the threads were broken into multiple
> due to different subjects.
> 
> Song,
> in the future please try to use one subject.

will do. AI review is really amazing and I'm so impressed to its smartness.

> 
> Also "kernel/bpf/btf.c:" is not a valid prefix.
> I will fix it up while applying when trees are ffwded after pending PR.

will do and I appreciate it.

Song


  reply	other threads:[~2026-05-25  7:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-24  8:29 Song Chen
2026-05-24  9:15 ` bot+bpf-ci
2026-05-24  9:42   ` Alexei Starovoitov
2026-05-25  7:47     ` Song Chen [this message]
2026-05-25  9:18 ` Kaitao Cheng
2026-05-29  3:01   ` Alexei Starovoitov
2026-06-01  9:23     ` Song Chen
2026-06-01  9:21   ` Song Chen
2026-06-01  9:39   ` Song Chen
2026-06-01 16:09     ` Yonghong Song
2026-06-02 11:01       ` Song Chen

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=ea0903f9-8fe3-41eb-940d-00b469cef26e@126.com \
    --to=chensong_2000@126.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bot+bpf-ci@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=clm@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kaitao.cheng@linux.dev \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --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

all inboxes | Powered by JetHome®