Commit cdcc136f authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Ingo Molnar

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: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent f032a450
...@@ -265,7 +265,7 @@ list_for_each_entry(_root, &roots, root_list) ...@@ -265,7 +265,7 @@ list_for_each_entry(_root, &roots, root_list)
/* the list of cgroups eligible for automatic release. Protected by /* the list of cgroups eligible for automatic release. Protected by
* release_list_lock */ * release_list_lock */
static LIST_HEAD(release_list); static LIST_HEAD(release_list);
static DEFINE_SPINLOCK(release_list_lock); static DEFINE_RAW_SPINLOCK(release_list_lock);
static void cgroup_release_agent(struct work_struct *work); static void cgroup_release_agent(struct work_struct *work);
static DECLARE_WORK(release_agent_work, cgroup_release_agent); static DECLARE_WORK(release_agent_work, cgroup_release_agent);
static void check_for_release(struct cgroup *cgrp); static void check_for_release(struct cgroup *cgrp);
...@@ -4014,11 +4014,11 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry) ...@@ -4014,11 +4014,11 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry)
finish_wait(&cgroup_rmdir_waitq, &wait); finish_wait(&cgroup_rmdir_waitq, &wait);
clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags); clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags);
spin_lock(&release_list_lock); raw_spin_lock(&release_list_lock);
set_bit(CGRP_REMOVED, &cgrp->flags); set_bit(CGRP_REMOVED, &cgrp->flags);
if (!list_empty(&cgrp->release_list)) if (!list_empty(&cgrp->release_list))
list_del_init(&cgrp->release_list); list_del_init(&cgrp->release_list);
spin_unlock(&release_list_lock); raw_spin_unlock(&release_list_lock);
cgroup_lock_hierarchy(cgrp->root); cgroup_lock_hierarchy(cgrp->root);
/* delete this cgroup from parent->children */ /* delete this cgroup from parent->children */
...@@ -4671,13 +4671,13 @@ static void check_for_release(struct cgroup *cgrp) ...@@ -4671,13 +4671,13 @@ static void check_for_release(struct cgroup *cgrp)
* already queued for a userspace notification, queue * already queued for a userspace notification, queue
* it now */ * it now */
int need_schedule_work = 0; int need_schedule_work = 0;
spin_lock(&release_list_lock); raw_spin_lock(&release_list_lock);
if (!cgroup_is_removed(cgrp) && if (!cgroup_is_removed(cgrp) &&
list_empty(&cgrp->release_list)) { list_empty(&cgrp->release_list)) {
list_add(&cgrp->release_list, &release_list); list_add(&cgrp->release_list, &release_list);
need_schedule_work = 1; need_schedule_work = 1;
} }
spin_unlock(&release_list_lock); raw_spin_unlock(&release_list_lock);
if (need_schedule_work) if (need_schedule_work)
schedule_work(&release_agent_work); schedule_work(&release_agent_work);
} }
...@@ -4729,7 +4729,7 @@ static void cgroup_release_agent(struct work_struct *work) ...@@ -4729,7 +4729,7 @@ static void cgroup_release_agent(struct work_struct *work)
{ {
BUG_ON(work != &release_agent_work); BUG_ON(work != &release_agent_work);
mutex_lock(&cgroup_mutex); mutex_lock(&cgroup_mutex);
spin_lock(&release_list_lock); raw_spin_lock(&release_list_lock);
while (!list_empty(&release_list)) { while (!list_empty(&release_list)) {
char *argv[3], *envp[3]; char *argv[3], *envp[3];
int i; int i;
...@@ -4738,7 +4738,7 @@ static void cgroup_release_agent(struct work_struct *work) ...@@ -4738,7 +4738,7 @@ static void cgroup_release_agent(struct work_struct *work)
struct cgroup, struct cgroup,
release_list); release_list);
list_del_init(&cgrp->release_list); list_del_init(&cgrp->release_list);
spin_unlock(&release_list_lock); raw_spin_unlock(&release_list_lock);
pathbuf = kmalloc(PAGE_SIZE, GFP_KERNEL); pathbuf = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!pathbuf) if (!pathbuf)
goto continue_free; goto continue_free;
...@@ -4768,9 +4768,9 @@ static void cgroup_release_agent(struct work_struct *work) ...@@ -4768,9 +4768,9 @@ static void cgroup_release_agent(struct work_struct *work)
continue_free: continue_free:
kfree(pathbuf); kfree(pathbuf);
kfree(agentbuf); kfree(agentbuf);
spin_lock(&release_list_lock); raw_spin_lock(&release_list_lock);
} }
spin_unlock(&release_list_lock); raw_spin_unlock(&release_list_lock);
mutex_unlock(&cgroup_mutex); mutex_unlock(&cgroup_mutex);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment