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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 117CEC43217 for ; Mon, 15 Nov 2021 23:36:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF64861AFF for ; Mon, 15 Nov 2021 23:36:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354447AbhKOXiY (ORCPT ); Mon, 15 Nov 2021 18:38:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:44604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343631AbhKOTVc (ORCPT ); Mon, 15 Nov 2021 14:21:32 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 96AD9635C6; Mon, 15 Nov 2021 18:43:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637001818; bh=f1xlnui6Zdw2CS6W6CHlEOfYUMbrtAY+zN3e7S5p3ew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ECwwS8bdkJSOXGLDchqBrKp7avWX9CliMvvtgLsh47SdkT/eIDxaAkhTLaYE1iKIx qQ779DjuCJAyqaHTAmOXpgPRbSSv3E2jfraqRhpipn74I5AVYBD5n6rrf1ZEXWp3wP mqIDlyCJ7Ciw8yxDYNCJ3hpbgZysBd2YBITsT5kw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Neeraj Upadhyay , "Paul E. McKenney" , Sasha Levin Subject: [PATCH 5.15 332/917] rcu: Fix existing exp request check in sync_sched_exp_online_cleanup() Date: Mon, 15 Nov 2021 17:57:07 +0100 Message-Id: <20211115165440.014619674@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211115165428.722074685@linuxfoundation.org> References: <20211115165428.722074685@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Neeraj Upadhyay [ Upstream commit f0b2b2df5423fb369ac762c77900bc7765496d58 ] The sync_sched_exp_online_cleanup() checks to see if RCU needs an expedited quiescent state from the incoming CPU, sending it an IPI if so. Before sending IPI, it checks whether expedited qs need has been already requested for the incoming CPU, by checking rcu_data.cpu_no_qs.b.exp for the current cpu, on which sync_sched_exp_online_cleanup() is running. This works for the case where incoming CPU is same as self. However, for the case where incoming CPU is different from self, expedited request won't get marked, which can potentially delay reporting of expedited quiescent state for the incoming CPU. Fixes: e015a3411220 ("rcu: Avoid self-IPI in sync_sched_exp_online_cleanup()") Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney Signed-off-by: Sasha Levin --- kernel/rcu/tree_exp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h index 2796084ef85a5..454b516ea566e 100644 --- a/kernel/rcu/tree_exp.h +++ b/kernel/rcu/tree_exp.h @@ -760,7 +760,7 @@ static void sync_sched_exp_online_cleanup(int cpu) my_cpu = get_cpu(); /* Quiescent state either not needed or already requested, leave. */ if (!(READ_ONCE(rnp->expmask) & rdp->grpmask) || - __this_cpu_read(rcu_data.cpu_no_qs.b.exp)) { + rdp->cpu_no_qs.b.exp) { put_cpu(); return; } -- 2.33.0