mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qiliang Yuan <qiliang.yuan@linux.dev>
To: K Prateek Nayak <kprateek.nayak@amd.com>,
	Peter Zijlstra <peterz@infradead.org>
Cc: Qiliang Yuan <qiliang.yuan@linux.dev>,
	Ingo Molnar <mingo@redhat.com>,
	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>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] sched/fair: Avoid re-syncing runtime_enabled on root domain changes
Date: Sat, 14 Nov 2026 22:59:06 -0500	[thread overview]
Message-ID: <20261115035906.1185642-1-qiliang.yuan@linux.dev> (raw)
In-Reply-To: <e1a63a3c-3975-4b05-8ab4-518c37d867d6@amd.com>

On Fri, Nov 13, 2026 at 11:57:54AM +0530, K Prateek Nayak wrote:
> Question: Why do we need to do rq_offline_fair() + rq_online_fair()
> during cpuset for active CPUs since fair doesn't have any accounting
> linked to rd at all?
>
> For deadline and RT it makes sense for bandwidth accounting and
> rto_mask updates on new rd but fair, and ext shouldn't really
> care for a rd change.
>
> Would it make sense to separate the offline / online bits from
> a root domain switch? It won't speed up hotplug but it should
> speed up cpusets causing domain rebuilds.
[...]

Agreed, fair has nothing to redo when an active CPU only moves to a
new root domain.

Peter, I have a v2 that follows your earlier suggestion: rq_online()
and rq_offline() get a bool that says whether the CPU changes state,
and fair skips both walks when it doesn't. Hotplug gets faster as well,
since every hotplug rebuilds the domains and moves the other active
CPUs. With 4000 cpu cgroups on a 32-CPU VM, switching a 4-CPU cpuset
to a partition root and offlining or onlining one CPU take (median of
20 partition switches and 16 hotplug operations):

  operation         before (ms)  after (ms)  change
  partition root          19.73        1.19    -94%
  cpu offline             44.93       12.83    -71%
  cpu online              37.03       12.94    -65%

Prateek's split should give the same results and keeps the root domain
switch out of rq_online()/rq_offline(), which reads cleaner. One
difference: with it, a CPU coming up gets rq_online() from
sched_set_rq_online() after the rebuild, while today and in my v2 it
gets it from rq_attach_root() during the rebuild.

Which way would you prefer? I can post the v2 as it is, or rework it on
top of Prateek's patch.

Thanks,
Qiliang

      reply	other threads:[~2026-11-15  3:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  1:24 [PATCH 0/2] sched/fair: Cut per-group work from sched domain rebuilds Qiliang Yuan
2026-11-12  1:24 ` [PATCH 1/2] sched/fair: Skip rq_offline_fair() work for CPUs that stay active Qiliang Yuan
2026-11-12  1:24 ` [PATCH 2/2] sched/fair: Avoid re-syncing runtime_enabled on root domain changes Qiliang Yuan
2026-11-12 10:56   ` Peter Zijlstra
2026-11-12 11:10     ` Qiliang Yuan
2026-11-12 12:59       ` Peter Zijlstra
2026-11-13  6:27         ` K Prateek Nayak
2026-11-15  3:59           ` Qiliang Yuan [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=20261115035906.1185642-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=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®