mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 14:20:23 +0100	[thread overview]
Message-ID: <20261121132023.41237-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:
>  		if (task_on_rq_queued(p)) {
>  			update_rq_clock(rq);
>  			rq = __migrate_task(rq, &rf, p, arg->dest_cpu);
> +			if (rq != cpu_rq(arg->dest_cpu)) {
> +				struct affinity_context ac = {
> +					.new_mask  = cpumask_of(rq->cpu),
> +				};
> +
> +				do_set_cpus_allowed(p, &ac);
> +			}

do_set_cpus_allowed() updates the rq clock a second time here, through
sched_change_begin() without DEQUEUE_NOCLOCK. With WARN_DOUBLE_CLOCK
enabled:

  WARNING: kernel/sched/core.c:881 at update_rq_clock+0x4c7/0x560, CPU#0: migration/0/22
  Stopper: migration_cpu_stop+0x0/0xbe0 <- __set_cpus_allowed_ptr_locked+0xd1e/0x19c0
   sched_change_begin+0x14d/0x660
   migration_cpu_stop+0x5f6/0xbe0
   cpu_stopper_thread+0x25e/0x3f0

Seen on v7.4-rc3 with this patch (RT and non-RT) with sched_setaffinity() loops
while another loop writes off and on to /sys/devices/system/cpu/smt/control.

Thanks,
Karl

  reply	other threads:[~2026-11-21 13:20 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 [this message]
2026-11-21 14:39 ` Karl Mehltretter

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=20261121132023.41237-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®