The patch titled Subject: memcg: let css_get_next() rely upon rcu_read_lock() has been added to the -mm tree. Its filename is memcg-let-css_get_next-rely-upon-rcu_read_lock.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Hugh Dickins <hughd@xxxxxxxxxx> Subject: memcg: let css_get_next() rely upon rcu_read_lock() Remove lock and unlock around css_get_next()'s call to idr_get_next(). memcg iterators (only users of css_get_next) already did rcu_read_lock(), and its comment demands that; but add a WARN_ON_ONCE to make sure of it. Signed-off-by: Hugh Dickins <hughd@xxxxxxxxxx> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Acked-by: Li Zefan <lizf@xxxxxxxxxxxxxx> Cc: Eric Dumazet <eric.dumazet@xxxxxxxxx> Acked-by: Tejun Heo <tj@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/cgroup.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff -puN kernel/cgroup.c~memcg-let-css_get_next-rely-upon-rcu_read_lock kernel/cgroup.c --- a/kernel/cgroup.c~memcg-let-css_get_next-rely-upon-rcu_read_lock +++ a/kernel/cgroup.c @@ -5087,6 +5087,8 @@ css_get_next(struct cgroup_subsys *ss, i return NULL; BUG_ON(!ss->use_id); + WARN_ON_ONCE(!rcu_read_lock_held()); + /* fill start point for scan */ tmpid = id; while (1) { @@ -5094,10 +5096,7 @@ css_get_next(struct cgroup_subsys *ss, i * scan next entry from bitmap(tree), tmpid is updated after * idr_get_next(). */ - spin_lock(&ss->id_lock); tmp = idr_get_next(&ss->idr, &tmpid); - spin_unlock(&ss->id_lock); - if (!tmp) break; if (tmp->depth >= depth && tmp->stack[depth] == rootid) { _ Subject: Subject: memcg: let css_get_next() rely upon rcu_read_lock() Patches currently in -mm which might be from hughd@xxxxxxxxxx are proc-clear_refs-do-not-clear-reserved-pages.patch mm-memcg-update-the-correct-soft-limit-tree-during-migration.patch shm_unlock-fix-long-unpreemptible-section.patch shm_unlock-fix-unevictable-pages-stranded-after-swap.patch mm-fix-rss-count-leakage-during-migration.patch mm-add-rss-counters-consistency-check.patch mm-postpone-migrated-page-mapping-reset.patch memcg-replace-mem_cont-by-mem_res_ctlr.patch memcg-replace-mem-and-mem_cont-stragglers.patch memcg-lru_size-instead-of-mem_cgroup_zstat.patch memcg-enum-lru_list-lru.patch memcg-remove-redundant-returns.patch idr-make-idr_get_next-good-for-rcu_read_lock.patch cgroup-revert-ss_id_lock-to-spinlock.patch memcg-let-css_get_next-rely-upon-rcu_read_lock.patch prio_tree-debugging-patch.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html