From: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Ingo Molnar <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
Balbir Singh
<bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
KAMEZAWA Hiroyuki
<kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>,
Aristeu Rozanski <aris-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
"Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>,
"Rafael J. Wysocki" <rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org>,
Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Neil Horman <nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>,
Thomas Graf <tgraf-G/eBtMaohhA@public.gmane.org>,
"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Subject: Re: [PATCH 3/6] cgroup: clean up cgroup_subsys names and initialization
Date: Mon, 20 Jan 2014 14:13:37 +0100 [thread overview]
Message-ID: <20140120131337.GD2626@dhcp22.suse.cz> (raw)
In-Reply-To: <1389982317-22225-4-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
On Fri 17-01-14 13:11:54, Tejun Heo wrote:
> cgroup_subsys is a bit messier than it needs to be.
>
> * The name of a subsys can be different from its internal identifier
> defined in cgroup_subsys.h. Most subsystems use the matching name
> but three - cpu, memory and perf_event - use different ones.
>
> * cgroup_subsys_id enums are postfixed with _subsys_id and each
> cgroup_subsys is postfixed with _subsys. cgroup.h is widely
> included throughout various subsystems, it doesn't and shouldn't
> have claim on such generic names which don't have any qualifier
> indicating that they belong to cgroup.
>
> * cgroup_subsys->subsys_id should always equal the matching
> cgroup_subsys_id enum; however, we require each controller to
> initialize it and then BUG if they don't match, which is a bit
> silly.
>
> This patch cleans up cgroup_subsys names and initialization by doing
> the followings.
>
> * cgroup_subsys_id enums are now postfixed with _cgrp_id, and each
> cgroup_subsys with _cgrp_subsys.
>
> * With the above, renaming subsys identifiers to match the userland
> visible names doesn't cause any naming conflicts. All non-matching
> identifiers are renamed to match the official names.
>
> cpu_cgroup -> cpu
> mem_cgroup -> memory
> perf -> perf_event
>
> * controllers no longer need to initialize ->subsys_id and ->name.
> They're generated in cgroup core and set automatically during boot.
>
> * Redundant cgroup_subsys declarations removed.
>
> * While updating BUG_ON()s in cgroup_init_early(), convert them to
> WARN()s. BUGging that early during boot is stupid - the kernel
> can't print anything, even through serial console and the trap
> handler doesn't even link stack frame properly for back-tracing.
>
> This patch doesn't introduce any behavior changes.
>
> Signed-off-by: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Cc: Ingo Molnar <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Cc: Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
> Cc: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> Cc: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
> Cc: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>
> Cc: Balbir Singh <bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
> Cc: Aristeu Rozanski <aris-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Cc: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> Cc: "Rafael J. Wysocki" <rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org>
> Cc: Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Cc: Neil Horman <nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
> Cc: Thomas Graf <tgraf-G/eBtMaohhA@public.gmane.org>
> Cc: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
For memcg and hugetlb
Acked-by: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>
[...]
Thanks!
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2014-01-20 13:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-17 18:11 [PATCHSET cgroup/for-3.14] cgroup: drop module support and cgroup_root_mutex Tejun Heo
[not found] ` <1389982317-22225-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-01-17 18:11 ` [PATCH 1/6] cgroup: make CONFIG_NET_CLS_CGROUP and CONFIG_NETPRIO_CGROUP bool instead of tristate Tejun Heo
[not found] ` <1389982317-22225-2-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-01-17 20:37 ` Neil Horman
2014-01-18 1:08 ` Li Zefan
[not found] ` <52D9D421.6040608-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-01-18 11:25 ` Daniel Borkmann
2014-01-18 15:10 ` Tejun Heo
[not found] ` <20140118151006.GF3640-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2014-01-18 15:26 ` Daniel Borkmann
[not found] ` <52DA9D20.6010301-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-18 15:28 ` Tejun Heo
[not found] ` <20140118152813.GG3640-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2014-01-18 15:29 ` Daniel Borkmann
2014-01-18 3:10 ` David Miller
2014-01-17 18:11 ` [PATCH 2/6] cgroup: drop module support Tejun Heo
2014-01-17 18:11 ` [PATCH 3/6] cgroup: clean up cgroup_subsys names and initialization Tejun Heo
[not found] ` <1389982317-22225-4-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-01-17 20:49 ` Neil Horman
2014-01-18 3:10 ` David Miller
2014-01-20 13:13 ` Michal Hocko [this message]
2014-01-17 18:11 ` [PATCH 4/6] cgroup: rename cgroup_subsys->subsys_id to ->id Tejun Heo
2014-01-17 18:11 ` [PATCH 5/6] cgroup: update locking in cgroup_show_options() Tejun Heo
2014-01-17 18:11 ` [PATCH 6/6] cgroup: remove cgroup_root_mutex Tejun Heo
-- strict thread matches above, loose matches on Subject: below --
2014-01-28 23:43 [PATCHSET v2 cgroup/for-3.15] cgroup: drop module support and cgroup_root_mutex Tejun Heo
[not found] ` <1390952641-15950-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-01-28 23:43 ` [PATCH 3/6] cgroup: clean up cgroup_subsys names and initialization Tejun Heo
[not found] ` <1390952641-15950-4-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-01-29 0:04 ` Rafael J. Wysocki
2014-01-29 8:59 ` Michal Hocko
2014-01-29 10:46 ` Peter Zijlstra
[not found] ` <20140129104648.GC9636-ndre7Fmf5hadTX5a5knrm8zTDFooKrT+cvkQGrU6aU0@public.gmane.org>
2014-01-30 9:16 ` Ingo Molnar
2014-01-29 16:23 ` Aristeu Rozanski
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=20140120131337.GD2626@dhcp22.suse.cz \
--to=mhocko-alswssmvlrq@public.gmane.org \
--cc=aris-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org \
--cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org \
--cc=serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
--cc=tgraf-G/eBtMaohhA@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
/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;
as well as URLs for NNTP newsgroup(s).