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 51FDC2DF138 for ; Tue, 17 Feb 2026 15:59:44 +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=1771343985; cv=none; b=j0Facl/0uLXpy4DKl7mPmOm+TzSvUUd1Y+8+/LzwLA0dsS0AzMqSC6XWat4KknJ658E/HG82krCmid73sI6walfiXEZCzB14IdZ/sw8I/AvhZs5yAD5ftxUxVBVCR6ReUmQA4HQWPEm027jCPqh+jrYzPucZG7e/Z+A/2Ztusu0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771343985; c=relaxed/simple; bh=/X5A7mf53NkDldCD2Zb2ZbG4dnErssH7ibHqEX+Q8f8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kiMpHUwwHxdliCjVrKd3m8UpcGT5QB3JgPrK3An0Tr7GlTM7ojei5qzFylSHFlPM6ycVFq0v3yDTsvSRPSSMpfcnC/JZIkJze4uDaK7NHJ7AXjH2PVF9FyIle6Vz28boBBPzo9EN4HI2Mx/LbFqG1TaNP1SHhszCb+n4WNhaa7g= 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 892941477; Tue, 17 Feb 2026 07:59:37 -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 86CE73F632; Tue, 17 Feb 2026 07:59:42 -0800 (PST) Message-ID: <16ac4ebe-123f-4e43-9930-bf3d6f17f31c@arm.com> Date: Tue, 17 Feb 2026 15:59:40 +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] arm_mpam: Fix MPAM reset on resctrl unmount by clearing in_reset_state To: Zeng Heng , catalin.marinas@arm.com, tan.shaopeng@jp.fujitsu.com, james.morse@arm.com, reinette.chatre@intel.com, fenghuay@nvidia.com, jonathan.cameron@huawei.com Cc: linux-kernel@vger.kernel.org References: <20260213075054.1574546-1-zengheng4@huawei.com> From: Ben Horgan Content-Language: en-US In-Reply-To: <20260213075054.1574546-1-zengheng4@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Zeng, On 2/13/26 07:50, Zeng Heng wrote: > When resctrl is unmounted, MPAM components should be reset to default > configurations to avoid impacting system performance. However, after > a user updates MPAM configuration via mpam_apply_config(), the > in_reset_state flag remains true, causing mpam_reset_ris() to skip > the actual register restoration on subsequent resets. > > For example, after mounting resctrl and modifying the root group's > schemata (e.g., changing MBMAX/MBMIN values), unmounting resctrl nit: MBMIN isn't currently supported in resctrl. I'd just drop the part in brackets. > would leave the modified MPAM settings in hardware registers since > mpam_reset_ris() returns early due to in_reset_state still being true. > This results in persistent performance restrictions even after resctrl > is umounted. > > Fix by clearing in_reset_state to false immediately after successful > configuration application, ensuring that the next reset operation > properly restores MPAM register defaults. > > Fixes: f188a36ca241 ("arm_mpam: Reset MSC controls from cpuhp callbacks") mpam_apply_config() doesn't exist in this commit. I would have expected: Fixes: 09b89d2a72f3 ("arm_mpam: Allow configuration to be applied and restored during cpu online") > Signed-off-by: Zeng Heng The change and justification looks good to me. Acked-by: Ben Horgan Thanks, Ben > --- > The in_reset_state state machine has been carefully reviewed, particularly > the handling in mpam_cpu_online() where the flag is checked before > applying configurations. in_reset_state indicates whether the RIS is > currently using default configurations. This change aligns with the > original design intent and does not introduce semantic breakage to > existing state transitions. > --- > drivers/resctrl/mpam_devices.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c > index 460ea98a1c92..044227ee033f 100644 > --- a/drivers/resctrl/mpam_devices.c > +++ b/drivers/resctrl/mpam_devices.c > @@ -2932,6 +2932,7 @@ int mpam_apply_config(struct mpam_component *comp, u16 partid, > srcu_read_lock_held(&mpam_srcu)) { > arg.ris = ris; > mpam_touch_msc(msc, __write_config, &arg); > + ris->in_reset_state = false; > } > mutex_unlock(&msc->cfg_lock); > } > -- > 2.25.1 >