Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp4126493pxm; Tue, 1 Mar 2022 11:48:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwuBG8FmvdUyvs9Gw5mgBHBtVaaaRj6afRXvhafv8xGJB0v+3/tr+smeSxs9crBgBoRjaIx X-Received: by 2002:a17:906:4313:b0:6b8:b3e5:a46 with SMTP id j19-20020a170906431300b006b8b3e50a46mr20429136ejm.417.1646164132634; Tue, 01 Mar 2022 11:48:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646164132; cv=none; d=google.com; s=arc-20160816; b=ZmR2um65kgE6eSzpBqqjKq4hC3y9znm1vM15H0fWwb2vdJApVCJ0EszWOxDuhCPh7y VGUKCmsOPoqCakwkGWeC+fQ4QQxEAqJIdXvpNAQGdkORCnFWQDhsivbSpjCTOJRL3GtX 3xB/5vGpLdhLA6SiJVCHwX6nevme/9KkkHGRU/rqsu2z53n9ANja7Ds6TIKUD0L/Yuc7 JZm2UokDy2c3KRGNeUMozrXuRQ2lPrigZlEg9+rR5qJtfdXiM/k6LGPCyH9yJR8LDUxZ IpuPpKmXivSsMYFEKJXRM1oiNHfKc4EQBQZ/ybVoavGhMbnzhZMHHupBr8+YF1hPiz0V nJWA== 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:subject:cc:to:from:date; bh=3CLvQkRt9yCtBCb3SUpQ/reLHOjNTILTllG8WXxm5Yw=; b=iWn9R3nndzh2LUwEodXTnSHA0a9vUzNOp0h8tKxUibvORp6ZQXRaKHsN00zhooifFm qLMTzgWAigew8b+qT5EdzgcUYpfcd8z+XLgGnyi337VmEUIFggWiFZLjOZcK58VUl6jv AWWYRotrS67CnB9kJ2+y5u7WaHk/JO0+S+zr7LvqaDUU24tQf0Dz7/ZLrwnf+785o1JP 6l1YLjJF6Z8qODtAlloTJ1byXbPCch+5fspqIO4rvpbB82nT6XbKcMhPJtRgm3PovZFP b8xTk/Y9Js3/Pp7hsYG/JysvPYVfNUqzNMf7Da2ba9ZokfHUIsWrFSy49UyO/QISZzeh gjhw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y13-20020a056402358d00b00410d41d96ddsi13584335edc.76.2022.03.01.11.48.30; Tue, 01 Mar 2022 11:48:52 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235559AbiCAPLS (ORCPT + 99 others); Tue, 1 Mar 2022 10:11:18 -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 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, 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 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); >