Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp182619rwl; Wed, 4 Jan 2023 17:25:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXtt//D8FfU/BBTjmDI39x41GnGf4GH9qlx7AHQIP9sHLH5ibFtiF39J12Be4QgD+sEas5XO X-Received: by 2002:a17:906:5786:b0:78d:f455:3105 with SMTP id k6-20020a170906578600b0078df4553105mr40997185ejq.45.1672881923288; Wed, 04 Jan 2023 17:25:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672881923; cv=none; d=google.com; s=arc-20160816; b=vQhDmc2tcyA9Nbd5YdB4cbUrWzGoQge/qcjwzCJvu6KAl9TYVdXmhjRmVk1vauIcEQ fBqT8LO6A3NK+qO8bLcHwDSaqIqv/Gz0fvgJRHpzdhf21k88HlfuhgVtQ8S/w9kbYWdG jOEG/uwRpqUSkDQfMQCmQSoqyXLIPAD+0a72loFpZIbe1RCHIo/Qgs1qpuGhTfOvhNiD ArfLUW9UwZ+qCB0WjfPcQ8uePJfJ28h+Wua6pEehi6BCfXrYg3PPFiZdHVd/V7TITP7H eNWgLZJV2n7Qlir2WYZSWJ90Z8ysNgKA1Uj0H/C/C/GdX6f0t7+XXflR0jAdrnUTQ0Wr vnBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=D0Pvd0FEIbHMZmkEUJEqCiQYZNvyK/pKoTut+VERsIU=; b=z11o4hn7FEu+kkJ3yq+U98D4dEKmAgp7XBbXmoMYSqpzPvXV9KaxKXNIve3hn215ZC 5O2MOLUzHEer8TRXfkkKZc7XDFhNwCn/ofQvSlQtOGd1/m21cwmVLPYpq7Gl7EQcNkZD R+B5dlyvNpFkm+ocGXvAi207caNGh/PAIiXleNLaSdIryD9ox0SDEoJe+2j6lKfyTedP sjR+byR2jjmBVNr+CG4bcZ6CPPm760RIDByzTjPkATvDr67j8lo0qeKHwS9Pf6UQ5p4X f70dOJOpOzKMMgxkRh9rWw3DaYop5jL7WyEj/WyTHrrWBdbY1SWXE/awGv3z5Jje5Qw8 pgTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QZg3Vmw+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mm6-20020a170906cc4600b007ae72fcabb3si25058536ejb.838.2023.01.04.17.25.10; Wed, 04 Jan 2023 17:25:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QZg3Vmw+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229445AbjAEAt2 (ORCPT + 56 others); Wed, 4 Jan 2023 19:49:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjAEAsG (ORCPT ); Wed, 4 Jan 2023 19:48:06 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F57630572; Wed, 4 Jan 2023 16:45:05 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id D4116618A0; Thu, 5 Jan 2023 00:45:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34C8EC433EF; Thu, 5 Jan 2023 00:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672879503; bh=kVT1HGBSl7LGywi0JFiEDrUmFvLHman/Yt/MTgK22Cc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QZg3Vmw+pnalljHEBPfGidZfVJkNWzTbNxrTJFrdmuXLqMrtlKhIyYsJJGwxSCfVm GyJGL7lJPn4EJ+Q60cntcETE+DTa4JH8nyT4Yl/ED+9N5xeiMWVsaBhKUWsktO3Xlo VMwSNlq3HcA4h8Urxcn0wXUeeb8t5FNXnRWK+WcntYtmyvkq/8O4ALU/nBAMr+sQ3i RwQx2iTPhm7b3GNoxCk4rdJXhUXqC4HJbPZIw7L0Shs1cXWNhwD3+u26B/O+5Kgu9+ zOofsWii/ioo/yezCYFuy+9nIdNSMYHzfq9MgxKK5UB6iCDWFK7ivgbxZRpZ8ROy5l ucIF1h1pRWU1Q== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E11DC5C149B; Wed, 4 Jan 2023 16:45:02 -0800 (PST) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, Frederic Weisbecker , Boqun Feng , "Paul E . McKenney" , Neeraj Upadhyay , Lai Jiangshan Subject: [PATCH rcu 3/6] rcu-tasks: Remove preemption disablement around srcu_read_[un]lock() calls Date: Wed, 4 Jan 2023 16:44:53 -0800 Message-Id: <20230105004501.1771332-5-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20230105004454.GA1771168@paulmck-ThinkPad-P17-Gen-1> References: <20230105004454.GA1771168@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Frederic Weisbecker Ever since the following commit: 5a41344a3d83 ("srcu: Simplify __srcu_read_unlock() via this_cpu_dec()") SRCU doesn't rely anymore on preemption to be disabled in order to modify the per-CPU counter. And even then it used to be done from the API itself. Therefore and after checking further, it appears to be safe to remove the preemption disablement around __srcu_read_[un]lock() in exit_tasks_rcu_start() and exit_tasks_rcu_finish() Suggested-by: Boqun Feng Suggested-by: Paul E. McKenney Suggested-by: Neeraj Upadhyay Cc: Lai Jiangshan Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney --- kernel/rcu/tasks.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index 50d4c0ec7a89f..fbaed2637a7ff 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -1008,9 +1008,7 @@ EXPORT_SYMBOL_GPL(show_rcu_tasks_classic_gp_kthread); */ void exit_tasks_rcu_start(void) __acquires(&tasks_rcu_exit_srcu) { - preempt_disable(); current->rcu_tasks_idx = __srcu_read_lock(&tasks_rcu_exit_srcu); - preempt_enable(); } /* @@ -1022,9 +1020,7 @@ void exit_tasks_rcu_finish(void) __releases(&tasks_rcu_exit_srcu) { struct task_struct *t = current; - preempt_disable(); __srcu_read_unlock(&tasks_rcu_exit_srcu, t->rcu_tasks_idx); - preempt_enable(); exit_tasks_rcu_finish_trace(t); } -- 2.31.1.189.g2e36527f23