Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1500609rwb; Fri, 28 Jul 2023 10:13:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlEdpJ4tSvOK2KLBs4vBq+QqVgjBTghbIkUy4mvHrTfsLBg4FbjUMVHi5K1+0bNIrAfKqfCY X-Received: by 2002:a05:6a00:1990:b0:686:5a11:a434 with SMTP id d16-20020a056a00199000b006865a11a434mr3125327pfl.3.1690564417003; Fri, 28 Jul 2023 10:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690564416; cv=none; d=google.com; s=arc-20160816; b=QNigeXHYbd/TApqopkfs2xUZ4wc+5mbCPpP7J+nBQSEqXPWrYODVhyuikMRfpXbiiP j1Uf+OacODNCb8EL2nDBg2uE2iqoZ8XlhfjEqmYA0KapYrGuJuOaI/tBYZiL6tG3hzTe VRRLSHSPVY3jnVXvIQSeQ+z+aTPdfQxw3YKaB/JyN8O9mZbHezNO5iETVj3coZoB4yh0 1NNyGoQqtR9zS0Oz7ADDeCPWVcxLWRhaNMpRvI2ZNU/HNEiEJ3b1ajmyh5u5Twl+tL/b gWjDSDh13OIQ3lEubbQIm/75BWWl9wfjnTemxtXo+nBi6T0MmjhgM6sfomY5An6CBZoG /6+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=kOXLma24uH81p8W8mbzhG4PkqJVjo4ccoUyOWTvkYQU=; fh=p8J5/iwFwopkJ0Tehqk9lE2O9HMKAB585TUy8qg9JXY=; b=OWgyH3PIQ6QMYuEAsdnBQFwDlVuy6YkDw2lKk6CFXNlHA7FxGmVgAaVDTQ8thEobEW YoiXYrzY1Ug4UOvh8scVxKgMhmGfoncZM6wwvWOiEfnn4SmrSBpavfhb61iBW3uc1cUm vxtcUHRWFzq0RwLl+CbqmRIEUGAp17UG9QN4z4rQ9v7t5euH3J+VidHzjetYco2YofQc T4ZzmN1s3vvhm2HbzTnfu/GK97cK80cTv2WW+YItyWprxLu5hGUUHAMrYD4Z8jNJT1xe KRYlSGhwd5DDElyW+rimFDT5swHQKCEGszX+uzvIhkpISRxVZTwwqCG5yCLVvGG08cDq 04Kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb17-20020a056a004c9100b00675807330d0si1491995pfb.351.2023.07.28.10.13.24; Fri, 28 Jul 2023 10:13:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231482AbjG1Q3r (ORCPT + 99 others); Fri, 28 Jul 2023 12:29:47 -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 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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