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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 670BEC433F5 for ; Tue, 19 Apr 2022 00:08:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238234AbiDSAKs (ORCPT ); Mon, 18 Apr 2022 20:10:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237940AbiDSAKe (ORCPT ); Mon, 18 Apr 2022 20:10:34 -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 A654663D6; Mon, 18 Apr 2022 17:07:52 -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 58FE8B8113A; Tue, 19 Apr 2022 00:07:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF473C385B7; Tue, 19 Apr 2022 00:07:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650326869; bh=He2ZUlSMEvn9zM0ylx3h/dbdQFC19ze5vEZT/mXl27Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k2uS3++JmOpIsaj7TfjHXB6rdC7h/XHLbGy02RGZRGoVq0PoIr4L+wJep0WcVl0Rg /YMkRUSTVWgW3b8b2O9tZvpcaZwDMRtfAoXAtFd48B3Y47HmGV1R4T43gmascbD1Yw kNOHK096PPfWOVb4Mt7qmUEJBMVOp74O6s5bCX12D/7vyyYa3jonshy9d8e4MKgsvL eCyYGf/9UpT0b3mWTMhdVndOrtBjn69nJTiLhrUWGTiMG+mzrXxOsXEbfBVILvRBG2 RjpiyrsqXQag3e2UhfwK/gI3x4DzCuY6WS5xn8zMMX3TMgMkQ1DAVrpCOiahsgPV6J 9ojJ+q+/n/ODw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 2A6A05C0B86; Mon, 18 Apr 2022 17:07:49 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, Frederic Weisbecker , "Paul E . McKenney" Subject: [PATCH rcu 6/6] rcutorture: Call preempt_schedule() through static call/key Date: Mon, 18 Apr 2022 17:07:46 -0700 Message-Id: <20220419000746.3949667-6-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220419000541.GA3949109@paulmck-ThinkPad-P17-Gen-1> References: <20220419000541.GA3949109@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Frederic Weisbecker The rcutorture test suite sometimess triggers a random scheduler preemption call while simulating a read delay. Unfortunately, its direct call to preempt_schedule() bypasses the static call/key filter used by CONFIG_PREEMPT_DYNAMIC. This breaks the no-preempt assumption when the dynamic preemption mode is "none". For example, rcu_blocking_is_gp() is fooled and abbreviates grace periods when the CPU runs in no-preempt UP mode. Fix this by making torture_preempt_schedule() call __preempt_schedule(), which uses the static call/key. Reported-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney --- include/linux/torture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/torture.h b/include/linux/torture.h index 63fa4196e51c..7038104463e4 100644 --- a/include/linux/torture.h +++ b/include/linux/torture.h @@ -118,7 +118,7 @@ void _torture_stop_kthread(char *m, struct task_struct **tp); _torture_stop_kthread("Stopping " #n " task", &(tp)) #ifdef CONFIG_PREEMPTION -#define torture_preempt_schedule() preempt_schedule() +#define torture_preempt_schedule() __preempt_schedule() #else #define torture_preempt_schedule() do { } while (0) #endif -- 2.31.1.189.g2e36527f23