Commit a7e54635 authored by Frederic Weisbecker's avatar Frederic Weisbecker
Browse files

cpuset: Provide lockdep check for cpuset lock held



cpuset modifies partitions, including isolated, while holding the cpuset
mutex.

This means that holding the cpuset mutex is safe to synchronize against
housekeeping cpumask changes.

Provide a lockdep check to validate that.

Signed-off-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Cc: "Michal Koutný" <mkoutny@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.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: Vlastimil Babka <vbabka@suse.cz>
Cc: Waiman Long <longman@redhat.com>
Cc: cgroups@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
parent 622c508b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@
#include <linux/mmu_context.h>
#include <linux/jump_label.h>

extern bool lockdep_is_cpuset_held(void);

#ifdef CONFIG_CPUSETS

/*
+7 −0
Original line number Diff line number Diff line
@@ -283,6 +283,13 @@ void cpuset_full_unlock(void)
	cpus_read_unlock();
}

#ifdef CONFIG_LOCKDEP
bool lockdep_is_cpuset_held(void)
{
	return lockdep_is_held(&cpuset_mutex);
}
#endif

static DEFINE_SPINLOCK(callback_lock);

void cpuset_callback_lock_irq(void)