Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp13866pxv; Wed, 21 Jul 2021 14:07:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7x4PNgWGAzQ6kA7E64d1CWFlUU3b8GBXGis/GQtGorzqZfr1C7AmRBQ5tQC/SDz1ARn1u X-Received: by 2002:a92:3302:: with SMTP id a2mr25661096ilf.62.1626901535443; Wed, 21 Jul 2021 14:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626901535; cv=none; d=google.com; s=arc-20160816; b=p7xU0zF18bl4G5s8/Ire+jkCwxFFxoRMQnEtPQSjWqNwjINfRSb/v93BGl7Yk79yXa ZvCP1YIvNer//lFTnvJ+5OBGd0/Nk/bGCHRbWplryzTJcXorTEbUqdOoViZVHoRAZJ7I lkT0COS9pVRiH14GpH9qbaPkZ7v9szX0CiOff5es8I50XMxIag0LrmbiOtjhcEfmAhSl 1iBNcD3OxNssSWoBCkJYsgsJLTpyLA8uzSiYg7vP22gulR+ZvqkX9OhZ+hAwbVpptjz4 7v0RY3XtQgHue6F8DpMEMvTHJCx6iwcXieIqu4D2dlYUgHBG1lv1Hlgp/XPAb4kNPx68 S86Q== 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=SbJaTsQk1Eevc9pcs4kXzguM16T3Holmq7h/+iHj6Bw=; b=Ub+CqcQwxMBuV9cVhgtS7MGhMWNkPG5fkvqZgxIhGUIlLYjVa2c6bdU24mK2UQLu0G B78bUM0BZgIAGAGc3OCG3hMvx5ZmiRYpqm93/Z5LtN6xoXxhhA1ea9q44bZrAT5pfEcu P1+Aal5E4rPckZJktXPbjvGk13MGHD6NwLG0A95FopZtmd8nzNtQGBNc8/2uTARKF/Pt BmfZg1tEAdEfGxQMelkwNCOEXKLpmnTk/eFp235/nIsfhGvgIF4JxA6h9at14k5CvBV/ dfukXfN3xUtwLgkU3B4/zosJaEbI1QZq5/ETEZB3EqghYzlx09lDfLW42fRfKo9nok1e 9AQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lQ1Wn3tI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k2si27530890jao.12.2021.07.21.14.05.23; Wed, 21 Jul 2021 14:05:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lQ1Wn3tI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S240537AbhGUTld (ORCPT + 99 others); Wed, 21 Jul 2021 15:41:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:50150 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240396AbhGUTkx (ORCPT ); Wed, 21 Jul 2021 15:40:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EEF6761376; Wed, 21 Jul 2021 20:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626898890; bh=gYGT2TdvW7CGqArE81oxQ37v9JGE/2qRSNuOECdP1Rg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lQ1Wn3tIm2vxQZfPGlY2NHQYdQTegLvtZn2RDZh/N5LylHnD0LLqX60zD7dxXAbxy yg9KY5hEGHYA8NNaP+xM/SWgk7zlmCCY1q0ehgL2uckUOLoz/tAPo/digk9X1ChiMW Z4wDLYhm3CZAlnZ4IZ68FLv/Ryy6GdwrsuwUpsQ69Qv96d3xcR4ROsIPUiixTzVD0+ FOiKF2H11qiHazh+oDkPXEt4H9ym6MfBkmFXJqVQpjNZrwLgfK+skzey4qdMpGUVJW yniGD9WCJ13yWw60miCH85s9kGif2QkpLe8x/nI1eGrOA5ANHeapbiad7F74tjSASR +CtpH8Qqu/Mdg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 4DA995C2315; Wed, 21 Jul 2021 13:21:29 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, "Paul E. McKenney" Subject: [PATCH rcu 18/18] rcu: Print human-readable message for schedule() in RCU reader Date: Wed, 21 Jul 2021 13:21:26 -0700 Message-Id: <20210721202127.2129660-18-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20210721202042.GA1472052@paulmck-ThinkPad-P17-Gen-1> References: <20210721202042.GA1472052@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 The WARN_ON_ONCE() invocation within the CONFIG_PREEMPT=y version of rcu_note_context_switch() triggers when there is a voluntary context switch in an RCU read-side critical section, but there is quite a gap between the output of that WARN_ON_ONCE() and this RCU-usage error. This commit therefore converts the WARN_ON_ONCE() to a WARN_ONCE() that explicitly describes the problem in its message. Signed-off-by: Paul E. McKenney --- kernel/rcu/tree_plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 83a702a4e2963..e8b45ab72a799 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -346,7 +346,7 @@ void rcu_note_context_switch(bool preempt) trace_rcu_utilization(TPS("Start context switch")); lockdep_assert_irqs_disabled(); - WARN_ON_ONCE(!preempt && rcu_preempt_depth() > 0); + WARN_ONCE(!preempt && rcu_preempt_depth() > 0, "Voluntary context switch within RCU read-side critical section!"); if (rcu_preempt_depth() > 0 && !t->rcu_read_unlock_special.b.blocked) { -- 2.31.1.189.g2e36527f23