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 62D7FC433FE for ; Tue, 16 Nov 2021 02:07:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4DCB9611ED for ; Tue, 16 Nov 2021 02:07:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346399AbhKPCKK (ORCPT ); Mon, 15 Nov 2021 21:10:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:40734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239159AbhKOR7Q (ORCPT ); Mon, 15 Nov 2021 12:59:16 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 38A3D632D2; Mon, 15 Nov 2021 17:35:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1636997753; bh=fJ8c2T6U37mIa+d5yJegEosdREEQsVK0+vEhNHkAQmw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=omLhGQbWGxWSGhhM1uYbrcKRZqpej8KyQ+vYX+gdG6PIcjWte4gSJNEABWE7dBs69 by2Rb34tjnkFKRiIhkTK5PZfzUXGa0goPQA4Bq1IXlWb621zYDB27n6nVOxIEAt21k Cs1BU+K875NOrqK8621zQsj9xyy+bZGMaNdTpF04= 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.10 263/575] rcu: Fix existing exp request check in sync_sched_exp_online_cleanup() Date: Mon, 15 Nov 2021 17:59:48 +0100 Message-Id: <20211115165352.864405011@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211115165343.579890274@linuxfoundation.org> References: <20211115165343.579890274@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 8760b6ead770a..0ffe185c1f46a 100644 --- a/kernel/rcu/tree_exp.h +++ b/kernel/rcu/tree_exp.h @@ -759,7 +759,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