Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1893425lqa; Tue, 30 Apr 2024 02:20:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVqq9kr1fgj6a2AVE7JEnnScQnROc6UaAjC87qblmTmKVfbNhxApTSyxGa5aCoG+cshIWQiYGknCt7KEwYuQ6KMcY6h6FPMCC/ucU6C/A== X-Google-Smtp-Source: AGHT+IHGysUYaIvbxgIsZC+astcBcTcZG1MS2XNbaXExH5Q3KhHLIDLpeU/MgABAcm+k6td54KIQ X-Received: by 2002:a05:6808:496:b0:3c6:5da:1635 with SMTP id z22-20020a056808049600b003c605da1635mr2559797oid.3.1714468815720; Tue, 30 Apr 2024 02:20:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714468815; cv=pass; d=google.com; s=arc-20160816; b=M3/I0Qip3/Sxx7+MaUyVp5ScsfifcVxWVv2t2E3cqsJL6PcglGFoR3KiQc/8Wz14MR Bt8+RzgxgibzdYJDeDD7CSIrXcxbSYIzWyVYtflm+G9hv+Xv0jLIreB2R+E6/WyCwDPq Qp+kahn/esOXwhEMrBuGjI3Y8XGE4wc4lZBYGfCTzAzuS6Outu0477fGkFnVS4ZGdRli gExjbK3AgAXFL0RqTqSpXHODbgi9uXP9qF8FhnuXux3IjlkB0six5xwb2+GkRx+KeSgw 51gkVELtkGjAjxJuq6LLEspNvyXcfLS02ku01kS2nIeq9IhVnbTGQZMWx3Ucn86fv6Zp lYZg== 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=RZDSvTcBIbMPTAgzpicF94RIF10BBxppzDWPRpbYqWU=; fh=WzinSAfJjQwQsWhpsrf2fBMcmep3NnSwaYa0TI1U7L8=; b=HTHlE3ZnhAvNYnA/IbRpz/sFMYNjgLF/+9aiybWGoZ7u47LzygrD13CD6rzpzofxwg Ug6QhAppZlxbnNlQGjtN5LapIFNAE3YQt7hOtAydX2m2ipcEQLDsXQrQdO1P8ihuU7lG c6N71yE6hEmPom72sCd6lZoupf0kiB/DZOBU1fEU+s4848b8YLQoKgcG6tJVclKW07Bb wXq6i72Goc/hRKGJYXoafx7MTufxw6aCPvQr8PAkmGxlpHjS0VoFUlGqqbE7GiNORvqC hmp9dJ2lO6Aq5uJE1BToEvIcFIoOumitXsRr4DeOjhNg9hZbeisQ0iiBNm2UZZfDigfV +whg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Z/wWb3vv"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-163644-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163644-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i195-20020a639dcc000000b0060e9c8f866csi6981047pgd.878.2024.04.30.02.20.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 02:20:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163644-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Z/wWb3vv"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-163644-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163644-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8F848284A1C for ; Tue, 30 Apr 2024 09:19:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D44DE16D4F2; Tue, 30 Apr 2024 09:18:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Z/wWb3vv" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 0E11614265E for ; Tue, 30 Apr 2024 09:18:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468714; cv=none; b=gz/F3+6SZrKBS/54437HirSAXbhuJpIRrZSyoV0fdLa1JS6HZkEt7AMZPoNZJE97YoRxT7oRZ++t0qnseaFe/f2TYiyOa3tW6ACgMfnhSoR6v3SRjVM8y0heVKMt/PLclu8iPgYNqfNqwxH0Hqxbv+4LSR0VbupTTGNjlnL+MKM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714468714; c=relaxed/simple; bh=+JBBnsVXW1yETIF62J+k2tb+dskhEhdRmII/3jXkznY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uzngcrvmzC1TLCKZNNXhyy1GQ1jEWbxc0M0d2SdI/qOHcsLrqETbSoV2zkWCKNkds2CKtKpQNNOUrJiw8g6winyZZWwiNZqYIw+3s8WEZ0Us9n2Jev7X+hiAHmHV9P29uStqmKtxYmY3iAP8+TllrgWIQbRWNq8MoXSL5p33a8w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Z/wWb3vv; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714468712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RZDSvTcBIbMPTAgzpicF94RIF10BBxppzDWPRpbYqWU=; b=Z/wWb3vvwH1zx23ghKLXZRTLHhNrlsxZzcfYaCVgRosQrH5yoZzyyj5uB3MvGIMG0xZehW SINE3tmEu/lVihkDNfvelcxAKEispiu4ZH+077ReLudlfm+tpsF7r941VwKHUnC5UMM4a5 rTJcHMupmWhplO7vkByFvu+VPMuhFLQ= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-201-WTiR5tc5P3agvZjFcy4x2A-1; Tue, 30 Apr 2024 05:18:26 -0400 X-MC-Unique: WTiR5tc5P3agvZjFcy4x2A-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BA2823C02525; Tue, 30 Apr 2024 09:18:25 +0000 (UTC) Received: from vschneid-thinkpadt14sgen2i.remote.csb (unknown [10.39.193.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D0F440C5C3; Tue, 30 Apr 2024 09:18:23 +0000 (UTC) From: Valentin Schneider To: rcu@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Frederic Weisbecker , "Paul E. McKenney" , Peter Zijlstra , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang Subject: [PATCH v2 07/27] context_tracking, rcu: Rename ct_dynticks_nesting() into ct_nesting() Date: Tue, 30 Apr 2024 11:17:11 +0200 Message-ID: <20240430091740.1826862-8-vschneid@redhat.com> In-Reply-To: <20240430091740.1826862-1-vschneid@redhat.com> References: <20240430091740.1826862-1-vschneid@redhat.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 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 The context_tracking.state RCU_DYNTICKS subvariable has been renamed to RCU_WATCHING, reflect that change in the related helpers. Suggested-by: Frederic Weisbecker Signed-off-by: Valentin Schneider --- include/linux/context_tracking_state.h | 2 +- kernel/context_tracking.c | 10 +++++----- kernel/rcu/tree.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h index 65290e7677e6c..586c1ff22c2e9 100644 --- a/include/linux/context_tracking_state.h +++ b/include/linux/context_tracking_state.h @@ -75,7 +75,7 @@ static __always_inline int ct_rcu_watching_cpu_acquire(int cpu) return atomic_read_acquire(&ct->state) & CT_RCU_WATCHING_MASK; } -static __always_inline long ct_dynticks_nesting(void) +static __always_inline long ct_nesting(void) { return __this_cpu_read(context_tracking.nesting); } diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c index ddf9cfa58039f..596aa4079c51e 100644 --- a/kernel/context_tracking.c +++ b/kernel/context_tracking.c @@ -128,8 +128,8 @@ static void noinstr ct_kernel_exit(bool user, int offset) WARN_ON_ONCE(ct_dynticks_nmi_nesting() != DYNTICK_IRQ_NONIDLE); WRITE_ONCE(ct->dynticks_nmi_nesting, 0); WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && - ct_dynticks_nesting() == 0); - if (ct_dynticks_nesting() != 1) { + ct_nesting() == 0); + if (ct_nesting() != 1) { // RCU will still be watching, so just do accounting and leave. ct->nesting--; return; @@ -137,7 +137,7 @@ static void noinstr ct_kernel_exit(bool user, int offset) instrumentation_begin(); lockdep_assert_irqs_disabled(); - trace_rcu_dyntick(TPS("Start"), ct_dynticks_nesting(), 0, ct_rcu_watching()); + trace_rcu_dyntick(TPS("Start"), ct_nesting(), 0, ct_rcu_watching()); WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && !user && !is_idle_task(current)); rcu_preempt_deferred_qs(current); @@ -166,7 +166,7 @@ static void noinstr ct_kernel_enter(bool user, int offset) long oldval; WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && !raw_irqs_disabled()); - oldval = ct_dynticks_nesting(); + oldval = ct_nesting(); WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && oldval < 0); if (oldval) { // RCU was already watching, so just do accounting and leave. @@ -182,7 +182,7 @@ static void noinstr ct_kernel_enter(bool user, int offset) // instrumentation for the noinstr ct_kernel_enter_state() instrument_atomic_write(&ct->state, sizeof(ct->state)); - trace_rcu_dyntick(TPS("End"), ct_dynticks_nesting(), 1, ct_rcu_watching()); + trace_rcu_dyntick(TPS("End"), ct_nesting(), 1, ct_rcu_watching()); WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && !user && !is_idle_task(current)); WRITE_ONCE(ct->nesting, 1); WARN_ON_ONCE(ct_dynticks_nmi_nesting()); diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 7f3fa9bb34e92..9fe3dcc504777 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -387,7 +387,7 @@ static int rcu_is_cpu_rrupt_from_idle(void) lockdep_assert_irqs_disabled(); /* Check for counter underflows */ - RCU_LOCKDEP_WARN(ct_dynticks_nesting() < 0, + RCU_LOCKDEP_WARN(ct_nesting() < 0, "RCU nesting counter underflow!"); RCU_LOCKDEP_WARN(ct_dynticks_nmi_nesting() <= 0, "RCU dynticks_nmi_nesting counter underflow/zero!"); @@ -403,7 +403,7 @@ static int rcu_is_cpu_rrupt_from_idle(void) WARN_ON_ONCE(!nesting && !is_idle_task(current)); /* Does CPU appear to be idle from an RCU standpoint? */ - return ct_dynticks_nesting() == 0; + return ct_nesting() == 0; } #define DEFAULT_RCU_BLIMIT (IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD) ? 1000 : 10) @@ -595,7 +595,7 @@ void rcu_irq_exit_check_preempt(void) { lockdep_assert_irqs_disabled(); - RCU_LOCKDEP_WARN(ct_dynticks_nesting() <= 0, + RCU_LOCKDEP_WARN(ct_nesting() <= 0, "RCU nesting counter underflow/zero!"); RCU_LOCKDEP_WARN(ct_dynticks_nmi_nesting() != DYNTICK_IRQ_NONIDLE, -- 2.43.0