From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751620AbdGRTvy (ORCPT ); Tue, 18 Jul 2017 15:51:54 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:36745 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751402AbdGRTvw (ORCPT ); Tue, 18 Jul 2017 15:51:52 -0400 Date: Tue, 18 Jul 2017 15:51:48 -0400 From: Tejun Heo To: Waiman Long Cc: Li Zefan , Johannes Weiner , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cgroup: Show control files in cgroup2 root after mount Message-ID: <20170718195148.GC3365493@devbig577.frc2.facebook.com> References: <1500406336-29512-1-git-send-email-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1500406336-29512-1-git-send-email-longman@redhat.com> 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 Hello, Waiman. On Tue, Jul 18, 2017 at 03:32:16PM -0400, Waiman Long wrote: > It was found that when a cgroup2 filesystem was mounted, control > files other than the base cgroup.* ones were not shown in the root > directory. They were shown only after some controllers were activated > in the root's cgroup.subtree_control file. > > This was caused by a lack of the kernfs_activate() call which was fixed > by this patch. > > Signed-off-by: Waiman Long > --- > kernel/cgroup/cgroup.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c > index 89a23c6..fb1893b 100644 > --- a/kernel/cgroup/cgroup.c > +++ b/kernel/cgroup/cgroup.c > @@ -2024,8 +2024,10 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type, > > dentry = cgroup_do_mount(&cgroup2_fs_type, flags, &cgrp_dfl_root, > CGROUP2_SUPER_MAGIC, ns); > - if (!IS_ERR(dentry)) > + if (!IS_ERR(dentry)) { > apply_cgroup_root_flags(root_flags); > + kernfs_activate(cgrp_dfl_root.cgrp.kn); > + } Heh, that's tricky. I'm not quite sure where the unactivated files are being added tho because that'd be where we should be activating. I *think* that they are already activated as part of cgroup_add_cftypes() but I am obviously qmissing something. I'll try to repro the issue and find where we're skipping the activation call. Thanks! -- tejun