Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1835483lqm; Fri, 3 May 2024 07:53:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVWCK9f9aB5jGMhVghSpwNVUbxhgy9iMeMRVOFkqNY7Fgrd9dAZGr3pEm7RBLPIM++PWRk6k2UYjkPU7zkHeCxSu3DlvAEMOJjh6XCZfA== X-Google-Smtp-Source: AGHT+IFnDcVeaL7laoMkCBF4xjl44Fau3egLhwgGB2kbR7GcL/8oNubE9/JRJFvOsdidgmZUqNuX X-Received: by 2002:a05:6358:7f9b:b0:186:1128:bca7 with SMTP id c27-20020a0563587f9b00b001861128bca7mr3092672rwo.6.1714748028811; Fri, 03 May 2024 07:53:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714748028; cv=pass; d=google.com; s=arc-20160816; b=gSkMs6PCmh79+sxdcyJuzJsoxbCnR3b5/K4eU4YzT5inb1zNwXd12z4SWqcPCt3oAV xzBHJSCLczRMFgF0DldhoaiRxrpAs8aGpdFYFobuJJ5FMjY6AS5urX+BbKDrzV31qF8K Ku1P1DriDaO+Ga19IF7hoH0Htnr7mAdNv3HjQc9Fv0iONV8QI3kr9q93FQ/uVi++4lD3 piCGuVmMenI2CfQyWJGA70JOzJPl+lIuxpr4IbBgN27deD6VLkRMvv65xvZIYM4selqt h09DAzfl6S5/raODfsnY8wuE7FZEJJzCKxqbLCIkbeugJ72aZGqenKnuVZ46Ekz8czvN X89Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=tOsg3AEEsMo8avwHR+r2wuGnnrCcz1VIEbK8Uh1MylE=; fh=bwCiT589OeWiNMv+s2sebmQzJPAVbmNhUF0jRn0sakA=; b=Ojt2LeOliiWnxmac123RBr6qR4RWQBh2Gf/iHS9vdn3AKoEQwDtcG8W1Fj44h6xQ5b Ocfy+F+RTZAOBowpV9rATEM/12J34Q4XXOtw1f8zZN+ly4/b5BYw2/qGQgfz3o+1si8K o6Y6o3kazcBCu1cg1lK8rly5NzJjfQoC+3fiSWGMOzSrGPqCED0eSxClyLTeO9bJ54Gg 7vCouFB9BQ9YVm7fZR617aa8icdMGG271oSfYfpk4oIFsztUiGZFmHxS6z7d9BYvzxBQ doZ/cpU9WAxDoZwHmC5BqoUNbmFsIwEMNUHBVcGVJ9YAOjowAUSd5zr1IzgahSTlr9BL xRow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-167796-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167796-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r8-20020a63d908000000b0061489e643a2si3066080pgg.525.2024.05.03.07.53.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 07:53:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167796-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-167796-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167796-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EE550283BF1 for ; Fri, 3 May 2024 14:53:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2477E481D1; Fri, 3 May 2024 14:53:45 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E514A6FC7; Fri, 3 May 2024 14:53:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714748024; cv=none; b=cpkxeCoKLKcOMR0Q3B0bwKFfybVdvIPixNKXmtBe0mPzk3fxp+U2OTSYihKr3DYtn1qc849/cUQowJt2t/S616FX9j57yngh9MBn7W7Eh6+eQ035XSYsySGE/h9t7ZsL4NUE8MBzSdPOM66e6IuXN/JH01Od5ovheTiRPBe/B60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714748024; c=relaxed/simple; bh=cHdEgixh0acGhZvMQ36hprLY16zcikyllyzLBwk7dXQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SwiTe80mZeWz3gdCtIXl1A5NWz2PoB7wIZnNIyrnihC6RTxu19U2wEEJNqFbC07kaK3tGks/vlpNxHJ4XQBiJe1Z0XO0Di1Agf8QfWG/J2LISOUmJvHMIrPmLKnZmu7JtfhiGRns1lbFBo+I+HzH/on0X9WiMg7EbUeR9FhAaBA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6AA9F13D5; Fri, 3 May 2024 07:54:07 -0700 (PDT) Received: from e133380.arm.com (e133380.arm.com [10.1.197.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 069923F73F; Fri, 3 May 2024 07:53:37 -0700 (PDT) Date: Fri, 3 May 2024 15:53:35 +0100 From: Dave Martin To: Reinette Chatre Cc: Babu Moger , corbet@lwn.net, fenghua.yu@intel.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, paulmck@kernel.org, rdunlap@infradead.org, tj@kernel.org, peterz@infradead.org, yanjiewtw@gmail.com, kim.phillips@amd.com, lukas.bulwahn@gmail.com, seanjc@google.com, jmattson@google.com, leitao@debian.org, jpoimboe@kernel.org, rick.p.edgecombe@intel.com, kirill.shutemov@linux.intel.com, jithu.joseph@intel.com, kai.huang@intel.com, kan.liang@linux.intel.com, daniel.sneddon@linux.intel.com, pbonzini@redhat.com, sandipan.das@amd.com, ilpo.jarvinen@linux.intel.com, peternewman@google.com, maciej.wieczor-retman@intel.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, eranian@google.com, james.morse@arm.com Subject: Re: [RFC PATCH v3 17/17] x86/resctrl: Introduce interface to modify assignment states of the groups Message-ID: References: <4875492c-13cd-4a77-a42f-243fe0f868a2@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4875492c-13cd-4a77-a42f-243fe0f868a2@intel.com> On Thu, May 02, 2024 at 10:52:15AM -0700, Reinette Chatre wrote: > Hi Dave, > > On 5/2/2024 9:21 AM, Dave Martin wrote: > > On Thu, Mar 28, 2024 at 08:06:50PM -0500, Babu Moger wrote: > >> diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst > >> index 2d96565501ab..64ec70637c66 100644 > >> --- a/Documentation/arch/x86/resctrl.rst > >> +++ b/Documentation/arch/x86/resctrl.rst > >> @@ -328,6 +328,77 @@ with the following files: > >> None of events are assigned on this mon group. This is a child > >> monitor group of the non default control mon group. > >> > >> + Assignment state can be updated by writing to this interface. > >> + > >> + NOTE: Assignment on one domain applied on all the domains. User can > >> + pass one valid domain and assignment will be updated on all the > >> + available domains. > >> + > >> + Format is similar to the list format with addition of op-code for the > >> + assignment operation. > >> + > >> + * Default CTRL_MON group: > >> + "//" > >> + > >> + * Non-default CTRL_MON group: > >> + "//" > >> + > >> + * Child MON group of default CTRL_MON group: > >> + "//" > >> + > >> + * Child MON group of non-default CTRL_MON group: > >> + "//" > > > > The final bullet seems to cover everything, if we allow > > and to be independently empty strings to indicate the > > default control and/or monitoring group respectively. > > > > Would that be simpler than treating this as four separate cases? > > > > Also, will this go wrong if someone creates a resctrl group with '\n' > > (i.e., a newline character) in the name? > > There is a check for this in rdtgroup_mkdir(). Ah, right. Found it. I guess that works. On a (sort of) related point, are there any concerns about namespace clashes in resctrlfs? This looks like a potential issue for the resctrl top-level directory at least. It's not clear to me how userspace can pick a name for a resctrl group that is guaranteed not to clash with the name of one of resctrl's own files in a future kernel. (Note, this is nothing to do with series; I haven't been sure where to fit this into the dicsussion...) > > > > >> + > >> + Op-code can be one of the following: > >> + :: > >> + > >> + = Update the assignment to match the flags > >> + + Assign a new state > >> + - Unassign a new state > >> + _ Unassign all the states > > > > I can't remember whether I already asked this, but is "_" really > > needed here? > > Asked twice: > https://lore.kernel.org/lkml/ZiaRXrmDDjc194JI@e133380.arm.com/ > https://lore.kernel.org/lkml/ZiervIprcwoApAqw@e133380.arm.com/ > > Answered: > https://lore.kernel.org/lkml/4cd220cc-2e8e-4193-b01a-d3cd798c7118@amd.com/ > > You seemed ok with answer then: > https://lore.kernel.org/lkml/ZiffF93HM8bE3qo7@e133380.arm.com/ There, I was asking about "_" meaning "no flags" in "=_". > > > > > Wouldn't it be the case that > > > > //*_ > > > > would mean just the same thing as > > > > //*=_ > > > > ...? (assuming the "*" = "all domains" convention already discussed) > > > > Maybe I'm missing something here. > > I believe have an explicit operator ("+", "=", or "-") simplifies > parsing while providing an interface consistent with what users are already > used to. > > Reinette That was the point I was trying to make here, apologies if I wasn't clear. Cheers ---Dave