History

Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: rcu: create rcu_my_thread_group_empty() wrapper memcg: css_id() must be called under rcu_read_lock() cgroup: Check task_lock in task_subsys_state() sched: Fix an RCU warning in print_task() cgroup: Fix an RCU warning in alloc_css_id() cgroup: Fix an RCU warning in cgroup_path() KEYS: Fix an RCU warning in the reading of user keys KEYS: Fix an RCU warning

Linus Torvalds committed 16 years ago

Commit 91bc4822 parents e8e8fad ee84b826 files · +43 −10Browse files

Showing the changes to kernel (3 of 6 files). Show all

Unified · Split

3 files
  1. kernel/cgroup.c +11 −5
  2. kernel/rcupdate.c +11 −0
  3. kernel/sched_debug.c +2 −0
kernel/cgroup.c+11−5
@@ -1646,7 +1646,9 @@ static inline struct cftype *__d_cft(struct dentry *dentry) · 1645 unmodified lines
1646int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen)1646int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen)
1647{1647{
1648 char *start;1648 char *start;
1649 struct dentry *dentry = rcu_dereference(cgrp->dentry);1649 struct dentry *dentry = rcu_dereference_check(cgrp->dentry,
1650 rcu_read_lock_held() ||
1651 cgroup_lock_is_held());
1650 1652
1651 if (!dentry || cgrp == dummytop) {1653 if (!dentry || cgrp == dummytop) {
1652 /*1654 /*
@@ -1662,13 +1664,17 @@ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen) · 9 unmodified lines
1662 *--start = '\0';1664 *--start = '\0';
1663 for (;;) {1665 for (;;) {
1664 int len = dentry->d_name.len;1666 int len = dentry->d_name.len;
1667
1665 if ((start -= len) < buf)1668 if ((start -= len) < buf)
1666 return -ENAMETOOLONG;1669 return -ENAMETOOLONG;
1667 memcpy(start, cgrp->dentry->d_name.name, len);1670 memcpy(start, dentry->d_name.name, len);
1668 cgrp = cgrp->parent;1671 cgrp = cgrp->parent;
1669 if (!cgrp)1672 if (!cgrp)
1670 break;1673 break;
1671 dentry = rcu_dereference(cgrp->dentry);1674
1675 dentry = rcu_dereference_check(cgrp->dentry,
1676 rcu_read_lock_held() ||
1677 cgroup_lock_is_held());
1672 if (!cgrp->parent)1678 if (!cgrp->parent)
1673 continue;1679 continue;
1674 if (--start < buf)1680 if (--start < buf)
@@ -4555,13 +4561,13 @@ static int alloc_css_id(struct cgroup_subsys *ss, struct cgroup *parent, · 2880 unmodified lines
4555{4561{
4556 int subsys_id, i, depth = 0;4562 int subsys_id, i, depth = 0;
4557 struct cgroup_subsys_state *parent_css, *child_css;4563 struct cgroup_subsys_state *parent_css, *child_css;
4558 struct css_id *child_id, *parent_id = NULL;4564 struct css_id *child_id, *parent_id;
4559 4565
4560 subsys_id = ss->subsys_id;4566 subsys_id = ss->subsys_id;
4561 parent_css = parent->subsys[subsys_id];4567 parent_css = parent->subsys[subsys_id];
4562 child_css = child->subsys[subsys_id];4568 child_css = child->subsys[subsys_id];
4563 depth = css_depth(parent_css) + 1;
4564 parent_id = parent_css->id;4569 parent_id = parent_css->id;
4570 depth = parent_id->depth;
4565 4571
4566 child_id = get_new_cssid(ss, depth);4572 child_id = get_new_cssid(ss, depth);
4567 if (IS_ERR(child_id))4573 if (IS_ERR(child_id))
kernel/rcupdate.c+11−0
@@ -122,3 +122,14 @@ void wakeme_after_rcu(struct rcu_head *head) · 121 unmodified lines
122 rcu = container_of(head, struct rcu_synchronize, head);122 rcu = container_of(head, struct rcu_synchronize, head);
123 complete(&rcu->completion);123 complete(&rcu->completion);
124}124}
125
126#ifdef CONFIG_PROVE_RCU
127/*
128 * wrapper function to avoid #include problems.
129 */
130int rcu_my_thread_group_empty(void)
131{
132 return thread_group_empty(current);
133}
134EXPORT_SYMBOL_GPL(rcu_my_thread_group_empty);
135#endif /* #ifdef CONFIG_PROVE_RCU */
kernel/sched_debug.c+2−0
@@ -114,7 +114,9 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p) · 113 unmodified lines
114 {114 {
115 char path[64];115 char path[64];
116 116
117 rcu_read_lock();
117 cgroup_path(task_group(p)->css.cgroup, path, sizeof(path));118 cgroup_path(task_group(p)->css.cgroup, path, sizeof(path));
119 rcu_read_unlock();
118 SEQ_printf(m, " %s", path);120 SEQ_printf(m, " %s", path);
119 }121 }
120#endif122#endif