All of lore.kernel.org
 help / color / mirror / Atom feed
From: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>
Cc: mingo@redhat.com, juri.lelli@redhat.com,
	dietmar.eggemann@arm.com, rostedt@goodmis.org,
	bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
	dhaval@gianis.ca, linux-kernel@vger.kernel.org,
	Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Subject: Re: [PATCH v3 4/6] sched/fair: Limit run to parity to the min slice of enqueued entities
Date: Sun, 13 Jul 2025 23:47:23 +0530	[thread overview]
Message-ID: <71bf9ee3-859c-4c3e-9db4-38c1ab35440a@linux.ibm.com> (raw)
In-Reply-To: <20250710123435.GM1613376@noisy.programming.kicks-ass.net>

Hi Vincent, Peter

On 10/07/25 18:04, Peter Zijlstra wrote:
> 
>>> If I set my task’s custom slice to a larger value but another task has a smaller slice,
>>> this change will cap my protected window to the smaller slice. Does that mean my custom
>>> slice is no longer honored?
>>
>> What do you mean by honored ? EEVDF never mandates that a request of
>> size slice will be done in one go. Slice mainly defines the deadline
>> and orders the entities but not that it will always run your slice in
>> one go. Run to parity tries to minimize the number of context switches
>> between runnable tasks but must not break fairness and lag theorem.So
>> If your task A has a slice of 10ms and task B wakes up with a slice of
>> 1ms. B will preempt A because its deadline is earlier. If task B still
>> wants to run after its slice is exhausted, it will not be eligible and
>> task A will run until task B becomes eligible, which is as long as
>> task B's slice.
> 
> Right. Added if you don't want wakeup preemption, we've got SCHED_BATCH
> for you.

Thanks for the explanation. Understood now that slice is only for deadline
calculation and ordering for eligible tasks.

Before your patch, I observed that each task ran for its full custom slice
before preemption, which led me to assume that slice directly controlled
uninterrupted runtime.

With the patch series applied and RUN_TO_PARITY=true, I now see the expected behavior:
- Default slice (~2.8 ms): tasks run ~3 ms each.
- Increasing one task’s slice doesn’t extend its single‐run duration—it remains ~3 ms.
- Decreasing one tasks’ slice shortens everyone’s run to that new minimum.

With this patch series, With NO_RUN_TO_PARITY, I see runtimes near 1 ms (CONFIG_HZ=1000).

However, without your patches, I was still seeing ~3 ms runs even with NO_RUN_TO_PARITY,
which confused me because I expected runtime to drop to ~1 ms (preempt at every tick)
rather than run up to the default slice.

Without your patches and having RUN_TO_PARITY is as expected. Task running till it's
slice when eligible.

I ran these with 16 stress‑ng threads pinned to one CPU.

Please let me know if my understanding is incorrect, and why I was still seeing ~3 ms
runtimes with NO_RUN_TO_PARITY before this patch series.

Thanks,
Madadi Vineeth Reddy

  reply	other threads:[~2025-07-13 18:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-08 16:56 [PATCH v3 0/6] sched/fair: Manage lag and run to parity with different slices Vincent Guittot
2025-07-08 16:56 ` [PATCH v3 1/6] sched/fair: Use protect_slice() instead of direct comparison Vincent Guittot
2025-07-10 12:46   ` [tip: sched/core] " tip-bot2 for Vincent Guittot
2025-07-08 16:56 ` [PATCH v3 2/6] sched/fair: Fix NO_RUN_TO_PARITY case Vincent Guittot
2025-07-09  9:17   ` Peter Zijlstra
2025-07-09  9:32     ` Vincent Guittot
2025-07-10 12:46   ` [tip: sched/core] " tip-bot2 for Vincent Guittot
2025-07-08 16:56 ` [PATCH v3 3/6] sched/fair: Remove spurious shorter slice preemption Vincent Guittot
2025-07-10 12:46   ` [tip: sched/core] " tip-bot2 for Vincent Guittot
2025-07-08 16:56 ` [PATCH v3 4/6] sched/fair: Limit run to parity to the min slice of enqueued entities Vincent Guittot
2025-07-10  6:59   ` Madadi Vineeth Reddy
2025-07-10 10:40     ` Vincent Guittot
2025-07-10 12:34       ` Peter Zijlstra
2025-07-13 18:17         ` Madadi Vineeth Reddy [this message]
2025-07-20 10:57           ` Madadi Vineeth Reddy
2025-07-21  9:11             ` Vincent Guittot
2025-07-21 15:22               ` Madadi Vineeth Reddy
2025-07-21  9:06           ` Vincent Guittot
2025-07-10 12:46   ` [tip: sched/core] " tip-bot2 for Vincent Guittot
2025-07-08 16:56 ` [PATCH v3 5/6] sched/fair: Fix entity's lag with run to parity Vincent Guittot
2025-07-10 12:46   ` [tip: sched/core] " tip-bot2 for Vincent Guittot
2025-07-08 16:56 ` [PATCH v3 6/6] sched/fair: Always trigger resched at the end of a protected period Vincent Guittot
2025-07-10 12:46   ` [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=71bf9ee3-859c-4c3e-9db4-38c1ab35440a@linux.ibm.com \
    --to=vineethr@linux.ibm.com \
    --cc=bsegall@google.com \
    --cc=dhaval@gianis.ca \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.