From: Vasily Gorbik <gor@linux.ibm.com>
To: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
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>,
John Stultz <jstultz@google.com>,
"Connor O'Brien" <connoro@google.com>,
Vineeth Pillai <vineethrp@google.com>,
Joel Fernandes <joelagnelf@nvidia.com>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] sched/core: Don't steal a proxy-exec donor
Date: Tue, 5 May 2026 12:03:02 +0200 [thread overview]
Message-ID: <ttek6l2@ub.hpns> (raw)
In-Reply-To: <10282ce9-f4ae-498f-9b57-f4e1e61fffbc@amd.com>
On Mon, May 04, 2026 at 06:49:05PM +0530, K Prateek Nayak wrote:
> On 5/4/2026 6:01 PM, Vasily Gorbik wrote:
...
> > Commit 7de9d4f94638 ("sched: Start blocked_on chain processing in
> > find_proxy_task()") tweaked the fair class logic so that the donor task
> > isn't migrated away while running the proxy. Do it similarly for
> > try_steal_cookie() and skip src->donor as well.
> >
> > Fixes: 7de9d4f94638 ("sched: Start blocked_on chain processing in find_proxy_task()")
> > Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
> > ---
> > kernel/sched/core.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index b8871449d3c6..3cf5fb70814c 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -6358,7 +6358,7 @@ static bool try_steal_cookie(int this, int that)
> > return false;
> >
> > do {
> > - if (p == src->core_pick || p == src->curr)
> > + if (p == src->core_pick || p == src->curr || p == src->donor)
>
> Although this solves the issue of stealing the donor, I'm a bit
> skeptical if proxy exec even works with core scheduling at all since
> __schedule() can override the decision of core_pick and the CPU
> may end up running a task with different core-cookie if it found
> the core_pick to be blocked on a mutex :-(
I think this patch is still valid on its own.
The cookie problem probably needs to be handled separately.
Do you mean this path?
next = pick_next_task(...);
rq_set_donor(rq, next);
next = find_proxy_task(...); /* may replace next with mutex owner */
I'm trying a check in find_proxy_task(), before returning the final owner:
---
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 3cf5fb70814c..46d21ac83e72 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6952,6 +6952,12 @@ find_proxy_task(struct rq *rq, struct task_struct *donor, struct rq_flags *rf)
*/
}
WARN_ON_ONCE(owner && !owner->on_rq);
+
+ if (owner && !sched_cpu_cookie_match(rq, owner)) {
+ if (curr_in_chain)
+ return proxy_resched_idle(rq);
+ goto deactivate;
+ }
return owner;
deactivate:
--
But I'm not sure this is the right/acceptable/sufficient fix though.
With that check and with temporary debugfs counters I added, on the same
LPAR as in my initial report:
cd strace/tests && make -j$(nproc) check
gives:
attempt_total 157
attempt_cookie 106
attempt_cookie_mismatch 105
exec_total 52
exec_cookie 1
exec_cookie_mismatch 0
So strace tests do exercise mismatched proxy attempts. I'm not sure if
there is a better specific proxy-exec test to run, please let me know.
prev parent reply other threads:[~2026-05-05 10:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 12:31 [PATCH 0/1] sched/core: Don't steal a proxy-exec donor Vasily Gorbik
2026-05-04 12:31 ` [PATCH 1/1] " Vasily Gorbik
2026-05-04 13:19 ` K Prateek Nayak
2026-05-05 10:03 ` Vasily Gorbik [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=ttek6l2@ub.hpns \
--to=gor@linux.ibm.com \
--cc=bsegall@google.com \
--cc=connoro@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=joelagnelf@nvidia.com \
--cc=jstultz@google.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vineethrp@google.com \
--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