From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33A4F847E for ; Fri, 10 Mar 2023 13:48:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4C9DC4339B; Fri, 10 Mar 2023 13:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678456095; bh=/Jg1Ow9y9u9RUDidlEYTdcSt8/m2ETYSirfek+m1lx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WCgbfPdxOoKfDxYl8tDk1oy6FVuvG43MffPCp9vMa7r7itp9WxwHwEFGqlSd3CGys 30O/Jk6Qz4RRsAvIf450ZWB/v4yZctFv8iiigIOwwTeu74enhM9iK9zckqC/zCnmZi ipAnJj8rP+UpE22w3zcgBWtsTK7pMd0FuDe7jqk0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Paul E. McKenney" , Sasha Levin Subject: [PATCH 4.14 079/193] rcu: Suppress smp_processor_id() complaint in synchronize_rcu_expedited_wait() Date: Fri, 10 Mar 2023 14:37:41 +0100 Message-Id: <20230310133713.680236803@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133710.926811681@linuxfoundation.org> References: <20230310133710.926811681@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Paul E. McKenney [ Upstream commit 2d7f00b2f01301d6e41fd4a28030dab0442265be ] The normal grace period's RCU CPU stall warnings are invoked from the scheduling-clock interrupt handler, and can thus invoke smp_processor_id() with impunity, which allows them to directly invoke dump_cpu_task(). In contrast, the expedited grace period's RCU CPU stall warnings are invoked from process context, which causes the dump_cpu_task() function's calls to smp_processor_id() to complain bitterly in debug kernels. This commit therefore causes synchronize_rcu_expedited_wait() to disable preemption around its call to dump_cpu_task(). Signed-off-by: Paul E. McKenney Signed-off-by: Sasha Levin --- kernel/rcu/tree_exp.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h index f90d10c1c3c8d..843399e98bb37 100644 --- a/kernel/rcu/tree_exp.h +++ b/kernel/rcu/tree_exp.h @@ -498,7 +498,9 @@ static void synchronize_sched_expedited_wait(struct rcu_state *rsp) mask = leaf_node_cpu_bit(rnp, cpu); if (!(rnp->expmask & mask)) continue; + preempt_disable(); // For smp_processor_id() in dump_cpu_task(). dump_cpu_task(cpu); + preempt_enable(); } } jiffies_stall = 3 * rcu_jiffies_till_stall_check() + 3; -- 2.39.2