mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chaosheng Qu <quchaosheng000406@163.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Martin King <martin3kx@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Thorsten Leemhuis <regressions@leemhuis.info>,
	regressions@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-rt-users@vger.kernel.org
Subject: Re: [PATCH] sched/rt: push a queued task when its priority is boosted
Date: Sat, 28 Nov 2026 13:30:20 +0800	[thread overview]
Message-ID: <1795844918.22303.56574936672463@163.com> (raw)
In-Reply-To: <20261124120829.53F8ppqc@linutronix.de>

Thanks -- you are right on both counts, and the first one is a hole in the
patch as posted.

prio_changed_rt() only reaches resched_curr() when the boosted task outranks
the donor; my changelog was too short there.

The pushable entry is the real problem.  @p is already on
rq->rt.pushable_tasks (enqueue_task_rt() added it when it was queued, and
nothing removes it while it stays queued), but the plist node and
rq->rt.highest_prio.next still hold the priority it had at enqueue time:
plist_node_init(&p->pushable_tasks, p->prio) and
enqueue/dequeue_pushable_task() are the only places that touch either.  So
after a boost, pick_next_pushable_task() can hand back another task, and the
stale highest_prio.next also hides @p behind the
src_rq->rt.highest_prio.next >= this_rq->rt.highest_prio.curr filter in the
pull path.  A push queued without re-adding the entry can therefore do
nothing.

v2 re-adds the entry at the new priority before queuing the push:

	if (oldprio > p->prio && p->nr_cpus_allowed > 1) {
		dequeue_pushable_task(rq, p);
		enqueue_pushable_task(rq, p);
		if (p->prio >= rq->donor->prio)
			rt_queue_push_tasks(rq);
	}

The p->prio >= rq->donor->prio guard is only there to skip the case
resched_curr() already handles: if the boost makes @p outrank the donor, the
local reschedule runs it and a push would be wasted work.

On RT_PUSH_IPI, your reading of the pull path is right.  pull_rt_task()
walks rq->rd->rto_mask and pick_highest_pushable_task(src_rq, this_cpu) only
accepts a task whose cpus_mask contains the pulling CPU (task_is_pushable()
in sched.h).  With the feature on, pull_rt_task() does not pull at all: it
calls tell_cpu_to_push() and the overloaded CPU pushes, so the source rq
chooses the destination through find_lowest_rq() using the task's own
cpus_mask, never the identity of the idle CPU.  That is why the same
workload migrates with RT_PUSH_IPI on and sits behind the hog with it off --
the affinity filter moves from "can this idle CPU take it" to "which allowed
CPU is lowest priority".

The reproducer is a 4-vCPU QEMU guest (TCG; no KVM here), non-RT kernel,
RT_PUSH_IPI off.  I can post it separately if Martin wants to run it before
v2 goes out.

Thanks,
Chaosheng


  reply	other threads:[~2026-11-28  5:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 21:12 [REGRESSION] sched/rt: NO_RT_PUSH_IPI causes multi-second PI-boost starvation in pro-audio workloads (dd29c017aed6) Martin King
2026-08-14 22:36 ` Steven Rostedt
2026-09-03 11:27   ` Thorsten Leemhuis
2026-09-03 13:20     ` Steven Rostedt
2026-10-15  6:19       ` Chaosheng Qu
2026-10-15 12:46         ` Steven Rostedt
2026-11-21 11:31           ` [PATCH] sched/rt: push a queued task when its priority is boosted Chaosheng Qu
2026-11-24 12:08             ` Sebastian Andrzej Siewior
2026-11-28  5:30               ` Chaosheng Qu [this message]
2026-10-17 12:14         ` [PATCH] sched/rt: queue a push when a queued RT task " Chaosheng Qu
2026-10-17 14:44           ` Kayra Cizmeci
2026-10-18  3:42             ` Chaosheng Qu

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=1795844918.22303.56574936672463@163.com \
    --to=quchaosheng000406@163.com \
    --cc=bigeasy@linutronix.de \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=martin3kx@gmail.com \
    --cc=peterz@infradead.org \
    --cc=regressions@leemhuis.info \
    --cc=regressions@lists.linux.dev \
    --cc=rostedt@goodmis.org \
    /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®