mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juri Lelli <juri.lelli@redhat.com>
To: Waiman Long <longman@redhat.com>
Cc: "Tejun Heo" <tj@kernel.org>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Michal Koutný" <mkoutny@suse.com>,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] cgroup/cpuset: Enforce at most one rebuild_sched_domains_locked() call per operation
Date: Mon, 11 Nov 2024 10:56:29 +0000	[thread overview]
Message-ID: <ZzHi3VIQAx4AJ3lP@jlelli-thinkpadt14gen4.remote.csb> (raw)
In-Reply-To: <20241110025023.664487-3-longman@redhat.com>

Hi,

On 09/11/24 21:50, Waiman Long wrote:
> Since commit ff0ce721ec21 ("cgroup/cpuset: Eliminate unncessary
> sched domains rebuilds in hotplug"), there is only one
> rebuild_sched_domains_locked() call per hotplug operation. However,
> writing to the various cpuset control files may still casue more than
> one rebuild_sched_domains_locked() call to happen in some cases.
> 
> Juri had found that two rebuild_sched_domains_locked() calls in
> update_prstate(), one from update_cpumasks_hier() and another one from
> update_partition_sd_lb() could cause cpuset partition to be created
> with null total_bw for DL tasks. IOW, DL tasks may not be scheduled
> correctly in such a partition.
> 
> A sample command sequence that can reproduce null total_bw is as
> follows.
> 
>   # echo Y >/sys/kernel/debug/sched/verbose
>   # echo +cpuset >/sys/fs/cgroup/cgroup.subtree_control
>   # mkdir /sys/fs/cgroup/test
>   # echo 0-7 > /sys/fs/cgroup/test/cpuset.cpus
>   # echo 6-7 > /sys/fs/cgroup/test/cpuset.cpus.exclusive
>   # echo root >/sys/fs/cgroup/test/cpuset.cpus.partition
> 
> Fix this double rebuild_sched_domains_locked() calls problem
> by replacing existing calls with cpuset_force_rebuild() except
> the rebuild_sched_domains_cpuslocked() call at the end of
> cpuset_handle_hotplug(). Checking of the force_sd_rebuild flag is
> now done at the end of cpuset_write_resmask() and update_prstate()
> to determine if rebuild_sched_domains_locked() should be called or not.
> 
> The cpuset v1 code can still call rebuild_sched_domains_locked()
> directly as double rebuild_sched_domains_locked() calls is not possible.
> 
> Reported-by: Juri Lelli <juri.lelli@redhat.com>
> Closes: https://lore.kernel.org/lkml/ZyuUcJDPBln1BK1Y@jlelli-thinkpadt14gen4.remote.csb/
> Signed-off-by: Waiman Long <longman@redhat.com>

This indeed works for me and fixes things with the test above (on v2).

Tested-by: Juri Lelli <juri.lelli@redhat.com>

Thanks!
Juri


  reply	other threads:[~2024-11-11 10:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-10  2:50 [PATCH 0/3] cgroup/cpuset: Remove redundant rebuild_sched_domains_locked() calls Waiman Long
2024-11-10  2:50 ` [PATCH 1/3] cgroup/cpuset: Revert "Allow suppression of sched domain rebuild in update_cpumasks_hier()" Waiman Long
2024-11-10  2:50 ` [PATCH 2/3] cgroup/cpuset: Enforce at most one rebuild_sched_domains_locked() call per operation Waiman Long
2024-11-11 10:56   ` Juri Lelli [this message]
2024-11-10  2:50 ` [PATCH 3/3] cgroup/cpuset: Further optimize code if CONFIG_CPUSETS_V1 not set Waiman Long
2024-11-12 19:08 ` [PATCH 0/3] cgroup/cpuset: Remove redundant rebuild_sched_domains_locked() calls Tejun Heo

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=ZzHi3VIQAx4AJ3lP@jlelli-thinkpadt14gen4.remote.csb \
    --to=juri.lelli@redhat.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mkoutny@suse.com \
    --cc=tj@kernel.org \
    /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®