[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140129120907.GA22183@dhcp22.suse.cz>
Date: Wed, 29 Jan 2014 13:09:07 +0100
From: Michal Hocko <mhocko@...e.cz>
To: Tejun Heo <tj@...nel.org>
Cc: lizefan@...wei.com, containers@...ts.linux-foundation.org,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Johannes Weiner <hannes@...xchg.org>,
Balbir Singh <bsingharora@...il.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Subject: Re: [PATCH 6/8] cgroup: remove cgroup->name
On Tue 28-01-14 18:59:43, Tejun Heo wrote:
> cgroup->name handling became quite complicated over time involving
> dedicated struct cgroup_name for RCU protection. Now that cgroup is
> on kernfs, we can drop all of it and simply use kernfs_name/path() and
> friends. Replace cgroup->name and all related code with kernfs
> name/path constructs.
>
> * Reimplement cgroup_name() and cgroup_path() as thin wrappers on top
> of kernfs counterparts, which involves semantic changes.
> pr_cont_cgroup_name() and pr_cont_cgroup_path() added.
>
> * cgroup->name handling dropped from cgroup_rename().
>
> * All users of cgroup_name/path() updated to the new semantics. Users
> which were formatting the string just to printk them are converted
> to use pr_cont_cgroup_name/path() instead, which simplifies things
> quite a bit. As cgroup_name() no longer requires RCU read lock
> around it, RCU lockings which were protecting only cgroup_name() are
> removed.
>
> Signed-off-by: Tejun Heo <tj@...nel.org>
> Cc: Li Zefan <lizefan@...wei.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Johannes Weiner <hannes@...xchg.org>
> Cc: Michal Hocko <mhocko@...e.cz>
> Cc: Balbir Singh <bsingharora@...il.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Nice. I hated the way how we retrieved the name previously.
Acked-by: Michal Hocko <mhocko@...e.cz>
Btw. after this change we should drop part of the comment above
oom_info_lock:
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 19d5d4274e22..d998baec5deb 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1684,8 +1684,7 @@ static void move_unlock_mem_cgroup(struct mem_cgroup *memcg,
void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
{
/*
- * protects memcg_name and makes sure that parallel ooms do not
- * interleave
+ * Makes sure that parallel ooms do not interleave
*/
static DEFINE_SPINLOCK(oom_info_lock);
struct cgroup *task_cgrp;
--
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists