]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cgroup/cpuset: add callback_lock helper
authorChen Ridong <chenridong@huawei.com>
Fri, 30 Aug 2024 10:02:23 +0000 (10:02 +0000)
committerTejun Heo <tj@kernel.org>
Fri, 30 Aug 2024 20:00:16 +0000 (10:00 -1000)
To modify cpuset, both cpuset_mutex and callback_lock are needed. Add
helpers for cpuset-v1 to get callback_lock.

Signed-off-by: Chen Ridong <chenridong@huawei.com>
Acked-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cpuset-internal.h
kernel/cgroup/cpuset.c

index 02c4b0c74fa9b36eb4227718b65c601fc4fdca7e..9a60dd6681e47594d07a1563c14d79a69f432a58 100644 (file)
@@ -239,6 +239,8 @@ static inline int is_spread_slab(const struct cpuset *cs)
 }
 
 void rebuild_sched_domains_locked(void);
+void callback_lock_irq(void);
+void callback_unlock_irq(void);
 
 /*
  * cpuset-v1.c
index c77f35fb83478d448a7bbb4aee53bfb5b9d756c3..8a9a7fe1ec1e4006216ff0cf6893cefec9636b83 100644 (file)
@@ -275,6 +275,16 @@ void cpuset_unlock(void)
 
 static DEFINE_SPINLOCK(callback_lock);
 
+void callback_lock_irq(void)
+{
+       spin_lock_irq(&callback_lock);
+}
+
+void callback_unlock_irq(void)
+{
+       spin_unlock_irq(&callback_lock);
+}
+
 static struct workqueue_struct *cpuset_migrate_mm_wq;
 
 static DECLARE_WAIT_QUEUE_HEAD(cpuset_attach_wq);