mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>
Cc: David Vernet <void@manifault.com>,
	Changwoo Min <changwoo@igalia.com>,
	sched-ext@lists.linux.dev, Emil Tsalapatis <emil@etsalapatis.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCHSET sched_ext/for-7.3] sched_ext: NMI-safe exit handling
Date: Mon, 27 Jul 2026 23:17:21 +0200	[thread overview]
Message-ID: <amfK4YdxcJqRp0jn@gpd4> (raw)
In-Reply-To: <20260725005019.1297049-1-tj@kernel.org>

On Fri, Jul 24, 2026 at 02:50:14PM -1000, Tejun Heo wrote:
> Hello,
> 
> The exit paths weren't NMI-safe: exit claiming walked the sub-scheduler
> hierarchy under scx_sched_lock and the bstr exit kfuncs formatted their
> messages into a shared buffer under a raw spinlock. Kfuncs in the "any"
> category are callable from tracing progs that can attach to functions
> running in NMI, and many of them raise scx_error() on invalid inputs, so
> an unlucky bad argument from such a prog could deadlock the machine. The
> hardlockup handler had the same problem and deferred its abort to an
> irq_work, which can't even run on the CPU that detected the lockup.
> 
> This series makes exit handling NMI-safe end to end:
> 
>  0001 makes exit claiming lock-free: ->aborting is asserted with a
>       synchronous lockless sweep and the locked SCX_EXIT_PARENT
>       propagation is deferred to an irq_work.
> 
>  0002 reverses the bstr exit sequence to claim-first so the message is
>       formatted directly into the winner-owned exit_info buffer. With
>       these two, scx_bpf_error() and scx_bpf_exit() are safe from any
>       context including NMI.
> 
>  0003-0005 apply the newly-possible direct error reporting: NMI kicks
>       abort the scheduler instead of being silently dropped, the
>       hardlockup handler aborts directly from NMI making self-detected
>       lockups recoverable, and scx_link_sched() reports failures inline.
> 
>  0001-sched_ext-Make-exit-claiming-lock-free.patch
>  0002-sched_ext-Format-bstr-exit-messages-after-claiming-t.patch
>  0003-sched_ext-Report-NMI-kicks-with-scx_error.patch
>  0004-sched_ext-Abort-directly-from-the-hardlockup-handler.patch
>  0005-sched_ext-Report-scx_link_sched-failures-inline.patch

With the new patch 1/5:

Reviewed-by: Andrea Righi <arighi@nvidia.com>

Thanks,
-Andrea

  parent reply	other threads:[~2026-07-27 21:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-25  0:50 Tejun Heo
2026-07-25  0:50 ` [PATCH 1/5] sched_ext: Make exit claiming lock-free Tejun Heo
2026-07-27 19:35   ` Andrea Righi
2026-07-27 20:36   ` [PATCH v2 " Tejun Heo
2026-07-25  0:50 ` [PATCH 2/5] sched_ext: Format bstr exit messages after claiming the exit Tejun Heo
2026-07-25  0:50 ` [PATCH 3/5] sched_ext: Report NMI kicks with scx_error() Tejun Heo
2026-07-25  0:50 ` [PATCH 4/5] sched_ext: Abort directly from the hardlockup handler Tejun Heo
2026-07-25  0:50 ` [PATCH 5/5] sched_ext: Report scx_link_sched() failures inline Tejun Heo
2026-07-27 21:17 ` Andrea Righi [this message]
2026-07-27 21:24 ` [PATCHSET sched_ext/for-7.3] sched_ext: NMI-safe exit handling 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=amfK4YdxcJqRp0jn@gpd4 \
    --to=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®