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 C5B72C433EF for ; Tue, 1 Mar 2022 15:10:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235580AbiCAPLT (ORCPT ); Tue, 1 Mar 2022 10:11:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235587AbiCAPLO (ORCPT ); Tue, 1 Mar 2022 10:11:14 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51BC590254 for ; Tue, 1 Mar 2022 07:10:32 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D88E861678 for ; Tue, 1 Mar 2022 15:10:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B641C340EE; Tue, 1 Mar 2022 15:10:30 +0000 (UTC) Date: Tue, 1 Mar 2022 10:10:28 -0500 From: Steven Rostedt To: Nicolas Saenz Julienne Cc: mingo@redhat.com, peterz@infradead.org, frederic@kernel.org, tglx@linutronix.de, mtosatti@redhat.com, bristot@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] sched/isolation: use raw_smp_processor_id() in housekeeping_any_cpu() Message-ID: <20220301101028.1f510bf5@gandalf.local.home> In-Reply-To: <20220301113053.141514-1-nsaenzju@redhat.com> References: <20220301113053.141514-1-nsaenzju@redhat.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 1 Mar 2022 12:30:52 +0100 Nicolas Saenz Julienne wrote: > housekeeping_any_cpu() will return a housekeeping CPU. That's it. It'll > try to optimize for NUMA locality and to use the local CPU, but it's not > a requisite. > > So let's use raw_smp_processor_id() instead of its vanilla counterpart > in order to allow users to query for housekeeping CPUs without having to > disable preemption. Peter, care to ACK this, and I can take it through my tree? -- Steve > > Signed-off-by: Nicolas Saenz Julienne > --- > include/linux/sched/isolation.h | 2 +- > kernel/sched/isolation.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h > index 8c15abd67aed..0c09ff1e4599 100644 > --- a/include/linux/sched/isolation.h > +++ b/include/linux/sched/isolation.h > @@ -31,7 +31,7 @@ extern void __init housekeeping_init(void); > > static inline int housekeeping_any_cpu(enum hk_type type) > { > - return smp_processor_id(); > + return raw_smp_processor_id(); > } > > static inline const struct cpumask *housekeeping_cpumask(enum hk_type type) > diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c > index b4d10815c45a..c2c1f6d8bb5f 100644 > --- a/kernel/sched/isolation.c > +++ b/kernel/sched/isolation.c > @@ -43,14 +43,14 @@ int housekeeping_any_cpu(enum hk_type type) > > if (static_branch_unlikely(&housekeeping_overridden)) { > if (housekeeping.flags & BIT(type)) { > - cpu = sched_numa_find_closest(housekeeping.cpumasks[type], smp_processor_id()); > + cpu = sched_numa_find_closest(housekeeping.cpumasks[type], raw_smp_processor_id()); > if (cpu < nr_cpu_ids) > return cpu; > > return cpumask_any_and(housekeeping.cpumasks[type], cpu_online_mask); > } > } > - return smp_processor_id(); > + return raw_smp_processor_id(); > } > EXPORT_SYMBOL_GPL(housekeeping_any_cpu); >