From: Tejun Heo <tj@kernel.org>
To: lizefan@huawei.com
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
Tejun Heo <tj@kernel.org>
Subject: [PATCH 4/4] cgroup: use release_agent_path_lock in cgroup_release_agent_show()
Date: Tue, 6 May 2014 07:50:44 -0400 [thread overview]
Message-ID: <1399377044-29873-5-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1399377044-29873-1-git-send-email-tj@kernel.org>
release_path is now protected by release_agent_path_lock to allow
accessing it without grabbing cgroup_mutex; however,
cgroup_release_agent_show() was still grabbing cgroup_mutex. Let's
convert it to release_agent_path_lock so that we don't have to worry
about this one for the planned locking updates.
Signed-off-by: Tejun Heo <tj@kernel.org>
---
kernel/cgroup.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 3ced79a..57c2021 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2373,11 +2373,10 @@ static int cgroup_release_agent_show(struct seq_file *seq, void *v)
{
struct cgroup *cgrp = seq_css(seq)->cgroup;
- if (!cgroup_lock_live_group(cgrp))
- return -ENODEV;
+ spin_lock(&release_agent_path_lock);
seq_puts(seq, cgrp->root->release_agent_path);
+ spin_unlock(&release_agent_path_lock);
seq_putc(seq, '\n');
- mutex_unlock(&cgroup_mutex);
return 0;
}
--
1.9.0
prev parent reply other threads:[~2014-05-06 11:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-06 11:50 [PATCHSET cgroup/for-3.16] cgroup: post unified hierarchy fixes and updates Tejun Heo
2014-05-06 11:50 ` [PATCH 1/4] cgroup: fix offlining child waiting in cgroup_subtree_control_write() Tejun Heo
2014-05-06 11:50 ` [PATCH 2/4] cgroup: only allow space as the separator for "cgroup.subtree_control" Tejun Heo
2014-05-06 13:22 ` [PATCH v2 2/9] cgroup: update and fix parsing of "cgroup.subtree_control" Tejun Heo
2014-05-06 11:50 ` [PATCH 3/4] cgroup: use restart_syscall() for retries after offline waits in cgroup_subtree_control_write() Tejun Heo
2014-05-06 11:50 ` Tejun Heo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1399377044-29873-5-git-send-email-tj@kernel.org \
--to=tj@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox