Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp264074lqh; Thu, 28 Mar 2024 00:51:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUye+MooRgBDT3hqr7IKVA0uf/RsfDgEHx8aHhJ2s36ZSvlft78mkBakvvT73soEPmbevRFfZH23y/NHuspAz2sC7AFZcaar/Kij8ymMA== X-Google-Smtp-Source: AGHT+IH5vdHBHiGIrVrTEB+KScCY6Q7QXucMzLFcY7XLPW43KpZSSt0fC2Fb940u5OX/8+ky1Ndo X-Received: by 2002:a05:620a:24d0:b0:789:fb28:70f5 with SMTP id m16-20020a05620a24d000b00789fb2870f5mr2346473qkn.55.1711612283812; Thu, 28 Mar 2024 00:51:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711612283; cv=pass; d=google.com; s=arc-20160816; b=YX7Ds4LnZNuFGSNpiENHGiDUtoCbO1XNP3scx+fEW3Up7g0AoBnBXZn8HNCigkH0oj tZTBdel369Xu66Vtu845SIwn5r+gVau66o49a+vKlHYyb1wPg4m4+leYCMU8gve93l/x NDYG4pmWx3ktbqqWGWL0J8yeN5lGKeUWMkSv0WPGfZPHxfLfaFJ8nDrvt2a79IHqg34q gn4/hSoNReKQxeQnvvIw2xq8wMfVmFb6sE7yp0Jfj0BllqIZUk6ImXSO9zJ/Lh4wNty7 dylztADyabhjoO4GbsBJ9fr5BZdLUXP5ZK55NjXp3wyO3kqypqAGuqb/ncpFdabJJUNR JDmA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Ulcfe4DXVNKzIDhNYM33efHgfW9bwWfLdiuO4gC4Q3M=; fh=5jUooN2mBYojVcy+3LZrGhvkitJZJRJVhukcEvMaBuY=; b=j4oMaAymP68IBFypBl4j+7uqdSL3ArZpZD5IvF1D/h+kaYcmgsWa7E+zqT+9FW8u1k MCi7L32mXYBzR10sDgBnBSSUmcwWNmaDRCPeCZjfgpnN6ki4Jicyupm7sG7l15G+0zDJ 54ev/0KukZxfoG/x0SksyawP/qTXyJ7T0TLyuFqKcsKAWTOYRo/zofViVVHE10DNtsoq Xj1HBt7FIsWfxHesNDJOKXyl4Dsr3zuZo6GLDhpZ92Idet96/BNkUDg2TN05nWpJ+oWU S+AOUtU7l3ooAycmUgrcDiBjyvoJ1kzjRI4kswuu16dHj1RjWBD/yvSlp/HhPIrElCA9 HLcw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AK+5IoRE; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-122532-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122532-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id wx28-20020a05620a5a5c00b0078849a36472si899308qkn.372.2024.03.28.00.51.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 00:51:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122532-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AK+5IoRE; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-122532-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122532-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 892521C2B43A for ; Thu, 28 Mar 2024 07:51:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ACDEB52F6D; Thu, 28 Mar 2024 07:51:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AK+5IoRE" Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78B9B5473F; Thu, 28 Mar 2024 07:50:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711612260; cv=none; b=J6kDM31lRoCgXtyPTYyedi+BgwL3c8JWmqF6deFN4ycQIsa3MVxGOqRs/YeCATMeDeGZODwtKFkjgtBHqQntCurQRohqXQTttUS/5vvl6QsaLwAdmGAErbwcKrYm0+0qxW6SUOye6yiA+Sao00Zwmb+mA6NAWZ4TJ4GImvwxGTQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711612260; c=relaxed/simple; bh=IH/NVPiz0bWht5JKxdEAshiqI2BIr+nUQ1IBd+0iPuM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=e/T6RmPBnGz7eV3yhBGG4TzqkOOstCGBYyQDFnwPc6sbnRzPy/+YThh/HZJld7ythnOPH1YXTQG4H7clbKFLTohMlj1bdukWURzbgAJb56lc4zxlaQQ7+L9Cw6lIpcM13itannyzN8BWWSjiS0hqnh9j0cOO3vFNvlnzDocAjYE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AK+5IoRE; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6e6b6f86975so458685b3a.1; Thu, 28 Mar 2024 00:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711612258; x=1712217058; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ulcfe4DXVNKzIDhNYM33efHgfW9bwWfLdiuO4gC4Q3M=; b=AK+5IoREw9GLCgCheA50VW4WX8B6CPX8FRgYfS/u9/eMf8Dgu+eBKm2iCXhuJBT8/T Mjrb7RhIPFiO26Wr7qDC5YUq1fPjh8HYv7BrS1m+ggxboVtux4DFHTX5kIOzHnLQdFVk xdC7dLj2xGSLtJtxog3LBxChIpKdox52S+lhzD+Rs77UJ56O0ydnz14IS4DPa85nWJtK M4SQZmqZtSY4fxUqpNaTtsbnYx10AfFF3ow0iyv7Z/ymEl4TUX6HlJMpoCd+oq7jVfX7 YPGEhGALPNs+xjF9YQaph/MeNtDumq1EVjXS+jYCTfBXlUVAwdyBK+11UZH3AFE1nfzD DyZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711612258; x=1712217058; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ulcfe4DXVNKzIDhNYM33efHgfW9bwWfLdiuO4gC4Q3M=; b=NNThyMhc3ZY3mU+ybsizrLGjJXKXWUO7nZZ40609Ld2KpfujGUev9ihERrpzlToCxH 6s0WI7/F72BnrVlrHX2Kfzm3xvdSsK5/qIUI83ZjHE4+0HW1poCe3yveosCA95IcMvIO 5dGH+x2O44RBQOsMe5RuUHkadeoIDPeufOooWiDmNN+cQTsueP/p+rJqQui0bz6xqUKt erZImcg5c63VngNFDzQnNDH08hQzD40CNPI9kNOc00YAPzhq5Wmc2ZhNEpXtrssnRKUt hrz7eKKdm5lYAVreNwT99jfiOzcp3k6Ai4SHhj6uWL9/yYmEEWbldp44+pJ09bO/37fC nmPA== X-Gm-Message-State: AOJu0YycMU2P43kHkr9tZQYsDON95alSjPc/tRKE4v131lH4vcsc6HaG nIOGGSM4xqmrgYqkmx+FPhFOvD/TYrqSIO5fwCdUlyJDO4kuv+1URPdQ0QI6 X-Received: by 2002:a05:6a20:4387:b0:1a3:df2f:ab7 with SMTP id i7-20020a056a20438700b001a3df2f0ab7mr2341741pzl.24.1711612258362; Thu, 28 Mar 2024 00:50:58 -0700 (PDT) Received: from localhost ([47.254.32.37]) by smtp.gmail.com with ESMTPSA id x8-20020aa79a48000000b006e6aee6807dsm746913pfj.22.2024.03.28.00.50.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2024 00:50:58 -0700 (PDT) From: Lai Jiangshan To: linux-kernel@vger.kernel.org Cc: rcu@vger.kernel.org, x86@kernel.org, Lai Jiangshan , "Paul E. McKenney" , Peter Zijlstra , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang Subject: [PATCH 02/10] rcu: Move rcu_preempt_depth_set() to rcupdate.h Date: Thu, 28 Mar 2024 15:53:10 +0800 Message-Id: <20240328075318.83039-3-jiangshanlai@gmail.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20240328075318.83039-1-jiangshanlai@gmail.com> References: <20240328075318.83039-1-jiangshanlai@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Lai Jiangshan Prepare for arch-specific-defined rcu_preempt_depth_set(). No functionality change intended, but it has to be defined as a macro as rcupdate.h is a very low level header included from areas that don't even know about the task struct "current". Cc: "Paul E. McKenney" Cc: Peter Zijlstra Cc: Frederic Weisbecker Signed-off-by: Lai Jiangshan --- include/linux/rcupdate.h | 1 + kernel/rcu/tree_plugin.h | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 16f519914415..210f65baf47c 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -78,6 +78,7 @@ void __rcu_read_unlock(void); * types of kernel builds, the rcu_read_lock() nesting depth is unknowable. */ #define rcu_preempt_depth() READ_ONCE(current->rcu_read_lock_nesting) +#define rcu_preempt_depth_set(val) WRITE_ONCE(current->rcu_read_lock_nesting, (val)) #else /* #ifdef CONFIG_PREEMPT_RCU */ diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 36a8b5dbf5b5..b1264096d03a 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -387,11 +387,6 @@ static int rcu_preempt_read_exit(void) return ret; } -static void rcu_preempt_depth_set(int val) -{ - WRITE_ONCE(current->rcu_read_lock_nesting, val); -} - /* * Preemptible RCU implementation for rcu_read_lock(). * Just increment ->rcu_read_lock_nesting, shared state will be updated -- 2.19.1.6.gb485710b