mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-26 01:22:40 -04:00
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>
This commit is contained in:
@@ -74,6 +74,7 @@ extern void inc_dl_tasks_cs(struct task_struct *task);
|
||||
extern void dec_dl_tasks_cs(struct task_struct *task);
|
||||
extern void cpuset_lock(void);
|
||||
extern void cpuset_unlock(void);
|
||||
extern void lockdep_assert_cpuset_lock_held(void);
|
||||
extern void cpuset_cpus_allowed_locked(struct task_struct *p, struct cpumask *mask);
|
||||
extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask);
|
||||
extern bool cpuset_cpus_allowed_fallback(struct task_struct *p);
|
||||
@@ -195,6 +196,7 @@ static inline void inc_dl_tasks_cs(struct task_struct *task) { }
|
||||
static inline void dec_dl_tasks_cs(struct task_struct *task) { }
|
||||
static inline void cpuset_lock(void) { }
|
||||
static inline void cpuset_unlock(void) { }
|
||||
static inline void lockdep_assert_cpuset_lock_held(void) { }
|
||||
|
||||
static inline void cpuset_cpus_allowed_locked(struct task_struct *p,
|
||||
struct cpumask *mask)
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user