From: Petr Pavlu <petr.pavlu@suse.com>
To: bot+bpf-ci@kernel.org
Cc: mcgrof@kernel.org, da.gomez@kernel.org, samitolvanen@google.com,
ast@kernel.org, daniel@iogearbox.net, atomlin@atomlin.com,
john.fastabend@gmail.com, linux-modules@vger.kernel.org,
bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
andrii@kernel.org, martin.lau@kernel.org, eddyz87@gmail.com,
yonghong.song@linux.dev, mason@kernel.org,
ihor.solodrai@linux.dev
Subject: Re: [PATCH] module: Add stubs.c for CONFIG_MODULES=n module_put_and_kthread_exit()
Date: Fri, 25 Sep 2026 11:17:15 +0200 [thread overview]
Message-ID: <2452a9dc-4622-4de5-b58a-ea9e0a911387@suse.com> (raw)
In-Reply-To: <ee510141f44725527b6a2f60cae4323f26ecde36d3a592ba997648de45c80134@mail.kernel.org>
On 9/22/26 4:16 PM, bot+bpf-ci@kernel.org wrote:
>> diff --git a/kernel/module/stubs.c b/kernel/module/stubs.c
>> new file mode 100644
>> index 0000000000000..81e66c02260c8
>> --- /dev/null
>> +++ b/kernel/module/stubs.c
>> @@ -0,0 +1,11 @@
>> +// SPDX-License-Identifier: GPL-2.0-or-later
>> +
>> +#include <linux/kthread.h>
>> +#include <linux/module.h>
>> +#include "internal.h"
>
> This isn't a bug, but does stubs.c need "internal.h" here, or would
> <linux/kthread.h> plus <linux/module.h> be enough?
>
> kthread_exit() comes from <linux/kthread.h>, and struct module,
> __noreturn, and EXPORT_SYMBOL come from <linux/module.h>. The file
> doesn't appear to use anything that internal.h provides.
>
> This makes stubs.c the only consumer of that header outside
> CONFIG_MODULES=y, which future internal.h changes would have to keep
> working.
Ack.
>
>> +
>> +void __noreturn __module_put_and_kthread_exit(struct module *mod, long code)
>> +{
>> + kthread_exit(code);
>> +}
>> +EXPORT_SYMBOL(__module_put_and_kthread_exit);
>
> This isn't a bug, but since stubs.o only exists for CONFIG_MODULES=n, is
> the EXPORT_SYMBOL() reachable by any module, or can it be dropped?
>
> No loadable module can resolve this export when CONFIG_MODULES=n. The
> macro still expands (producing an .export_symbol entry that
> COMMON_DISCARDS drops at link, plus __ADDRESSABLE()), so it's harmless
> but has no consumer.
>
> kernel/time/posix-stubs.c, cited in the commit message as the model,
> exports nothing.
Ack.
I'll incorporate these two suggested cleanups in v2.
-- Petr
prev parent reply other threads:[~2026-09-25 9:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 13:08 Petr Pavlu
2026-09-22 14:16 ` bot+bpf-ci
2026-09-25 9:17 ` Petr Pavlu [this message]
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=2452a9dc-4622-4de5-b58a-ea9e0a911387@suse.com \
--to=petr.pavlu@suse.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=atomlin@atomlin.com \
--cc=bot+bpf-ci@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=da.gomez@kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=ihor.solodrai@linux.dev \
--cc=john.fastabend@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=martin.lau@kernel.org \
--cc=mason@kernel.org \
--cc=mcgrof@kernel.org \
--cc=samitolvanen@google.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
all inboxes | Powered by JetHome®