Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp345371ybz; Tue, 21 Apr 2020 10:05:43 -0700 (PDT) X-Google-Smtp-Source: APiQypJR+1mhuTy1pcLFqqYukrusVra1heEokdR3G14lirVSRiRXzuYKiTP4wFItPjs10wFOCA2P X-Received: by 2002:aa7:c3c2:: with SMTP id l2mr19972286edr.362.1587488742569; Tue, 21 Apr 2020 10:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587488742; cv=none; d=google.com; s=arc-20160816; b=OWRGLvXcaDJPI637/pVYKYjHylzugQTBuz+TZrSFbgRE5Pkn6SPXZ4aWQK4lHAPCCl Vqly3ZNXSOx15IQBIO9Q9rxt/U5tl9l+828ftXpuZaN6dWfqGJ3xt/LzH9XlV73ZmSH5 7V66mGc53uj27xaXVyJWzMpwFPk1D7ZI3kqwz/Zedfz2Z+b+2UzyXBn6Bon/FUi2vBRS 3Kcow9TbbjrrN5PGcW+9Ue9A0SNfMPipCpVmYqse0Ku3B4g+2Zd3i4MMdmO9VWcSryKD o8kc/tl+OygJ3NoWj8tNBnXGJyyZoRwHijKFn8vT6dVYwmVy8SfINetIG4I9OOyR1cRu dsiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vFByQCdmLxTocfGuuyDZFjeRWQLcJ3U/5rP4dCW+BGI=; b=mpjt8NJZosb8cgpX63r6lE/B+YoobnH4fq2hVZIc3dYMg056gnpcbmwalOd4JxxhXu 8zbPSVHNLM7/BNR3XSqF7OTJsVJUXVXNwV3O/q7wTBKROS43MVJ2Ha7PlfFitHPTc8cH TC2GcxiKWAfpTeWgDY3XVBP74TTRXRX/zhKWPVARlGiTrogfQhr/gq+wfMBqUbZlGKsr lo8GAJVMfzr9mXWedBcxT8OddkzCFE6ZFTsUc9ZoEP220jKxImBYhQSVYBzhKIJjvRum MJTBuG+0i88H61jMFZ82n4d48NTsTEwuOs/tQJLorrluZdS+NDC/LrO7Su5T4VkX4Ih+ +xdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=phBRWglM; 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 x25si1934353edi.76.2020.04.21.10.05.17; Tue, 21 Apr 2020 10:05:42 -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=default header.b=phBRWglM; 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 S1729181AbgDURER (ORCPT + 99 others); Tue, 21 Apr 2020 13:04:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:33560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbgDUREO (ORCPT ); Tue, 21 Apr 2020 13:04:14 -0400 Received: from mail.kernel.org (ip5f5ad4d8.dynamic.kabel-deutschland.de [95.90.212.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EA0812070B; Tue, 21 Apr 2020 17:04:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587488654; bh=A/gl9GiSINDqJ4PJGJrHlgv4JPVRUB394Q+IiwjdxOw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=phBRWglMXtPcapPsj8eK7SRF7NlC1RIOXhbVo/a/GezVoyXq/28PllUsa3njugwmv jUKsJIXiNdjfeVBAT5kVHzJ9lSg5I56PjcVy0qwHCFLRCzFUU6xoigXfiDBXvzW1AW FMNRqUxuJIZEkxb3w66+CZ7kisqQgKipjbnZQem4= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jQwJg-00CmLe-42; Tue, 21 Apr 2020 19:04:12 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , rcu@vger.kernel.org Subject: [PATCH 03/10] docs: RCU: convert lockdep.txt to ReST Date: Tue, 21 Apr 2020 19:04:04 +0200 Message-Id: <1ebc0a13f0710a080c2b6f59f546e3c8b60f17b3.1587488137.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org - Add a SPDX header; - Adjust document title; - Mark literal blocks as such; - Add it to RCU/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/RCU/index.rst | 1 + Documentation/RCU/{lockdep.txt => lockdep.rst} | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) rename Documentation/RCU/{lockdep.txt => lockdep.rst} (96%) diff --git a/Documentation/RCU/index.rst b/Documentation/RCU/index.rst index 430a37132b2c..fa7a2a8949b7 100644 --- a/Documentation/RCU/index.rst +++ b/Documentation/RCU/index.rst @@ -11,6 +11,7 @@ RCU concepts arrayRCU checklist + lockdep lockdep-splat rcubarrier rcu_dereference diff --git a/Documentation/RCU/lockdep.txt b/Documentation/RCU/lockdep.rst similarity index 96% rename from Documentation/RCU/lockdep.txt rename to Documentation/RCU/lockdep.rst index 89db949eeca0..f1fc8ae3846a 100644 --- a/Documentation/RCU/lockdep.txt +++ b/Documentation/RCU/lockdep.rst @@ -1,4 +1,8 @@ +.. SPDX-License-Identifier: GPL-2.0 + +======================== RCU and lockdep checking +======================== All flavors of RCU have lockdep checking available, so that lockdep is aware of when each task enters and leaves any flavor of RCU read-side @@ -8,7 +12,7 @@ tracking to include RCU state, which can sometimes help when debugging deadlocks and the like. In addition, RCU provides the following primitives that check lockdep's -state: +state:: rcu_read_lock_held() for normal RCU. rcu_read_lock_bh_held() for RCU-bh. @@ -63,7 +67,7 @@ checking of rcu_dereference() primitives: The rcu_dereference_check() check expression can be any boolean expression, but would normally include a lockdep expression. However, any boolean expression can be used. For a moderately ornate example, -consider the following: +consider the following:: file = rcu_dereference_check(fdt->fd[fd], lockdep_is_held(&files->file_lock) || @@ -82,7 +86,7 @@ RCU read-side critical sections, in case (2) the ->file_lock prevents any change from taking place, and finally, in case (3) the current task is the only task accessing the file_struct, again preventing any change from taking place. If the above statement was invoked only from updater -code, it could instead be written as follows: +code, it could instead be written as follows:: file = rcu_dereference_protected(fdt->fd[fd], lockdep_is_held(&files->file_lock) || @@ -105,7 +109,7 @@ false and they are called from outside any RCU read-side critical section. For example, the workqueue for_each_pwq() macro is intended to be used either within an RCU read-side critical section or with wq->mutex held. -It is thus implemented as follows: +It is thus implemented as follows:: #define for_each_pwq(pwq, wq) list_for_each_entry_rcu((pwq), &(wq)->pwqs, pwqs_node, -- 2.25.2