From: Karl Mehltretter <kmehltretter@gmail.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Karl Mehltretter <kmehltretter@gmail.com>,
linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
syzbot <syzbot+6835d5c11145e4f77057@syzkaller.appspotmail.com>,
Thomas Gleixner <tglx@kernel.org>, Radu Rendec <radu@rendec.net>,
Ingo Molnar <mingo@redhat.com>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>,
K Prateek Nayak <kprateek.nayak@amd.com>
Subject: Re: [PATCH v3] sched: Reset cpumask if __migrate_task() failed for migration_cpu_stop()
Date: Sat, 21 Nov 2026 15:39:12 +0100 [thread overview]
Message-ID: <20261121143912.70448-1-kmehltretter@gmail.com> (raw)
In-Reply-To: <20261120171658.Cf9qIU-Y@linutronix.de>
On Fri, 20 Nov 2026 18:16:58 +0100, Sebastian Andrzej Siewior wrote:
> syzbot reported a race of assigning a CPU affinity during CPU hotplug
> operation.
I tested the patch on PREEMPT_RT with syzbot's config, changing IRQ
affinities while SMT was switched off and on. The warning is gone with
the patch. Without it, every boot warned, and one also hit a BUG:
kernel BUG at kernel/sched/core.c:3642!
try_to_wake_up+0x85f/0x1320
irq_do_set_affinity+0x42c/0x5d0
RIP: 0010:select_fallback_rq+0x1f6/0x200
Kernel panic - not syncing: Fatal exception in interrupt
> There are a few spots where set_cpus_allowed_ptr() does not use
> cpus_read_lock(). In the IRQ thread case, there will be an update
> following if the CPU goes offline so it is not really needed to block
> CPU hotplug during the update.
sched_setaffinity() is one of those spots, but a user task gets no
later update.
With the patch, a test that changed the affinity of user threads in the
same setup read back a CPU outside the requested mask in about 1 of 5000
calls, on RT and non-RT. Without the patch it never did.
Thanks,
Karl
prev parent reply other threads:[~2026-11-21 14:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 17:16 Sebastian Andrzej Siewior
2026-11-21 13:20 ` Karl Mehltretter
2026-11-21 14:39 ` Karl Mehltretter [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=20261121143912.70448-1-kmehltretter@gmail.com \
--to=kmehltretter@gmail.com \
--cc=bigeasy@linutronix.de \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=radu@rendec.net \
--cc=rostedt@goodmis.org \
--cc=syzbot+6835d5c11145e4f77057@syzkaller.appspotmail.com \
--cc=tglx@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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®