From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 592073254A2 for ; Tue, 5 May 2026 09:34:39 +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=1777973681; cv=none; b=Jr5x6To+ed7iCNqMQ4Cc8g+rM6fkspxBqaeuav3/53FlBkbtcWBrdWQTAEaUFrGc2jtZaIuW3kPl1l2Jd48mWEcongXeK+z9ot3P/ejloFvEdzNjTFYNkmgWB3uNWio6AIb6Ue7Ix+bO3HVoelMCc0Sel92xZ3YGL0KYQo+wx8E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777973681; c=relaxed/simple; bh=Dox9d9xfGC5sqpiIgj4my4EOJiaCKf5rKt8/qeLrkQw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=k311n3LGOYfDtlB55bS6UNhmVt1OkgU1RptS+SUoLzUMx3HB2pE0M/51LG4sK9tS2T61lpU00eIrW945IJ1tHuVxKN06Q5S47sGSffDRIZmZ0SboOwJ3DiPQ0GqcOBYkW8uwsyz3qUBShM8/qmmp+cNa3SNKfYXsj26UHpItflw= 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; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=EH/76itl; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="EH/76itl" 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 EDD9B293B; Tue, 5 May 2026 02:34:32 -0700 (PDT) Received: from [10.1.196.46] (e134344.arm.com [10.1.196.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A813A3F836; Tue, 5 May 2026 02:34:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1777973678; bh=Dox9d9xfGC5sqpiIgj4my4EOJiaCKf5rKt8/qeLrkQw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=EH/76itlp2PPKBSHOyL4l53laqz1qIQq6M4JiSNlYpofq3oejYzJV5bMlvjQT/ne/ o60E8rZytKlFMXmZ0MYY/Zippj0KQ3mA6i7OEOwo+e+S6Y7HoAYUwCQHLn68Oq/FFq VqUGQLtJA8yKqOznYeQWrpBkf5+kOgmlGE/1TFr4= Message-ID: Date: Tue, 5 May 2026 10:34:35 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Thunderbird Daily Subject: Re: [PATCH v5 3/7] fs/resctrl: Disallow the software controller when MBM counters are assignable To: Reinette Chatre , linux-kernel@vger.kernel.org Cc: tony.luck@intel.com, Dave.Martin@arm.com, james.morse@arm.com, babu.moger@amd.com, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, fenghuay@nvidia.com, tan.shaopeng@fujitsu.com References: <20260428130422.2287302-1-ben.horgan@arm.com> <20260428130422.2287302-4-ben.horgan@arm.com> Content-Language: en-US From: Ben Horgan In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Reinette, On 5/4/26 17:01, Reinette Chatre wrote: > Hi Ben, > > On 4/28/26 6:04 AM, Ben Horgan wrote: > >> diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c >> index b382a348dd79..be84bb210e3a 100644 >> --- a/fs/resctrl/rdtgroup.c >> +++ b/fs/resctrl/rdtgroup.c >> @@ -2530,7 +2530,8 @@ static bool supports_mba_mbps(void) >> >> return (resctrl_is_mbm_enabled() && >> r->alloc_capable && is_mba_linear() && >> - r->ctrl_scope == rmbm->mon_scope); >> + r->ctrl_scope == rmbm->mon_scope && >> + !rmbm->mon.mbm_cntr_assignable); >> } > > For better or worse supports_mba_mbps() has a function description that documents > the above tests. Updating the tests but not the accompanying description creates > an inconsistency. How about something like below? > > diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c > index 36d21652616e..b456a67b2c24 100644 > --- a/fs/resctrl/rdtgroup.c > +++ b/fs/resctrl/rdtgroup.c > @@ -2536,10 +2536,12 @@ static void mba_sc_domain_destroy(struct rdt_resource *r, > } > > /* > - * MBA software controller is supported only if > - * MBM is supported and MBA is in linear scale, > - * and the MBM monitor scope is the same as MBA > - * control scope. > + * MBA software controller is supported only if MBM is supported and MBA is in > + * linear scale, and the MBM monitor scope is the same as MBA control scope. > + * > + * Software controller cannot be supported when the MBM counters are assignable. > + * There is no guarantee that MBM counters are assigned to the event backing > + * the software controller in all monitoring domains of all monitoring groups. Yes, that makes sense to me. I'll use that. Thanks, Ben > */ > static bool supports_mba_mbps(void) > { > >> >> /* >> @@ -2945,7 +2946,7 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param) >> ctx->enable_cdpl2 = true; >> return 0; >> case Opt_mba_mbps: >> - msg = "mba_MBps requires MBM and linear scale MBA at L3 scope"; >> + msg = "mba_MBps requires MBM (mbm_event mode not supported) and linear scale MBA at L3 scope"; >> if (!supports_mba_mbps()) >> return invalfc(fc, msg); >> ctx->enable_mba_mbps = true; > > Reinette