From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Subject: Re: [PATCH 3/6] cgroup: clean up cgroup_subsys names and initialization Date: Mon, 20 Jan 2014 14:13:37 +0100 Message-ID: <20140120131337.GD2626@dhcp22.suse.cz> References: <1389982317-22225-1-git-send-email-tj@kernel.org> <1389982317-22225-4-git-send-email-tj@kernel.org> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <1389982317-22225-4-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Tejun Heo 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 , Peter Zijlstra , Johannes Weiner , Balbir Singh , KAMEZAWA Hiroyuki , Aristeu Rozanski , "Serge E. Hallyn" , "Rafael J. Wysocki" , Vivek Goyal , Neil Horman , Thomas Graf , "David S. Miller" 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 > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc: Li Zefan > Cc: Johannes Weiner > Cc: Michal Hocko > Cc: Balbir Singh > Cc: KAMEZAWA Hiroyuki > Cc: Aristeu Rozanski > Cc: Serge E. Hallyn > Cc: "Rafael J. Wysocki" > Cc: Vivek Goyal > Cc: Neil Horman > Cc: Thomas Graf > Cc: "David S. Miller" For memcg and hugetlb Acked-by: Michal Hocko [...] Thanks! -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753856AbaATNNn (ORCPT ); Mon, 20 Jan 2014 08:13:43 -0500 Received: from cantor2.suse.de ([195.135.220.15]:44315 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750758AbaATNNk (ORCPT ); Mon, 20 Jan 2014 08:13:40 -0500 Date: Mon, 20 Jan 2014 14:13:37 +0100 From: Michal Hocko To: Tejun Heo Cc: lizefan@huawei.com, containers@lists.linux-foundation.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Johannes Weiner , Balbir Singh , KAMEZAWA Hiroyuki , Aristeu Rozanski , "Serge E. Hallyn" , "Rafael J. Wysocki" , Vivek Goyal , Neil Horman , Thomas Graf , "David S. Miller" Subject: Re: [PATCH 3/6] cgroup: clean up cgroup_subsys names and initialization Message-ID: <20140120131337.GD2626@dhcp22.suse.cz> References: <1389982317-22225-1-git-send-email-tj@kernel.org> <1389982317-22225-4-git-send-email-tj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1389982317-22225-4-git-send-email-tj@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc: Li Zefan > Cc: Johannes Weiner > Cc: Michal Hocko > Cc: Balbir Singh > Cc: KAMEZAWA Hiroyuki > Cc: Aristeu Rozanski > Cc: Serge E. Hallyn > Cc: "Rafael J. Wysocki" > Cc: Vivek Goyal > Cc: Neil Horman > Cc: Thomas Graf > Cc: "David S. Miller" For memcg and hugetlb Acked-by: Michal Hocko [...] Thanks! -- Michal Hocko SUSE Labs