Skip to content

Commit cdcc136

Browse files
KAGA-KOKOIngo Molnar
authored andcommitted
locking, sched, cgroups: Annotate release_list_lock as raw
The release_list_lock can be taken in atomic context and therefore cannot be preempted on -rt - annotate it. In mainline this change documents the low level nature of the lock - otherwise there's no functional difference. Lockdep and Sparse checking will work as usual. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent f032a45 commit cdcc136

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎kernel/cgroup.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ list_for_each_entry(_root, &roots, root_list)
265265
/* the list of cgroups eligible for automatic release. Protected by
266266
* release_list_lock */
267267
static LIST_HEAD(release_list);
268-
static DEFINE_SPINLOCK(release_list_lock);
268+
static DEFINE_RAW_SPINLOCK(release_list_lock);
269269
static void cgroup_release_agent(struct work_struct *work);
270270
static DECLARE_WORK(release_agent_work, cgroup_release_agent);
271271
static void check_for_release(struct cgroup *cgrp);
@@ -4014,11 +4014,11 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry)
40144014
finish_wait(&cgroup_rmdir_waitq, &wait);
40154015
clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags);
40164016

4017-
spin_lock(&release_list_lock);
4017+
raw_spin_lock(&release_list_lock);
40184018
set_bit(CGRP_REMOVED, &cgrp->flags);
40194019
if (!list_empty(&cgrp->release_list))
40204020
list_del_init(&cgrp->release_list);
4021-
spin_unlock(&release_list_lock);
4021+
raw_spin_unlock(&release_list_lock);
40224022

40234023
cgroup_lock_hierarchy(cgrp->root);
40244024
/* delete this cgroup from parent->children */
@@ -4671,13 +4671,13 @@ static void check_for_release(struct cgroup *cgrp)
46714671
* already queued for a userspace notification, queue
46724672
* it now */
46734673
int need_schedule_work = 0;
4674-
spin_lock(&release_list_lock);
4674+
raw_spin_lock(&release_list_lock);
46754675
if (!cgroup_is_removed(cgrp) &&
46764676
list_empty(&cgrp->release_list)) {
46774677
list_add(&cgrp->release_list, &release_list);
46784678
need_schedule_work = 1;
46794679
}
4680-
spin_unlock(&release_list_lock);
4680+
raw_spin_unlock(&release_list_lock);
46814681
if (need_schedule_work)
46824682
schedule_work(&release_agent_work);
46834683
}
@@ -4729,7 +4729,7 @@ static void cgroup_release_agent(struct work_struct *work)
47294729
{
47304730
BUG_ON(work != &release_agent_work);
47314731
mutex_lock(&cgroup_mutex);
4732-
spin_lock(&release_list_lock);
4732+
raw_spin_lock(&release_list_lock);
47334733
while (!list_empty(&release_list)) {
47344734
char *argv[3], *envp[3];
47354735
int i;
@@ -4738,7 +4738,7 @@ static void cgroup_release_agent(struct work_struct *work)
47384738
struct cgroup,
47394739
release_list);
47404740
list_del_init(&cgrp->release_list);
4741-
spin_unlock(&release_list_lock);
4741+
raw_spin_unlock(&release_list_lock);
47424742
pathbuf = kmalloc(PAGE_SIZE, GFP_KERNEL);
47434743
if (!pathbuf)
47444744
goto continue_free;
@@ -4768,9 +4768,9 @@ static void cgroup_release_agent(struct work_struct *work)
47684768
continue_free:
47694769
kfree(pathbuf);
47704770
kfree(agentbuf);
4771-
spin_lock(&release_list_lock);
4771+
raw_spin_lock(&release_list_lock);
47724772
}
4773-
spin_unlock(&release_list_lock);
4773+
raw_spin_unlock(&release_list_lock);
47744774
mutex_unlock(&cgroup_mutex);
47754775
}
47764776

0 commit comments

Comments
 (0)