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 56396346FA5 for ; Fri, 16 Jan 2026 11:04:33 +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=1768561475; cv=none; b=Tt2AKT3gQioSoHt++byWBgtHmyTEWo6BMYwizGIMovYHYiQJn/07kIWeNdBc7jTTlM/4A5bh2Txgiqzy19bxHZfp8c7OoLpiYdVCRUK8j4TWLHDf0xtnp04SymvxcDt+BqFaw9uhBUlI52gaLkZbx/tS5E6bTnu5s/0IsaStW5U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768561475; c=relaxed/simple; bh=4l0FmMZtL1nzRzFcB12kJUY9J/80RhFDcGGqxCkD/XU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XEGxwsxGBWJA7hHFbCyrtsy9/PqftNW5Mo5ss6TpAHHxhQAxE/xugmBJOKDatt/T1wpKWehtGeQraqLM58b4hNz8oR514g8fDpHlYCmRYg3zrXr6z4Qj0EFWUzLD6PbEQB1S9eFGRU+3Qb48TOH+wLmj98fRq9tEaVEgjTYsKA0= 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 F2EF21515; Fri, 16 Jan 2026 03:04:23 -0800 (PST) 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 CEF0E3F59E; Fri, 16 Jan 2026 03:04:25 -0800 (PST) Message-ID: <2ef49c6c-9de8-4aca-9e78-726b8665cdeb@arm.com> Date: Fri, 16 Jan 2026 11:04:24 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 31/47] arm_mpam: resctrl: Pre-allocate assignable monitors To: "Shaopeng Tan (Fujitsu)" Cc: "amitsinght@marvell.com" , "baisheng.gao@unisoc.com" , "baolin.wang@linux.alibaba.com" , "carl@os.amperecomputing.com" , "dave.martin@arm.com" , "david@kernel.org" , "dfustini@baylibre.com" , "fenghuay@nvidia.com" , "gshan@redhat.com" , "james.morse@arm.com" , "jonathan.cameron@huawei.com" , "kobak@nvidia.com" , "lcherian@marvell.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "peternewman@google.com" , "punit.agrawal@oss.qualcomm.com" , "quic_jiles@quicinc.com" , "reinette.chatre@intel.com" , "rohit.mathew@arm.com" , "scott@os.amperecomputing.com" , "sdonthineni@nvidia.com" , "xhao@linux.alibaba.com" , "catalin.marinas@arm.com" , "will@kernel.org" , "corbet@lwn.net" , "maz@kernel.org" , "oupton@kernel.org" , "joey.gouly@arm.com" , "suzuki.poulose@arm.com" , "kvmarm@lists.linux.dev" References: <20260112165914.4086692-1-ben.horgan@arm.com> <20260112165914.4086692-32-ben.horgan@arm.com> From: Ben Horgan Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Shaopeng, On 1/16/26 10:34, Shaopeng Tan (Fujitsu) wrote: > Hello Ben, > >> From: James Morse >> >> When there are not enough monitors, MPAM is able to emulate ABMC by making >> a smaller number of monitors assignable. These monitors still need to be >> allocated from the driver, and mapped to whichever control/monitor group >> resctrl wants to use them with. >> >> Add a second array to hold the monitor values indexed by resctrl's cntr_id. >> >> When CDP is in use, two monitors are needed so the available number of >> counters halves. Platforms with one monitor will have zero monitors when >> CDP is in use. >> >> Reviewed-by: Jonathan Cameron >> Signed-off-by: James Morse >> Signed-off-by: Ben Horgan [...] >> +bool resctrl_arch_mbm_cntr_assign_enabled(struct rdt_resource *r) >> +{ >> + if (r != &mpam_resctrl_controls[RDT_RESOURCE_L3].resctrl_res) >> + return false; >> + >> + return mpam_resctrl_abmc_enabled(); >> +} >> + >> +int resctrl_arch_mbm_cntr_assign_set(struct rdt_resource *r, bool enable) >> +{ >> + return -EINVAL; >> +} > > $ echo "default" | sudo tee /sys/fs/resctrl/info/L3_MON/mbm_assign_mode > default > tee: /sys/fs/resctrl/info/L3_MON/mbm_assign_mode:Invalid argument > "return -EOPNOTSUPP;" might be better. I'll keep this as -EINVAL in the case when 'enable' matches the current mode and change it to return 0 when there is nothing to change. This will match the behaviour once this is handled in resctrl. See the outcome of the discussion on this resctrl patch [1] Note, that I haven't yet updated the patch to match the discussion. Any objection? [1] https://lore.kernel.org/lkml/bf8bb682-6a4d-4f39-916c-952719fcf48d@arm.com/ Thanks, Ben