mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qiliang Yuan <qiliang.yuan@linux.dev>
To: Li kunyu <likunyu@open-hieco.net>
Cc: Qiliang Yuan <qiliang.yuan@linux.dev>,
	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>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] sched: Tell rq_online() and rq_offline() whether the CPU changes state
Date: Thu, 19 Nov 2026 20:51:30 -0500	[thread overview]
Message-ID: <20261120015130.41615-1-qiliang.yuan@linux.dev> (raw)
In-Reply-To: <6fd92ba8-2249-b5e1-772d-cc598c91bad5@open-hieco.net>

On Thu, Nov 19, 2026 at 04:29:27PM +0800, Li kunyu wrote:
> Is this parameter currently unused, or is it being introduced at the callback
> layer in advance for future use cases?

Only the fair class uses it, later in this series:

  callback                         uses hotplug
  rq_offline_fair()                yes, patch 2 returns early when !hotplug
  rq_online_fair()                 yes, patch 3 calls update_runtime_enabled()
                                   only when hotplug is true
  rq_online_rt(), rq_offline_rt()  no
  rq_online_dl(), rq_offline_dl()  no

The rt and dl callbacks take it only because they share the
sched_class callback type, and they have no use for it, whatever
tasks run on the CPU. They move state that lives in the root domain,
so they have to do the same work on hotplug and on a root domain
change:

  callback          work                       why also on !hotplug
  rq_offline_rt()   rt_clear_overload(),       rto_mask and cpupri live in
                    __disable_runtime(),       rq->rd, so leave the old root
                    cpupri -> CPUPRI_INVALID   domain; reclaim RT runtime
                                               lent within it
  rq_online_rt()    rt_set_overload(),         register the overload state
                    __enable_runtime(),        and the highest RT priority in
                    cpupri_set()               the new root domain for push/pull
  rq_offline_dl()   dl_clear_overload(),       dlo_mask and cpudl live in
                    cpudl_clear()              rq->rd, so leave the old root
                                               domain
  rq_online_dl()    dl_set_overload(),         register the earliest deadline
                    cpudl_set()/cpudl_clear()  in the new root domain for
                                               push/pull

The fair callbacks handle task group state (throttling and the
bandwidth switch), which doesn't depend on the root domain, so they
can skip it when the CPU stays active.

Passing a bool follows Peter's suggestion on v1 [1]. Prateek proposed
instead to give root domain changes their own callbacks, implemented
by rt and dl only, which leaves rq_online() and rq_offline() to CPU
hotplug and needs no parameter [2].

As only the fair class needs the distinction, I'll rework the series
along Prateek's lines in v3, so that rt and dl don't carry a
parameter they never use.

[1] https://lore.kernel.org/r/20261112125947.GZ1813469@noisy.programming.kicks-ass.net
[2] https://lore.kernel.org/r/e1a63a3c-3975-4b05-8ab4-518c37d867d6@amd.com

Thanks,
Qiliang

  reply	other threads:[~2026-11-20  1:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  0:57 [PATCH v2 0/3] sched/fair: Cut per-group work from sched domain rebuilds Qiliang Yuan
2026-11-19  0:57 ` [PATCH v2 1/3] sched: Tell rq_online() and rq_offline() whether the CPU changes state Qiliang Yuan
2026-11-19  8:29   ` Li kunyu
2026-11-20  1:51     ` Qiliang Yuan [this message]
2026-11-20  2:24       ` Li kunyu
2026-11-19  0:57 ` [PATCH v2 2/3] sched/fair: Skip rq_offline_fair() work for CPUs that stay active Qiliang Yuan
2026-11-19  0:57 ` [PATCH v2 3/3] sched/fair: Avoid re-syncing runtime_enabled on root domain changes Qiliang Yuan

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=20261120015130.41615-1-qiliang.yuan@linux.dev \
    --to=qiliang.yuan@linux.dev \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=likunyu@open-hieco.net \
    --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 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®