Skip to content

Commit 530020f

Browse files
Chen Ridonghtejun
authored andcommitted
cgroup/cpuset: add callback_lock helper
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 <[email protected]> Acked-by: Waiman Long <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 90eec95 commit 530020f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

kernel/cgroup/cpuset-internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ static inline int is_spread_slab(const struct cpuset *cs)
239239
}
240240

241241
void rebuild_sched_domains_locked(void);
242+
void callback_lock_irq(void);
243+
void callback_unlock_irq(void);
242244

243245
/*
244246
* cpuset-v1.c

kernel/cgroup/cpuset.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,16 @@ void cpuset_unlock(void)
275275

276276
static DEFINE_SPINLOCK(callback_lock);
277277

278+
void callback_lock_irq(void)
279+
{
280+
spin_lock_irq(&callback_lock);
281+
}
282+
283+
void callback_unlock_irq(void)
284+
{
285+
spin_unlock_irq(&callback_lock);
286+
}
287+
278288
static struct workqueue_struct *cpuset_migrate_mm_wq;
279289

280290
static DECLARE_WAIT_QUEUE_HEAD(cpuset_attach_wq);

0 commit comments

Comments
 (0)