From: Shubhang Kaushik <shubhang@os.amperecomputing.com>
To: Vincent Guittot <vincent.guittot@linaro.org>,
K Prateek Nayak <kprateek.nayak@amd.com>
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
linux-kernel@vger.kernel.org, qyousef@layalina.io
Subject: Re: [PATCH 4/6 v3] sched/eevdf: Cancel slice protection if short slice task is eligible
Date: Thu, 25 Jun 2026 22:51:57 -0700 (PDT) [thread overview]
Message-ID: <9d7c6e58-0572-b745-774e-94feef4e7c5b@os.amperecomputing.com> (raw)
In-Reply-To: <CAKfTPtDQk6qoo+1MZ50NFMiJVJOG0S19+Frbp9F1XfcQc0fB9Q@mail.gmail.com>
Hi Vincent,
On Thu, 25 Jun 2026, Vincent Guittot wrote:
> On Thu, 25 Jun 2026 at 08:00, K Prateek Nayak <kprateek.nayak@amd.com> wrote:
>>
>> Hello Vincent,
>>
>> On 6/24/2026 8:42 PM, Vincent Guittot wrote:
>>> @@ -9896,16 +9891,23 @@ static void wakeup_preempt_fair(struct rq *rq, struct task_struct *p, int wake_f
>>> if (!nse && cfs_rq->nr_queued)
>>> goto pick;
>>>
>>> + /*
>>> + * If @p is eligible but not the next task to run then cancel protection
>>> + * to prevent large scheduling latency
>>> + */
>>> + if (preempt_action == PREEMPT_WAKEUP_SHORT && entity_eligible(cfs_rq, pse))
>>> + goto preempt;
>>
>> We handle "pse->slice < se->slice" case before "pse->sched_delayed" case
>> and jump to "pick", but pse can get dequeued as a part of
>> pick_next_entity() if it was delayed and picked.
>
> yes
>
>>
>> I think we can reach here for PREEMPT_WAKEUP_SHORT after pse is
>> completely dequeued from cfs_rq. If p is a task on root cfs_rq, we could
>> have blocked the task entirely and ideally it shouldn't be referenced
>> here.
>
> I tried to find which use case calls wakeup_preempt_fair() for a
> sched_delayed task but can't find it
>
>>
>> Since a wakeup of delayed entity / on delayed hierarchy will call
>> wakeup_preempt() anyways, I think we should return early if we should
>> directly jump to update if we see "pse->sched_delayed".
>
> Fair enough. But we still need to consider the FORK case
>
I tested the v3 series on Ampere Altra using cyclictest with high
concurrency rt-app and hackbench load matrices. I tried to follow your
same setup for the testsuite as described in the cover letter
with the baseline as tip/sched/core.
The maximum latency changed as follows:-
- cyclictest: 112us -> 62us
- cyclictest + rt-app: 108us -> 166us
- cyclictest + hackbench: 173us -> 154us
The patchset improved the two cases above but regresses the rt-app tail.
Would the regression be caused by the interaction between the larger
competing slices and repeated short task wakeups? These repeatedly tend
to cancel or recompute the running entity's protection.
>>
>>> +
>>> if (sched_feat(RUN_TO_PARITY))
>>> update_protect_slice(cfs_rq, se);
>>>
>>> return;
>>>
>>> preempt:
>>> - if (preempt_action == PREEMPT_WAKEUP_SHORT) {
>>> - cancel_protect_slice(se);
>>> + cancel_protect_slice(se);
>>> +
>>> + if (preempt_action == PREEMPT_WAKEUP_SHORT && nse == pse)
>>> set_next_buddy(&p->se);
>>> - }
>>>
>>> resched_curr_lazy(rq);
>>> }
>>
>> --
>> Thanks and Regards,
>> Prateek
>>
>
Regards,
Shubhang Kaushik
next prev parent reply other threads:[~2026-06-26 5:52 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 15:12 [PATCH 0/6 v3] sched/eevdf: Improve scheduling latency of short slice task Vincent Guittot
2026-06-24 15:12 ` [PATCH 1/6 v3] sched/fair: Set next buddy for preempt short Vincent Guittot
2026-06-25 6:24 ` K Prateek Nayak
2026-06-25 12:40 ` Vincent Guittot
2026-06-25 12:43 ` Peter Zijlstra
2026-06-26 6:54 ` Peter Zijlstra
2026-06-26 7:02 ` Vincent Guittot
2026-06-26 8:08 ` Peter Zijlstra
2026-06-26 8:55 ` Vincent Guittot
2026-06-30 9:03 ` [tip: sched/core] " tip-bot2 for Vincent Guittot
2026-06-24 15:12 ` [PATCH 2/6 v3] sched/eevdf: Take into account current's lag when updating slice protection Vincent Guittot
2026-06-30 9:03 ` [tip: sched/core] " tip-bot2 for Vincent Guittot
2026-06-24 15:12 ` [PATCH 3/6 v3] sched/eevdf: Update slice protection even when resched is already set Vincent Guittot
2026-06-26 7:21 ` Peter Zijlstra
2026-06-26 7:46 ` Peter Zijlstra
2026-06-30 9:03 ` [tip: sched/core] sched/core: Fix inter-class wakeup_preempt() tip-bot2 for Peter Zijlstra
2026-06-30 9:03 ` [tip: sched/core] sched/eevdf: Update slice protection even when resched is already set tip-bot2 for Vincent Guittot
2026-06-24 15:12 ` [PATCH 4/6 v3] sched/eevdf: Cancel slice protection if short slice task is eligible Vincent Guittot
2026-06-25 6:00 ` K Prateek Nayak
2026-06-25 12:40 ` Vincent Guittot
2026-06-26 5:51 ` Shubhang Kaushik [this message]
2026-06-26 7:39 ` Vincent Guittot
2026-06-30 9:03 ` [tip: sched/core] " tip-bot2 for Vincent Guittot
2026-06-24 15:12 ` [PATCH 5/6 v3] sched/eevdf: Always update slice protection Vincent Guittot
2026-06-30 9:03 ` [tip: sched/core] " tip-bot2 for Vincent Guittot
2026-06-24 15:12 ` [PATCH 6/6 v3] sched/eevdf: Speedup short slice task scheduling Vincent Guittot
2026-06-25 7:37 ` K Prateek Nayak
2026-06-25 8:37 ` Peter Zijlstra
2026-06-25 10:09 ` Peter Zijlstra
2026-06-25 12:57 ` Vincent Guittot
2026-06-25 12:59 ` Vincent Guittot
2026-06-25 22:28 ` Peter Zijlstra
2026-06-26 3:57 ` K Prateek Nayak
2026-06-26 6:41 ` Peter Zijlstra
2026-06-26 7:05 ` Vincent Guittot
2026-06-26 7:18 ` Peter Zijlstra
2026-06-26 7:54 ` Peter Zijlstra
2026-06-26 8:55 ` Vincent Guittot
2026-06-26 13:55 ` Vincent Guittot
2026-06-29 14:25 ` Vincent Guittot
2026-06-25 14:55 ` Vincent Guittot
2026-06-25 12:51 ` Vincent Guittot
2026-06-25 8:33 ` Peter Zijlstra
2026-06-30 9:03 ` [tip: sched/core] " tip-bot2 for Vincent Guittot
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=9d7c6e58-0572-b745-774e-94feef4e7c5b@os.amperecomputing.com \
--to=shubhang@os.amperecomputing.com \
--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=qyousef@layalina.io \
--cc=rostedt@goodmis.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
Powered by JetHome