Patch "cgroup/cpuset: Fix load balance state in update_partition_sd_lb()" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    cgroup/cpuset: Fix load balance state in update_partition_sd_lb()

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     cgroup-cpuset-fix-load-balance-state-in-update_parti.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 89d7711fc3d347d9f4715ae72aac502b6eada512
Author: Waiman Long <longman@xxxxxxxxxx>
Date:   Tue Sep 5 09:32:37 2023 -0400

    cgroup/cpuset: Fix load balance state in update_partition_sd_lb()
    
    [ Upstream commit 6fcdb0183bf024a70abccb0439321c25891c708d ]
    
    Commit a86ce68078b2 ("cgroup/cpuset: Extract out CS_CPU_EXCLUSIVE
    & CS_SCHED_LOAD_BALANCE handling") adds a new helper function
    update_partition_sd_lb() to update the load balance state of the
    cpuset. However the new load balance is determined by just looking at
    whether the cpuset is a valid isolated partition root or not.  That is
    not enough if the cpuset is not a valid partition root but its parent
    is in the isolated state (load balance off). Update the function to
    set the new state to be the same as its parent in this case like what
    has been done in commit c8c926200c55 ("cgroup/cpuset: Inherit parent's
    load balance state in v2").
    
    Fixes: a86ce68078b2 ("cgroup/cpuset: Extract out CS_CPU_EXCLUSIVE & CS_SCHED_LOAD_BALANCE handling")
    Signed-off-by: Waiman Long <longman@xxxxxxxxxx>
    Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 58ec88efa4f82..4749e0c86c62c 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -1304,13 +1304,23 @@ static int update_partition_exclusive(struct cpuset *cs, int new_prs)
  *
  * Changing load balance flag will automatically call
  * rebuild_sched_domains_locked().
+ * This function is for cgroup v2 only.
  */
 static void update_partition_sd_lb(struct cpuset *cs, int old_prs)
 {
 	int new_prs = cs->partition_root_state;
-	bool new_lb = (new_prs != PRS_ISOLATED);
 	bool rebuild_domains = (new_prs > 0) || (old_prs > 0);
+	bool new_lb;
 
+	/*
+	 * If cs is not a valid partition root, the load balance state
+	 * will follow its parent.
+	 */
+	if (new_prs > 0) {
+		new_lb = (new_prs != PRS_ISOLATED);
+	} else {
+		new_lb = is_sched_load_balance(parent_cs(cs));
+	}
 	if (new_lb != !!is_sched_load_balance(cs)) {
 		rebuild_domains = true;
 		if (new_lb)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux