Message ID | 20230728164254.27562-11-james.morse@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp567319vqg; Fri, 28 Jul 2023 09:57:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlE8xWqjKiPbPMunZZYueeWC9epkoRu+FVA/7UqeQbK0NWD29s6Au2McGp+DcM54oFB3rDv+ X-Received: by 2002:a05:6a21:7897:b0:13c:dee4:ceaa with SMTP id bf23-20020a056a21789700b0013cdee4ceaamr1629643pzc.16.1690563464545; Fri, 28 Jul 2023 09:57:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690563464; cv=none; d=google.com; s=arc-20160816; b=nZVZX7jMYo3CSYomkNH9LmE2eIYKRsPZtN5hDaxcvEAiNNRBHzq19KD2RFTz4XRTyz AL6y2/VPcZIaN4h/U8Ob1/lfHWlFePbvO295aBKig2Nx3di0BNrcIFtJ/YSQCtwCicKz E2iQJUTvk12PO0AyunuqfJ3TPwgscnWm+7NZakxw9GdeU7KMS95qh+Cz4ibFpnvl7fnF vH3pyYi0fJMeETkH5rxAQQd8aHtcQJnFlLMv07xtZgaEt9SVDVXWi9s2+H1blpa2k2QL oKh5ASb/7JzIOD9WW61lFqym8MG2/bTcaZABS1R3pgVAAklKY4WgeQSZB59J1XFnzktc BC/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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=AnaEspv7yPHxWFYxao23k8O8tDzjRIv0xbGT3Sv6WLQ=; fh=n9L+e/Mo/wOalMjVbltm4zKnQoPh0Qbxoe+x3eznw8A=; b=Tpr2rOjYLmy0BsU7jImzdGYGtBocFpM0e3fHctGbjCu9kQwaSvzQG9eke8qMdTZk1j bfboW7JmN5DGsWzhPWSsE8B0mzSfxef2poIPngSnX+08WWHAiCx1lh6rLi2kZmiIr9wd SDwF7SfKqOHHON18zW+5MaQFaYF/IEVp78ulhXzxQQMbK0kqsSgCOwcr7fp471hVSj3D Mmg5ce1l9ne3kWdkvJ0xfedf+IlnBSNn3aVJgIuLXLL5TonXIYU0xx1AdDTDJWbuVnUq avXAkcyQjQdBuZGq4eANico42s75XrL4+mFLok2XszSteGobg3548J5LekgChnzczhR0 M8og== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14-20020a63e80e000000b0055b12581c75si3241112pgh.675.2023.07.28.09.57.31; Fri, 28 Jul 2023 09:57:44 -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 S235318AbjG1QpW (ORCPT <rfc822;hanasaki@gmail.com> + 99 others); Fri, 28 Jul 2023 12:45:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235566AbjG1Qoc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 28 Jul 2023 12:44:32 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BF69F4C13 for <linux-kernel@vger.kernel.org>; Fri, 28 Jul 2023 09:43:48 -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 CD43CD75; Fri, 28 Jul 2023 09:44:30 -0700 (PDT) Received: from merodach.members.linode.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1286D3F844; Fri, 28 Jul 2023 09:43:44 -0700 (PDT) From: James Morse <james.morse@arm.com> To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu <fenghua.yu@intel.com>, Reinette Chatre <reinette.chatre@intel.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, H Peter Anvin <hpa@zytor.com>, Babu Moger <Babu.Moger@amd.com>, James Morse <james.morse@arm.com>, shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS <scott@os.amperecomputing.com>, carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, xingxin.hx@openanolis.org, baolin.wang@linux.alibaba.com, Jamie Iles <quic_jiles@quicinc.com>, Xin Hao <xhao@linux.alibaba.com>, peternewman@google.com, dfustini@baylibre.com Subject: [PATCH v5 10/24] tick/nohz: Move tick_nohz_full_mask declaration outside the #ifdef Date: Fri, 28 Jul 2023 16:42:40 +0000 Message-Id: <20230728164254.27562-11-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230728164254.27562-1-james.morse@arm.com> References: <20230728164254.27562-1-james.morse@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772684275394911988 X-GMAIL-MSGID: 1772684275394911988 |
Series |
x86/resctrl: monitored closid+rmid together, separate arch/fs locking
|
|
Commit Message
James Morse
July 28, 2023, 4:42 p.m. UTC
tick_nohz_full_mask lists the CPUs that are nohz_full. This is only
needed when CONFIG_NO_HZ_FULL is defined. tick_nohz_full_cpu() allows
a specific CPU to be tested against the mask, and evaluates to false
when CONFIG_NO_HZ_FULL is not defined.
The resctrl code needs to pick a CPU to run some work on, a new helper
prefers housekeeping CPUs by examining the tick_nohz_full_mask. Hiding
the declaration behind #ifdef CONFIG_NO_HZ_FULL forces all the users to
be behind an ifdef too.
Move the tick_nohz_full_mask declaration, this lets callers drop the
ifdef, and guard access to tick_nohz_full_mask with IS_ENABLED() or
something like tick_nohz_full_cpu().
The definition does not need to be moved as any callers should be
removed at compile time unless CONFIG_NO_HZ_FULL is defined.
Signed-off-by: James Morse <james.morse@arm.com>
---
include/linux/tick.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
Comments
Hi James, On 7/28/2023 9:42 AM, James Morse wrote: > tick_nohz_full_mask lists the CPUs that are nohz_full. This is only > needed when CONFIG_NO_HZ_FULL is defined. tick_nohz_full_cpu() allows > a specific CPU to be tested against the mask, and evaluates to false > when CONFIG_NO_HZ_FULL is not defined. > > The resctrl code needs to pick a CPU to run some work on, a new helper > prefers housekeeping CPUs by examining the tick_nohz_full_mask. Hiding > the declaration behind #ifdef CONFIG_NO_HZ_FULL forces all the users to > be behind an ifdef too. > > Move the tick_nohz_full_mask declaration, this lets callers drop the > ifdef, and guard access to tick_nohz_full_mask with IS_ENABLED() or > something like tick_nohz_full_cpu(). > > The definition does not need to be moved as any callers should be > removed at compile time unless CONFIG_NO_HZ_FULL is defined. > > Signed-off-by: James Morse <james.morse@arm.com> > --- > include/linux/tick.h | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) This is outside of the resctrl area. What is the upstreaming plan for this patch? Reinette
Hi Reinette, On 09/08/2023 23:34, Reinette Chatre wrote: > On 7/28/2023 9:42 AM, James Morse wrote: >> tick_nohz_full_mask lists the CPUs that are nohz_full. This is only >> needed when CONFIG_NO_HZ_FULL is defined. tick_nohz_full_cpu() allows >> a specific CPU to be tested against the mask, and evaluates to false >> when CONFIG_NO_HZ_FULL is not defined. >> >> The resctrl code needs to pick a CPU to run some work on, a new helper >> prefers housekeeping CPUs by examining the tick_nohz_full_mask. Hiding >> the declaration behind #ifdef CONFIG_NO_HZ_FULL forces all the users to >> be behind an ifdef too. >> >> Move the tick_nohz_full_mask declaration, this lets callers drop the >> ifdef, and guard access to tick_nohz_full_mask with IS_ENABLED() or >> something like tick_nohz_full_cpu(). >> >> The definition does not need to be moved as any callers should be >> removed at compile time unless CONFIG_NO_HZ_FULL is defined. >> >> Signed-off-by: James Morse <james.morse@arm.com> >> --- >> include/linux/tick.h | 9 ++++++++- >> 1 file changed, 8 insertions(+), 1 deletion(-) > > This is outside of the resctrl area. What is the upstreaming > plan for this patch? Once you're happy with the rest of it - we can give the other folk on CC a poke. I'd assume changes to this file also go via tip. It would just need an ack from the relevant person. Thanks, James
Hi Reinette, On 8/25/23 01:43, Reinette Chatre wrote: > On 8/24/2023 9:55 AM, James Morse wrote: >> On 09/08/2023 23:34, Reinette Chatre wrote: >>> On 7/28/2023 9:42 AM, James Morse wrote: >>>> tick_nohz_full_mask lists the CPUs that are nohz_full. This is only >>>> needed when CONFIG_NO_HZ_FULL is defined. tick_nohz_full_cpu() allows >>>> a specific CPU to be tested against the mask, and evaluates to false >>>> when CONFIG_NO_HZ_FULL is not defined. >>>> >>>> The resctrl code needs to pick a CPU to run some work on, a new helper >>>> prefers housekeeping CPUs by examining the tick_nohz_full_mask. Hiding >>>> the declaration behind #ifdef CONFIG_NO_HZ_FULL forces all the users to >>>> be behind an ifdef too. >>>> >>>> Move the tick_nohz_full_mask declaration, this lets callers drop the >>>> ifdef, and guard access to tick_nohz_full_mask with IS_ENABLED() or >>>> something like tick_nohz_full_cpu(). >>>> >>>> The definition does not need to be moved as any callers should be >>>> removed at compile time unless CONFIG_NO_HZ_FULL is defined. >>> This is outside of the resctrl area. What is the upstreaming >>> plan for this patch? >> >> Once you're happy with the rest of it - we can give the other folk on CC a poke. >> I'd assume changes to this file also go via tip. It would just need an ack from the >> relevant person. > > At the moment this change is buried within a pile of resctrl > changes so we need to make sure that folks are not surprised by this > thinking we are trying to sneak it in. Please note that > CC is currently missing Frederic Weisbecker. Oops, fixed. > I wonder if it may help to change cover letter to be something like > "x86/resctrl and tick/nohz: Monitor ..." Just an idea. I think that would be excessive - the subject of the patch already matches what is normal for that file. I'll move the patch to the top of the series as that makes it clearer that there is no dependency on the rest of the series. Thanks, James
diff --git a/include/linux/tick.h b/include/linux/tick.h index 9459fef5b857..65af90ca409a 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h @@ -174,9 +174,16 @@ static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; } static inline void tick_nohz_idle_stop_tick_protected(void) { } #endif /* !CONFIG_NO_HZ_COMMON */ +/* + * Mask of CPUs that are nohz_full. + * + * Users should be guarded by CONFIG_NO_HZ_FULL or a tick_nohz_full_cpu() + * check. + */ +extern cpumask_var_t tick_nohz_full_mask; + #ifdef CONFIG_NO_HZ_FULL extern bool tick_nohz_full_running; -extern cpumask_var_t tick_nohz_full_mask; static inline bool tick_nohz_full_enabled(void) {