Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp455845rdb; Thu, 5 Oct 2023 10:37:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwzaQm5MYwA+zJJdlZLNbLdNkPt0aP1v9zfUgDmdOJZPnMYC7rIAAf51sVLuXfajaIXVP5 X-Received: by 2002:a17:902:e749:b0:1c5:e00f:2 with SMTP id p9-20020a170902e74900b001c5e00f0002mr7125491plf.28.1696527428755; Thu, 05 Oct 2023 10:37:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696527428; cv=none; d=google.com; s=arc-20160816; b=e8MGBAgLtM3czga7mTx+MAB/FujgnRPXOiBnaTYubL+CO+dEtqKnZkFa2VClv9qtDw sNQ9beeniHcdWvjxLx7rRGy7Z4+z9XBBSMOCvC5wcDGijslm1HE5wbhB5gFrrGfQMWGn +BCybB5fN8LlvhY/+FT/A1/VaRtyYJg4N+QIXkgf54n4TJpP46cb5G+ZOfd7ae+0Sakr iCngYCLt+2MeG5maw1btn7w/dYnUk8GHarcw79HfGNxkqQcZq8wZCrXRAONr3Z60vIFB +zXg28ezY1aJm58H5VKvRqvKRuqHM2R7YP9IMKFk40AXfco5uISjb0+NadD9CUMz89le TSVg== 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=dox6xTmIB/bOxzsVTLfHyY2vwRH8dbxDszoi/HucPcA=; fh=V3EXrfhtPXQ8VZs+995Yo8T+zOpBnshrD4ANVkhZrjM=; b=P3tnNbdpX3Xy3I33wVeEJZCCve9pS8iQgzK05CIk9usEmrliwGEKoB6nzSicOdp38W pypND8KCrO3N7ULpwOCSJ3xDWWTTca9tznEwBkT/r0ebMTM5IDcRFElFfZJkj6Y3Ygul x/DxbrFx5gF8FflUzxe+z8pR9Op6FM625ZIroL2AG0nsAajhKA6sdM5fIeVLXWZSO2F9 GQyzLDrIQuleJbOlvwF0kXAe0OGI+2W0erfSoKhhh/L6tWrR+CNAXPMpIZe2tWrZPDPU dhojuWd1OCDhoFE11S7fV2YauLK0V/RBCjnKCpd5QojDsbGdixDoFtHegi0Tl9B68BfK dDJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id s17-20020a170902ea1100b001bc028375aasi1962897plg.538.2023.10.05.10.37.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 10:37:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 869B680D7F77; Thu, 5 Oct 2023 10:16:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231454AbjJERQK (ORCPT + 99 others); Thu, 5 Oct 2023 13:16:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231599AbjJERPH (ORCPT ); Thu, 5 Oct 2023 13:15:07 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 475FA3AB4 for ; Thu, 5 Oct 2023 10:07:24 -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 BEEFBC15; Thu, 5 Oct 2023 10:08:02 -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 01E193F5A1; Thu, 5 Oct 2023 10:07:20 -0700 (PDT) Message-ID: <331b165a-f650-37fd-7990-2704c668f6f2@arm.com> Date: Thu, 5 Oct 2023 18:07:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v6 12/24] x86/resctrl: Add cpumask_any_housekeeping() for limbo/overflow Content-Language: en-GB To: Reinette Chatre , x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , 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, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com References: <20230914172138.11977-1-james.morse@arm.com> <20230914172138.11977-13-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.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 05 Oct 2023 10:16:49 -0700 (PDT) Hi Reinette, On 03/10/2023 22:15, Reinette Chatre wrote: > On 9/14/2023 10:21 AM, James Morse wrote: >> The limbo and overflow code picks a CPU to use from the domain's list >> of online CPUs. Work is then scheduled on these CPUs to maintain >> the limbo list and any counters that may overflow. >> >> cpumask_any() may pick a CPU that is marked nohz_full, which will >> either penalise the work that CPU was dedicated to, or delay the >> processing of limbo list or counters that may overflow. Perhaps >> indefinitely. Delaying the overflow handling will skew the bandwidth >> values calculated by mba_sc, which expects to be called once a second. >> >> Add cpumask_any_housekeeping() as a replacement for cpumask_any() >> that prefers housekeeping CPUs. This helper will still return >> a nohz_full CPU if that is the only option. The CPU to use is >> re-evaluated each time the limbo/overflow work runs. This ensures >> the work will move off a nohz_full CPU once a housekeeping CPU is >> available. >> diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c >> index 0bbed8c62d42..993837e46db1 100644 >> --- a/arch/x86/kernel/cpu/resctrl/monitor.c >> +++ b/arch/x86/kernel/cpu/resctrl/monitor.c >> @@ -793,8 +793,10 @@ void cqm_handle_limbo(struct work_struct *work) >> >> __check_limbo(d, false); >> >> - if (has_busy_rmid(d)) >> + if (has_busy_rmid(d)) { >> + cpu = cpumask_any_housekeeping(&d->cpu_mask); >> schedule_delayed_work_on(cpu, &d->cqm_limbo, delay); >> + } >> > > ok - but if you do change the CPU the worker is running on then > I also expect d->cqm_work_cpu to be updated. Otherwise the offline > code will not be able to determine if the worker needs to move. Good point - I missed this. Thanks, James