diff options
| author | Frederic Weisbecker <frederic@kernel.org> | 2025-05-27 15:33:01 +0200 |
|---|---|---|
| committer | Frederic Weisbecker <frederic@kernel.org> | 2026-02-03 15:23:33 +0100 |
| commit | 622c508bcf4852ad56ae37bf6f08e9a4e6aa95b2 (patch) | |
| tree | 580f02393150240c322e2a4fd376f7cf0ea36261 /include | |
| parent | b5de34ed87f39fc3f6eb7e7df543317e7efb94a8 (diff) | |
cpu: Provide lockdep check for CPU hotplug lock write-held
cpuset modifies partitions, including isolated, while holding the cpu
hotplug lock read-held.
This means that write-holding the CPU hotplug lock is safe to
synchronize against housekeeping cpumask changes.
Provide a lockdep check to validate that.
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Cc: Marco Crivellari <marco.crivellari@suse.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Waiman Long <longman@redhat.com>
Cc: linux-kernel@vger.kernel.org
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/cpuhplock.h | 1 | ||||
| -rw-r--r-- | include/linux/percpu-rwsem.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/cpuhplock.h b/include/linux/cpuhplock.h index f7aa20f62b87..286b3ab92e15 100644 --- a/include/linux/cpuhplock.h +++ b/include/linux/cpuhplock.h @@ -13,6 +13,7 @@ struct device; extern int lockdep_is_cpus_held(void); +extern int lockdep_is_cpus_write_held(void); #ifdef CONFIG_HOTPLUG_CPU void cpus_write_lock(void); diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h index 288f5235649a..c8cb010d655e 100644 --- a/include/linux/percpu-rwsem.h +++ b/include/linux/percpu-rwsem.h @@ -161,6 +161,7 @@ extern void percpu_free_rwsem(struct percpu_rw_semaphore *); __percpu_init_rwsem(sem, #sem, &rwsem_key); \ }) +#define percpu_rwsem_is_write_held(sem) lockdep_is_held_type(sem, 0) #define percpu_rwsem_is_held(sem) lockdep_is_held(sem) #define percpu_rwsem_assert_held(sem) lockdep_assert_held(sem) |
