Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp161664pxb; Thu, 14 Jan 2021 23:04:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIq2hx/I1jHuymnigRrVJqdq4XBHA/cd4C+8BDehdFTmSJKBFNb+MrRJyuR0oAyLUjmKjw X-Received: by 2002:aa7:c78c:: with SMTP id n12mr8570240eds.363.1610694298664; Thu, 14 Jan 2021 23:04:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610694298; cv=none; d=google.com; s=arc-20160816; b=HOFVKehRlgxoVzFxSx77cBv2HWegcXxKyHV26TC0LQvM+7B1i/XmrBLLd83iE8yuDT 5fi1p2DIxrNJ5GZjcpkFOUneIJSDHzk1n8D5uDUuD+IrP2Nu2VJdkNJ3lrJDBnVCEt8C f0fCpFvBGbsq2pX8IX5b3GPki71aUstx/KoksZTeZ/txsB3QXPQmei6lDkn1dTv16FBC j80DWLCf9SOe9TF8BNk/Kw3e9cwFAbAF7g3ZflLBWF4co/souAZw4/X0r4KKJu9h/7lv TxR7hjil5/s4GjQnM0smFrJ5oiD7sqOjle/STP42ukX4JVBSONoedjjd3gJb4ltBY6Kw m0jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=0QhEEwe/oeI4WIsDycGe+iTHJQpWQp6qaMUY67XzU7A=; b=tnti2i8IWxEnmNx8zLdN0Ps9QN9lbkdQe6jmNvqF+kdGvPhF+mPPR+1KOw7wTyIsAh 13xqo1XcO6ZHpvnKxHURdy6eY3LZnARTCgWdOxiNHtXxooA0zSlf2GoUGqRjRwa6qLrk OE9GcJZ0lMKxYAs4TbCUClJGq9xYTeELyV+q0idlPCZfo6FG66pUd8vDOwBVjExq/RTI fP14bZ4asmlt3ZAwIt0tj8GKwZSG5xmCsAQVqaO1oCiHvov9X36Ym/QBUGQG0Csu4SgH 5cSRJA42hWxPyFiQny/DHdo78TT5BsDe2SYdsalprEz2jmWnuqOfDq25yLsnJ8eFYaU2 ystA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c25si2241763edx.588.2021.01.14.23.04.33; Thu, 14 Jan 2021 23:04:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727205AbhAOB4a (ORCPT + 99 others); Thu, 14 Jan 2021 20:56:30 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:10723 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbhAOB43 (ORCPT ); Thu, 14 Jan 2021 20:56:29 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DH4444R7pzl5Kw; Fri, 15 Jan 2021 09:54:28 +0800 (CST) Received: from [10.174.176.61] (10.174.176.61) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Fri, 15 Jan 2021 09:55:44 +0800 Subject: Re: [PATCH v2] cgroup-v1: add disabled controller check in cgroup1_parse_param() To: =?UTF-8?Q?Michal_Koutn=c3=bd?= References: <20201218061755.121205-1-chenzhou10@huawei.com> CC: , , , , From: chenzhou Message-ID: <7804658e-7644-8edb-5ca8-0c97389c8c62@huawei.com> Date: Fri, 15 Jan 2021 09:55:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.176.61] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/1/15 0:54, Michal Koutn? wrote: > On Thu, Jan 14, 2021 at 10:08:19PM +0800, chenzhou wrote: >> In this case, at the beginning of function check_cgroupfs_options(), the mask >> ctx->subsys_mask will be 0. And if we mount without 'none' and 'name=' options, >> then in check_cgroupfs_options(), the flag ctx->all_ss will be set, that is, select all the subsystems. > But even then, the line > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/cgroup/cgroup-v1.c?h=v5.11-rc3#n1012 > would select only 'enabled' controllers, wouldn't it? Yeah, this will select all enabled controllers, but which doesn't the behavior we want. I think the case should return error with information "Disabled controller xx" rather than attaching all the other enabled controllers. For example, boot with cgroup_no_v1=cpu, and then mount with "mount -t cgroup -o cpu cpu /sys/fs/cgroup/cpu", then all enabled controllers will be attached expect cpu. > > It's possible I missed something but if this means that cgroup_no_v1= > doesn't hold to its expectations, I'd suggest adding proper Fixes: tag > to the patch. See above. Just the mount behavior isn't what we what. The behavior was changed since commit f5dfb5315d34 ("cgroup: take options parsing into ->parse_monolithic()"), will add this as Fixes. Thanks, Chen Zhou > > Thanks, > Michal