From patchwork Sat Jan 9 02:05:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 360428 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44EC6C43331 for ; Sat, 9 Jan 2021 02:06:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2073523B02 for ; Sat, 9 Jan 2021 02:06:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726500AbhAICG1 (ORCPT ); Fri, 8 Jan 2021 21:06:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:41464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725835AbhAICG1 (ORCPT ); Fri, 8 Jan 2021 21:06:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EDFDC23AA8; Sat, 9 Jan 2021 02:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610157946; bh=1SrBTlbPzwqTruhS60yTCVOH5SjTUATV2RzaG5lWSgg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=td22Phc4eRAflXnP8TT3AyoVYzQq7GiKGreDRwkxOaEMscBkDWrkwDOM79Lor+6oS e9kc/bsLYoapFPi5yCnaYSTG69IFjJYpmpPmITqCH8oPuSnwfp42rLddHTemL5jECF iM7anToMEedQpVqNK+rPEZnHZzix32DV3gyOK+9Qb8i2qFltnPfxH26sG/nuNfytH9 t9DcRgeGyBRVcblXAnquvpqGu0qwpsLB27r7VH77+Pvn43LRDi1tRxmEanFf1NIGB5 KWqcCTLqE+Knmxj4wTOpjYmxpvUC9icfgkbiExLdD3/arta4/V9BpuYrqy0mjXJhAA Mp7hAzBHnIqhA== From: Frederic Weisbecker To: Peter Zijlstra , "Paul E . McKenney" Cc: LKML , Frederic Weisbecker , "Rafael J . Wysocki" , Ingo Molnar , Thomas Gleixner , stable@vger.kernel.org Subject: [RFC PATCH 2/8] rcu: Pull deferred rcuog wake up to rcu_eqs_enter() callers Date: Sat, 9 Jan 2021 03:05:30 +0100 Message-Id: <20210109020536.127953-3-frederic@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210109020536.127953-1-frederic@kernel.org> References: <20210109020536.127953-1-frederic@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Deferred wakeup of rcuog kthreads upon RCU idle mode entry is going to be handled differently whether initiated by idle, user or guest. Prepare with pulling that control up to rcu_eqs_enter() callers. Signed-off-by: Frederic Weisbecker Cc: Paul E. McKenney Cc: Rafael J. Wysocki Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar --- kernel/rcu/tree.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index fef90c467670..b9fff18d14d9 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -643,7 +643,6 @@ static noinstr void rcu_eqs_enter(bool user) instrumentation_begin(); trace_rcu_dyntick(TPS("Start"), rdp->dynticks_nesting, 0, atomic_read(&rdp->dynticks)); WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && !user && !is_idle_task(current)); - do_nocb_deferred_wakeup(rdp); rcu_prepare_for_idle(); rcu_preempt_deferred_qs(current); @@ -671,7 +670,10 @@ static noinstr void rcu_eqs_enter(bool user) */ void rcu_idle_enter(void) { + struct rcu_data *rdp = this_cpu_ptr(&rcu_data); + lockdep_assert_irqs_disabled(); + do_nocb_deferred_wakeup(rdp); rcu_eqs_enter(false); } EXPORT_SYMBOL_GPL(rcu_idle_enter); @@ -690,7 +692,10 @@ EXPORT_SYMBOL_GPL(rcu_idle_enter); */ noinstr void rcu_user_enter(void) { + struct rcu_data *rdp = this_cpu_ptr(&rcu_data); + lockdep_assert_irqs_disabled(); + do_nocb_deferred_wakeup(rdp); rcu_eqs_enter(true); } #endif /* CONFIG_NO_HZ_FULL */