All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Segall <bsegall@google.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>,
	 Mel Gorman <mgorman@suse.de>,
	 Valentin Schneider <vschneid@redhat.com>,
	Aaron Lu <ziqianlu@bytedance.com>,  Josh Don <joshdon@google.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 5/5] sched/fair: Unify cfs_rq throttling via account_cfs_rq_runtime()
Date: Thu, 28 May 2026 15:44:14 -0700	[thread overview]
Message-ID: <xm268q93m9xd.fsf@google.com> (raw)
In-Reply-To: <20260528094830.13291-6-kprateek.nayak@amd.com> (K. Prateek Nayak's message of "Thu, 28 May 2026 09:48:30 +0000")

K Prateek Nayak <kprateek.nayak@amd.com> writes:

> From: Peter Zijlstra <peterz@infradead.org>
>
> assign_cfs_rq_runtime() during update_curr() sets the resched indicator
> and relies on check_cfs_rq_runtime() during pick_next_task() /
> put_prev_entity() to throttle the hierarchy once current task is
> preempted / blocks.
>
> Per-task throttle, on the other hand, uses throttle_cfs_rq() to simply
> propagate the throttle signals, and then relies on task work to
> individually throttle the runnable tasks on their way out to the
> userspace.
>
> Remove check_cfs_rq_runtime() and unify throttling into
> account_cfs_rq_runtime() which only sets the cfs_rq->throttled,
> cfs_rq->throttle_count indicators via throttle_cfs_rq() and optionally
> adds the task work to the current task (donor) it is on the throttled
> hierarchy.
>
> throttle_cfs_rq() requests for sched_cfs_bandwidth_slice() worth of
> bandwidth for the current hierarchy that enable it to continue running
> uninterrupted when selected. For the rest, it requests a bare minimum of
> "1" to ensure some bandwidth is available and pass the
> "runtime_remaining > 0" checks once selected.
>
> For SCHED_PROXY_EXEC, a mutex holder cannot exit to userspace without
> dropping it first and the mutex_unlock() ensures proxy is stopped before
> the mutex handoff which preserves the current semantics for running a
> throttled task until it exits to the userspace even if it acts as a
> donor.
>
>   [ prateek: rebased on tip, comments, commit message. ]

Yeah, no need to go into schedule() anymore. Having some extra callers
of task_throttle_setup_work() instead is better.

Reviewed-By: Benjamin Segall <bsegall@google.com>

  reply	other threads:[~2026-05-28 22:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28  9:48 [PATCH 0/5] sched/fair: Allow account_cfs_rq_runtime() to throttle current hierarchy K Prateek Nayak
2026-05-28  9:48 ` [PATCH 1/5] sched/fair: Convert cfs bandwidth throttling to use guards K Prateek Nayak
2026-05-28 21:46   ` Benjamin Segall
2026-05-28  9:48 ` [PATCH 2/5] sched/fair: Use throttled_csd_list for local unthrottle K Prateek Nayak
2026-05-28 21:53   ` Benjamin Segall
2026-05-28  9:48 ` [PATCH 3/5] sched/fair: Call update_curr() before unthrottling the hierarchy K Prateek Nayak
2026-05-28 22:03   ` Benjamin Segall
2026-06-01  3:52   ` Aaron Lu
2026-06-01  5:50     ` K Prateek Nayak
2026-06-01 11:27       ` Peter Zijlstra
2026-06-02  6:33         ` K Prateek Nayak
2026-05-28  9:48 ` [PATCH 4/5] sched/fair: Move the throttled tasks to a local list in tg_unthrottle_up() K Prateek Nayak
2026-05-28 22:14   ` Benjamin Segall
2026-05-28  9:48 ` [PATCH 5/5] sched/fair: Unify cfs_rq throttling via account_cfs_rq_runtime() K Prateek Nayak
2026-05-28 22:44   ` Benjamin Segall [this message]
2026-06-01 13:48   ` Peter Zijlstra
2026-06-02  7:01     ` K Prateek Nayak
2026-06-02  8:32       ` Peter Zijlstra
2026-06-02  8:57         ` K Prateek Nayak
2026-05-28 11:45 ` [PATCH 0/5] sched/fair: Allow account_cfs_rq_runtime() to throttle current hierarchy Peter Zijlstra
2026-06-01  6:18 ` Aaron Lu

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=xm268q93m9xd.fsf@google.com \
    --to=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=joshdon@google.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=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=ziqianlu@bytedance.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.