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 D6A85146A66 for ; Fri, 27 Mar 2026 09:54:17 +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=1774605259; cv=none; b=jli03Yy+6Q1e4t0T9ZpshiJqOfNEFWbYYgG+muTvkzYQoSRTVG9GyFTThs/ZIFkQFF+HzJ56eS5OqKY2rgmn5/KRpu7bbVPouSRjE3w5oBbXh4PyJ89+D1/4qCZKbNzpHzM54QihumbAPLvWjhxb0VwBpSR/JTon7zBdFb5aU0g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774605259; c=relaxed/simple; bh=5KkNXKFXPbf31+6X3nGXCwHQTOliXxDHJhxWm0sK3EE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=sPthFABDkGyrjSqx3e1ekFzcZuFznlz8yW/QWtM+NpA4fAcQXtw04ivhEOwTyi85yv929JqK1FVCSJsEemVhV8j8R9QXb5d8O1IAG9G8qZ5/G4Sb9GPR+yRkGucvZtvhhdK61RlwoOFU+nb6auRUlQyGR2rDoQmpwjRc0HhfgOE= 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=WOdpxI4N; 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="WOdpxI4N" 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 50FD835A1; Fri, 27 Mar 2026 02:54:11 -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 F09043F915; Fri, 27 Mar 2026 02:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1774605257; bh=5KkNXKFXPbf31+6X3nGXCwHQTOliXxDHJhxWm0sK3EE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=WOdpxI4NX3BG+hpX/5RtLozDV1bRMVxWnBxcLH1IQElOZvQMO+mDePmKVd6n1Fv7D 5in7PsDiEjcZ5uvFnStVOJHZsud2i9al5Hi0W8xkj6g+9QXEiNENMRmQ7U4rsOj8V7 WNK9pTC5PAEJycxNyAAHDQcXCcnFR1wXkftInKhw= Message-ID: <96b5d9fb-6e94-405d-a395-d7e441387959@arm.com> Date: Fri, 27 Mar 2026 09:54:12 +0000 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: [RFC PATCH v2 2/5] 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" , "zengheng4@huawei.com" References: <20260319165540.381410-1-ben.horgan@arm.com> <20260319165540.381410-3-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 Shaopeng, On 3/27/26 03:00, Shaopeng Tan (Fujitsu) wrote: > Hello Ben, > >> MPAM is able to emulate ABMC, i.e. mbm_event mode, by making memory >> bandwidth monitors assignable. Rather than supporting the 'default' >> mbm_assign_mode always use 'mbm_event'mode even if there are sufficient >> memory bandwidth monitors. The per monitor event configuration is only >> provided by resctrl when in 'mbm_event' mode and so only allowing >> 'mbm_event' mode will make it easier to support per-monitor event >> configuration for MPAM. For the moment, the only event supported is >> mbm_total_event with no bandwidth type configuration. The 'mbm_assign_mode' >> file will still show 'default' when there is no support for memory >> bandwidth monitoring. >> >> The monitors 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. >> >> Co-developed-by: James Morse >> Signed-off-by: James Morse >> Signed-off-by: Ben Horgan >> >> +/* >> + * This must run after all event counters have been picked so that any free >> + * running counters have already been allocated. >> + */ >> +static int mpam_resctrl_monitor_init_abmc(struct mpam_resctrl_mon *mon) >> +{ >> + struct mpam_resctrl_res *res = &mpam_resctrl_controls[RDT_RESOURCE_L3]; >> + struct rdt_resource *l3 = &res->resctrl_res; >> + struct mpam_class *class = mon->class; >> + u16 num_mbwu_mon; >> + size_t num_rmid = resctrl_arch_system_num_rmid_idx(); >> + >> + if (mon->mbwu_idx_to_mon) { >> + pr_debug("monitors free running\n"); >> + return 0; >> + } > > ABMC is not supported under this condition. > Why does this condition conclude that there are enough monitors(monitors freee running)? This is just a mistake. I missed removing this condition when support for using mbwu in "free running"/non-AMBC mode was removed. Thanks, Ben > > Best regards, > Shaopeng TAN >