From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42648C001DE for ; Fri, 28 Jul 2023 16:29:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231668AbjG1Q3s (ORCPT ); Fri, 28 Jul 2023 12:29:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjG1Q3q (ORCPT ); Fri, 28 Jul 2023 12:29:46 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1B7833AAC for ; Fri, 28 Jul 2023 09:29:45 -0700 (PDT) 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 8D4242F4; Fri, 28 Jul 2023 09:30:27 -0700 (PDT) Received: from [10.1.197.60] (eglon.cambridge.arm.com [10.1.197.60]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B480F3F67D; Fri, 28 Jul 2023 09:29:41 -0700 (PDT) Message-ID: <6513da1c-ae84-14a3-1e95-30704e1162a4@arm.com> Date: Fri, 28 Jul 2023 17:29:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v4 21/24] x86/resctrl: Allow overflow/limbo handlers to be scheduled on any-but cpu Content-Language: en-GB To: "Shaopeng Tan (Fujitsu)" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" Cc: Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , "shameerali.kolothum.thodi@huawei.com" , D Scott Phillips OS , "carl@os.amperecomputing.com" , "lcherian@marvell.com" , "bobo.shaobowang@huawei.com" , "xingxin.hx@openanolis.org" , "baolin.wang@linux.alibaba.com" , Jamie Iles , Xin Hao , "peternewman@google.com" , "dfustini@baylibre.com" References: <20230525180209.19497-1-james.morse@arm.com> <20230525180209.19497-22-james.morse@arm.com> From: James Morse In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shaopeng Tan, On 09/06/2023 12:10, Shaopeng Tan (Fujitsu) wrote: >> When a CPU is taken offline resctrl may need to move the overflow or limbo >> handlers to run on a different CPU. >> >> Once the offline callbacks have been split, cqm_setup_limbo_handler() will be >> called while the CPU that is going offline is still present in the cpu_mask. >> >> Pass the CPU to exclude to cqm_setup_limbo_handler() and >> mbm_setup_overflow_handler(). These functions can use a variant of >> cpumask_any_but() when selecting the CPU. -1 is used to indicate no CPUs >> need excluding. >> >> A subsequent patch moves these calls to be before CPUs have been removed, >> so this exclude_cpus behaviour is temporary. >> diff --git >> a/arch/x86/kernel/cpu/resctrl/monitor.c >> b/arch/x86/kernel/cpu/resctrl/monitor.c >> index ced933694f60..ae02185f3354 100644 >> --- a/arch/x86/kernel/cpu/resctrl/monitor.c >> +++ b/arch/x86/kernel/cpu/resctrl/monitor.c >> @@ -875,9 +895,15 @@ void mbm_setup_overflow_handler(struct rdt_domain >> *dom, unsigned long delay_ms) >> */ >> if (!resctrl_mounted || !resctrl_arch_mon_capable()) >> return; >> - cpu = cpumask_any_housekeeping(&dom->cpu_mask); >> + if (exclude_cpu == -1) >> + cpu = cpumask_any_housekeeping(&dom->cpu_mask); > > Should RESCTRL_PICK_ANY_CPU be used instead of -1? Yup, that would be more readable. I did this for cqm_setup_limbo_handler(), but for some reason missed this one. Thanks, James