summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorChen Ridong <chenridong@huawei.com>2025-12-18 09:31:36 +0000
committerTejun Heo <tj@kernel.org>2025-12-18 08:35:57 -1000
commit14c11e1b2ac47fbc51503c7d0f35fad9ea5ea46e (patch)
tree1259a7bb20a1f63344c63c6452a6dedb144f06cb /kernel
parent6ee43047e8ada63c4dfee01e2ea7e7eadfcda2ab (diff)
cpuset: add lockdep_assert_cpuset_lock_held helper
Add lockdep_assert_cpuset_lock_held() to allow other subsystems to verify that cpuset_mutex is held. Suggested-by: Waiman Long <longman@redhat.com> Signed-off-by: Chen Ridong <chenridong@huawei.com> Reviewed-by: Waiman Long <longman@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup/cpuset.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index fea577b4016a..4fa3080da3be 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -271,6 +271,11 @@ void cpuset_unlock(void)
mutex_unlock(&cpuset_mutex);
}
+void lockdep_assert_cpuset_lock_held(void)
+{
+ lockdep_assert_held(&cpuset_mutex);
+}
+
/**
* cpuset_full_lock - Acquire full protection for cpuset modification
*