From patchwork Wed Oct 19 22:46:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 5889 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp571634wrs; Wed, 19 Oct 2022 15:52:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7wRYgLKxBkj2IQw1/J71+pyw3X72ZOsLkmWQnrkC4hEh8PtwqSLivFnWKrF19X5NzmFxDF X-Received: by 2002:a05:6402:1d86:b0:457:e84:f0e with SMTP id dk6-20020a0564021d8600b004570e840f0emr9472836edb.241.1666219956011; Wed, 19 Oct 2022 15:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666219956; cv=none; d=google.com; s=arc-20160816; b=Z5E97ZpFJPORcAKulHxrqnwGKgUXA3ZWkM+giwHl9D7qXRr92wMm4ZZTLNyRVoqMFf Ar3uuYqJ74VA8Dk3+VQwyn90/3rsdD6JB4AEgCh42bg33KYTt1/Tm3zwr6hpSrVaQuWB 9DaKFBEEBwwL+KXC2BZJy5n6+fVwb1peJuC6OKYHFb1k3/K943tGoIRzUnHMSGE9RNHs CEyVZ1o8DSow0oNA5MSHhYUO4KK9h4CSOWWYz+kWQTySA6TGqQnn7AWwQWTgN2q2z71a q/b9dGe3jU4Rh3WEPP/oTpSKbiv27Dmb0oiENAq026KtiWPQ6BWSLipA7G1Raj7dWi8k PRsg== 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 :dkim-signature; bh=4r6Bd0HHdUi/pH3EW3rpD8aXMlJrUCz9wyI1ctfKHek=; b=FpbEW6wu0D3hKQMvqoQwbhPE9hdaiyjTbzBa9D2zRFqZLKC0kxRTF/HIEoKATW5lYo 99pzREtXBmpEhOU+80f524IgHv4zX/ks3ITciek25ZER4hmrvT81xbvWkKqZm8jqY7F1 yXGXJEyNmvjtCoNxw4ivF/9vGOp61xKfhR3Ln0VqgpxbRGqCyOrgxm6HYk6c3KHuGf9L 81fPY3TPtf02jO80q7sDSneeXFOTW46eFI/LjmtoxcLsp/E5wHLPMUGBlaWDzfSNMUBq G0SzXQPF4VggGMA8NnsnmJ4f9GSmCv4WlrKtt4ydFgIeoxByacryETKLVX9kGBZVKwHu a10w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Oy/1fcvM"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg15-20020a170907970f00b0078d426c2844si16598583ejc.213.2022.10.19.15.52.11; Wed, 19 Oct 2022 15:52:35 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Oy/1fcvM"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231223AbiJSWre (ORCPT + 99 others); Wed, 19 Oct 2022 18:47:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230371AbiJSWrF (ORCPT ); Wed, 19 Oct 2022 18:47:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B056188AAD; Wed, 19 Oct 2022 15:47:04 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id DA989B8260A; Wed, 19 Oct 2022 22:47:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 506FBC4314A; Wed, 19 Oct 2022 22:47:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666219621; bh=fFc3hA0ZPr//nb0oSgszXsNmNDNbjld6HNvW7I07HJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oy/1fcvMSiFHp/xKwJ9CqwfRJHoqRkZcrv5jCD4aB/NXbeEvG+CAwUn+1laykl7t5 MMmXgTMbAhBmVfvWRKyYlC5jUxmRPZ6dEJEz0m9ZwTUj4tfcDKHGlv9zWZk+A+WIg0 EqUOn0Qr+yCnEZl+/MBE/objul/fDbsW25LyJ9tkZ7Pq6SRXK/2/7uPjOk/JmrDBtJ mVGDhL9L+jbomtlachTuFWKndhB7zvpLpYgWGxho7hvOURaDR6/s/GPVo+BLtxO4uV B56yRqi+MUbeTK0SrMpyjd1/6lJenX52g0gLYrHty/L61W6B5paQBeYXfdxCgTivgS 7jlhUKv59foUw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id AF2425C0A40; Wed, 19 Oct 2022 15:47:00 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, Yipeng Zou , Frederic Weisbecker , "Paul E . McKenney" Subject: [PATCH rcu 6/8] rcu: Remove rcu_is_idle_cpu() Date: Wed, 19 Oct 2022 15:46:57 -0700 Message-Id: <20221019224659.2499511-6-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20221019224652.GA2499358@paulmck-ThinkPad-P17-Gen-1> References: <20221019224652.GA2499358@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747158256752734875?= X-GMAIL-MSGID: =?utf-8?q?1747158256752734875?= From: Yipeng Zou The commit 3fcd6a230fa7 ("x86/cpu: Avoid cpuinfo-induced IPIing of idle CPUs") introduced rcu_is_idle_cpu() in order to identify the current CPU idle state. But commit f3eca381bd49 ("x86/aperfmperf: Replace arch_freq_get_on_cpu()") switched to using MAX_SAMPLE_AGE, so rcu_is_idle_cpu() is no longer used. This commit therefore removes it. Fixes: f3eca381bd49 ("x86/aperfmperf: Replace arch_freq_get_on_cpu()") Signed-off-by: Yipeng Zou Reviewed-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney --- include/linux/rcutiny.h | 2 -- include/linux/rcutree.h | 2 -- kernel/rcu/tree.c | 6 ------ 3 files changed, 10 deletions(-) diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 9bc025aa79a30..5c271bf3a1e7e 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h @@ -146,8 +146,6 @@ static inline void rcu_virt_note_context_switch(void) { } static inline void rcu_cpu_stall_reset(void) { } static inline int rcu_jiffies_till_stall_check(void) { return 21 * HZ; } static inline void rcu_irq_exit_check_preempt(void) { } -#define rcu_is_idle_cpu(cpu) \ - (is_idle_task(current) && !in_nmi() && !in_hardirq() && !in_serving_softirq()) static inline void exit_rcu(void) { } static inline bool rcu_preempt_need_deferred_qs(struct task_struct *t) { diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 70795386b9ffa..4003bf6cfa1c2 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h @@ -87,8 +87,6 @@ bool poll_state_synchronize_rcu_full(struct rcu_gp_oldstate *rgosp); void cond_synchronize_rcu(unsigned long oldstate); void cond_synchronize_rcu_full(struct rcu_gp_oldstate *rgosp); -bool rcu_is_idle_cpu(int cpu); - #ifdef CONFIG_PROVE_RCU void rcu_irq_exit_check_preempt(void); #else diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 5ec97e3f7468f..f6561aa401c04 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -301,12 +301,6 @@ static bool rcu_dynticks_in_eqs(int snap) return !(snap & RCU_DYNTICKS_IDX); } -/* Return true if the specified CPU is currently idle from an RCU viewpoint. */ -bool rcu_is_idle_cpu(int cpu) -{ - return rcu_dynticks_in_eqs(rcu_dynticks_snap(cpu)); -} - /* * Return true if the CPU corresponding to the specified rcu_data * structure has spent some time in an extended quiescent state since