Patch "cgroup/cpuset: Skip spread flags update on v2" has been added to the 5.10-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: Skip spread flags update on v2

to the 5.10-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-skip-spread-flags-update-on-v2.patch
and it can be found in the queue-5.10 subdirectory.

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


>From stable-owner@xxxxxxxxxxxxxxx Mon Apr 17 19:21:24 2023
From: Waiman Long <longman@xxxxxxxxxx>
Date: Mon, 17 Apr 2023 13:19:56 -0400
Subject: cgroup/cpuset: Skip spread flags update on v2
To: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, stable@xxxxxxxxxxxxxxx
Cc: "Tejun Heo" <tj@xxxxxxxxxx>, "Michal Koutný" <mkoutny@xxxxxxxx>, "Giuseppe Scrivano" <gscrivan@xxxxxxxxxx>, "Waiman Long" <longman@xxxxxxxxxx>
Message-ID: <20230417171958.3389333-2-longman@xxxxxxxxxx>

From: Waiman Long <longman@xxxxxxxxxx>

commit 18f9a4d47527772515ad6cbdac796422566e6440 upstream.

Cpuset v2 has no spread flags to set. So we can skip spread
flags update if cpuset v2 is being used. Also change the name to
cpuset_update_task_spread_flags() to indicate that there are multiple
spread flags.

Signed-off-by: Waiman Long <longman@xxxxxxxxxx>
Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 kernel/cgroup/cpuset.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -424,11 +424,15 @@ static void guarantee_online_mems(struct
 /*
  * update task's spread flag if cpuset's page/slab spread flag is set
  *
- * Call with callback_lock or cpuset_rwsem held.
+ * Call with callback_lock or cpuset_rwsem held. The check can be skipped
+ * if on default hierarchy.
  */
-static void cpuset_update_task_spread_flag(struct cpuset *cs,
+static void cpuset_update_task_spread_flags(struct cpuset *cs,
 					struct task_struct *tsk)
 {
+	if (cgroup_subsys_on_dfl(cpuset_cgrp_subsys))
+		return;
+
 	if (is_spread_page(cs))
 		task_set_spread_page(tsk);
 	else
@@ -1907,7 +1911,7 @@ static void update_tasks_flags(struct cp
 
 	css_task_iter_start(&cs->css, 0, &it);
 	while ((task = css_task_iter_next(&it)))
-		cpuset_update_task_spread_flag(cs, task);
+		cpuset_update_task_spread_flags(cs, task);
 	css_task_iter_end(&it);
 }
 
@@ -2241,7 +2245,7 @@ static void cpuset_attach(struct cgroup_
 		WARN_ON_ONCE(set_cpus_allowed_ptr(task, cpus_attach));
 
 		cpuset_change_task_nodemask(task, &cpuset_attach_nodemask_to);
-		cpuset_update_task_spread_flag(cs, task);
+		cpuset_update_task_spread_flags(cs, task);
 	}
 
 	/*


Patches currently in stable-queue which might be from stable-owner@xxxxxxxxxxxxxxx are

queue-5.10/kbuild-check-the-minimum-assembler-version-in-kconfig.patch
queue-5.10/cgroup-cpuset-make-cpuset_fork-handle-clone_into_cgroup-properly.patch
queue-5.10/kbuild-check-config_as_is_llvm-instead-of-llvm_ias.patch
queue-5.10/riscv-handle-zicsr-zifencei-issues-between-clang-and-binutils.patch
queue-5.10/kbuild-switch-to-f-variants-of-integrated-assembler-flag.patch
queue-5.10/cgroup-cpuset-add-cpuset_can_fork-and-cpuset_cancel_fork-methods.patch
queue-5.10/cgroup-cpuset-change-references-of-cpuset_mutex-to-cpuset_rwsem.patch
queue-5.10/cgroup-cpuset-skip-spread-flags-update-on-v2.patch



[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