From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59CA4606AE36 for ; Fri, 13 Nov 2026 16:17:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=PfQ/EGxz; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=Kca1aMbS DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=wtyVpuXy15dO4I4euvTy72oPkpvM3hhV0zuEi7/nVcc=; b=PfQ/EGxz4lcDXW 1I0JvfTAZDB1zhXllFal6xVcU5HsSNv+KoES93SSozbFEydU7nIiwECYkZi9LeGCQy45ZzGrQPeKG 9wB5QenUHDIET5jJRYqVhoaBaIVs7raf3hZbsR6OqaRkmemNOLyAdANlnRkNCRCS8Hb3RyxtTsxrt +BUttayHIolTIp4KKD1zEXgc/sApZaWdL53NjQAqFkulPUhlEIz9mctVoUq7iKWP4cTuGzwOp7Il6 fq6px+8dUxPYjnRc0mUnHRPUR4Ha8XUDKl7JHK9x8IuBG4I6ekM+FWrVUCAb86bnj3VyyJ2biWTey hUHZJkUXilsDGXjxonSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xRtxT-0000000DWRZ-3f6X; Fri, 13 Nov 2026 16:16:59 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xRtxQ-0000000DWBQ-3oRe for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2026 16:16:58 +0000 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 59500143D; Fri, 13 Nov 2026 08:14:49 -0800 (PST) Received: from [10.2.212.8] (e134344.arm.com [10.2.212.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3B8933F673; Fri, 13 Nov 2026 08:14:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1794586492; bh=i6MBxrF0w4JXCguJJvppWTYUK6SI7lS9eOj24tuyIBU=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Kca1aMbSiP4ptaRyeru+VLQb0nS8xXxVVzqAZYvYOR0cT26gU1mSxylH7eMRaLIes sziSIN6XJ8JM52qwZoMPhgSSjMU/h14pAkGQEI80KvcCowz7SLkM/yMvY0xIpI5lV5 IdKpweGRgrX1yXXn+FmW48X0P0I5Vr2qvLQlmgY8= Message-ID: <10f43d19-2994-4ad2-8a49-2891582e32e7@arm.com> Date: Fri, 13 Nov 2026 16:14:48 +0000 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] fs/resctrl: Give a monitor domain the counters the groups already use To: tizi4590 , james.morse@arm.com, reinette.chatre@intel.com, fenghuay@nvidia.com, tony.luck@intel.com, Dave.Martin@arm.com, babu.moger@amd.com, will@kernel.org, jic23@kernel.org, gshan@redhat.com, bp@alien8.de, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20261113083506.4129060-1-ruanjinjie@huawei.com> <20261113083506.4129060-3-ruanjinjie@huawei.com> Content-Language: en-US From: Ben Horgan In-Reply-To: <20261113083506.4129060-3-ruanjinjie@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261113_081657_030421_1FAA3AB3 X-CRM114-Status: GOOD ( 23.28 ) X-Spam-Score: -4.4 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-12.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Hi Jinjie, On 13/11/2026 08:35, tizi4590 wrote: > From: Jinjie Ruan > > With assignable MBM counters, resctrl can be mounted while all CPUs of > a monitor domain go offline and one of them comes back, either through > CPU hotplug or because hibernation takes the non-boot CPUs offline. The > domain is destroyed and re-created, and the new domain starts with no > counters assigned. Counters are otherwise only assigned when a group is > created, when rdtgroup_assign_cntrs() takes a free counter in each > monitor domain for each MBM event, so no code revisits the groups that > already exist. > > Those groups read "Unassigned" on the new domain, on any system with > assignable MBM counters. A counter assigned to them later through > mbm_L3_assignments is the lowest free one in that domain, so the same > group can end up with a different counter ID on different domains. For > example, with the counter ID each group uses for mbm_total_bytes and > "_" for none: > > domain 0 domain 1 > mount, mkdir g1 default=0 g1=1 default=0 g1=1 > all CPUs of domain 1 offline default=0 g1=1 (destroyed) > one CPU of domain 1 online default=0 g1=1 default=_ g1=_ > assign g1 on domain 1 default=0 g1=1 default=_ g1=0 > > Each domain has its own counters, so g1 can use counter 0 on domain 1 > and counter 1 on domain 0 without affecting the other domain, but until > it is assigned on domain 1 it reads Unassigned there. I brought this up before and it was assessed that no change was required: https://lore.kernel.org/lkml/171f92a3-fa2e-44fb-b0d1-1250c72e31d1@amd.com/ Do you have any particular reason for wanting this behaviour? Thanks, Ben > > Assign the counters when the domain comes online, after its state is > set up. Give each enabled MBM event of every group, including the > monitor groups under mon_groups/, the counter ID the group uses in > another domain, and leave the event unassigned when that ID is already > taken on the new domain. Skip groups in pseudo-lock mode, as their RMID > has been freed and they are not monitored. > > A group that has no counter for an event in any domain stays unassigned > on the new domain, as it was before. mbm_assign_on_mkdir only applies > when a group is created, and counters that the user removed through > mbm_L3_assignments stay removed. > > Fixes: ef712fe97ec5 ("fs/resctrl: Auto assign counters on mkdir and clean up on group removal") > Signed-off-by: Jinjie Ruan > Cc: > Cc: Tony Luck > Cc: Reinette Chatre > Cc: Babu Moger > Cc: James Morse > Cc: Ben Horgan > Cc: Dave Martin > --- > Changes in v2: > - Drop the MPAM part of the changelog, the MPAM driver is fixed by > "arm_mpam: resctrl: Use the domain's counter ID". > - Link to v1: https://lore.kernel.org/all/20261106094537.2337188-1-ruanjinjie@huawei.com/