From: liwanwu <liwanwu@kylinos.cn>
To: Tejun Heo <tj@kernel.org>
Cc: Andrea Righi <arighi@nvidia.com>,
Changwoo Min <changwoo@igalia.com>,
Emil Tsalapatis <emil@etsalapatis.com>,
David Vernet <void@manifault.com>,
sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] sched_ext: Reject NMI calls to lock-taking kfuncs
Date: Thu, 3 Sep 2026 09:46:05 +0800 [thread overview]
Message-ID: <a66501d3-7bbe-40d4-b178-caae58ecc5dd@kylinos.cn> (raw)
In-Reply-To: <27793d61e70c3d4df415729e1d150ad0@kernel.org>
Thanks for the correction and the guidance. I'll send a follow-up
patch to fix the remaining issues.
在 2026/9/3 07:05, Tejun Heo 写道:
> Hello,
>
> On Wed, Sep 02, 2026 at 05:36:11PM +0800, Wanwu Li wrote:
>> +#define scx_kf_allowed_ctx(sch) \
>> +({ \
>> + bool __allowed = true; \
>
> Applied to sched_ext/for-7.4 with the following changes:
>
> - "No need to wrap" in my v2 reply was about the line wrap of the function
> signature. Restored the inline function + macro wrapper form:
>
> static __always_inline bool __scx_kf_allowed_ctx(struct scx_sched *sch, const char *who)
> {
> if (unlikely(in_nmi())) {
> scx_error(sch, "%s called from NMI", who);
> return false;
> }
> return true;
> }
>
> #define scx_kf_allowed_ctx(sch) __scx_kf_allowed_ctx((sch), __func__)
>
> - struct_ops don't run in task context (e.g. ops.tick() runs from the tick
> interrupt). They just never run in NMI. Updated the last paragraph of the
> description accordingly.
>
> Thanks.
>
> --
> tejun
next prev parent reply other threads:[~2026-09-03 1:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 9:56 [PATCH] " Wanwu Li
2026-09-01 19:51 ` Andrea Righi
2026-09-01 20:13 ` Tejun Heo
2026-09-01 20:28 ` Andrea Righi
2026-09-01 21:16 ` Tejun Heo
2026-09-02 2:31 ` [PATCH v2] " Wanwu Li
2026-09-02 6:44 ` Tejun Heo
2026-09-02 9:36 ` [PATCH v3] " Wanwu Li
2026-09-02 23:05 ` Tejun Heo
2026-09-03 1:46 ` liwanwu [this message]
2026-09-02 13:48 ` [PATCH v2] " liwanwu
2026-09-02 21:51 ` Tejun Heo
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=a66501d3-7bbe-40d4-b178-caae58ecc5dd@kylinos.cn \
--to=liwanwu@kylinos.cn \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=emil@etsalapatis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sched-ext@lists.linux.dev \
--cc=tj@kernel.org \
--cc=void@manifault.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
all inboxes | Powered by JetHome®