All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>, Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Will Deacon <will@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v3 18/32] docs: lockdep-design: fix some warning issues
Date: Tue, 27 Oct 2020 10:51:22 +0100	[thread overview]
Message-ID: <3b9431ac5c01e38111cd59928a93e7259ab7db0f.1603791716.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1603791716.git.mchehab+huawei@kernel.org>

There are several warnings caused by a recent change
224ec489d3cd ("lockdep/Documention: Recursive read lock detection reasoning")

Those are reported by htmldocs build:

    Documentation/locking/lockdep-design.rst:429: WARNING: Definition list ends without a blank line; unexpected unindent.
    Documentation/locking/lockdep-design.rst:452: WARNING: Block quote ends without a blank line; unexpected unindent.
    Documentation/locking/lockdep-design.rst:453: WARNING: Unexpected indentation.
    Documentation/locking/lockdep-design.rst:453: WARNING: Blank line required after table.
    Documentation/locking/lockdep-design.rst:454: WARNING: Block quote ends without a blank line; unexpected unindent.
    Documentation/locking/lockdep-design.rst:455: WARNING: Unexpected indentation.
    Documentation/locking/lockdep-design.rst:455: WARNING: Blank line required after table.
    Documentation/locking/lockdep-design.rst:456: WARNING: Block quote ends without a blank line; unexpected unindent.
    Documentation/locking/lockdep-design.rst:457: WARNING: Unexpected indentation.
    Documentation/locking/lockdep-design.rst:457: WARNING: Blank line required after table.

Besides the reported issues, there are some missing blank
lines that ended producing wrong html output, and some
literals are not properly identified.

Also, the symbols used at the irq enabled/disable table
are not displayed as expected, as they're not literals.
Also, on another table they're using a different notation.

Fixes: 224ec489d3cd ("lockdep/Documention: Recursive read lock detection reasoning")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 Documentation/locking/lockdep-design.rst | 51 ++++++++++++++----------
 1 file changed, 31 insertions(+), 20 deletions(-)

diff --git a/Documentation/locking/lockdep-design.rst b/Documentation/locking/lockdep-design.rst
index cec03bd1294a..9f3cfca9f8a4 100644
--- a/Documentation/locking/lockdep-design.rst
+++ b/Documentation/locking/lockdep-design.rst
@@ -42,6 +42,7 @@ The validator tracks lock-class usage history and divides the usage into
 (4 usages * n STATEs + 1) categories:
 
 where the 4 usages can be:
+
 - 'ever held in STATE context'
 - 'ever held as readlock in STATE context'
 - 'ever held with STATE enabled'
@@ -49,10 +50,12 @@ where the 4 usages can be:
 
 where the n STATEs are coded in kernel/locking/lockdep_states.h and as of
 now they include:
+
 - hardirq
 - softirq
 
 where the last 1 category is:
+
 - 'ever used'                                       [ == !unused        ]
 
 When locking rules are violated, these usage bits are presented in the
@@ -96,9 +99,9 @@ exact case is for the lock as of the reporting time.
   +--------------+-------------+--------------+
   |              | irq enabled | irq disabled |
   +--------------+-------------+--------------+
-  | ever in irq  |      ?      |       -      |
+  | ever in irq  |     '?'     |      '-'     |
   +--------------+-------------+--------------+
-  | never in irq |      +      |       .      |
+  | never in irq |     '+'     |      '.'     |
   +--------------+-------------+--------------+
 
 The character '-' suggests irq is disabled because if otherwise the
@@ -216,7 +219,7 @@ looks like this::
        BD_MUTEX_PARTITION
   };
 
-mutex_lock_nested(&bdev->bd_contains->bd_mutex, BD_MUTEX_PARTITION);
+  mutex_lock_nested(&bdev->bd_contains->bd_mutex, BD_MUTEX_PARTITION);
 
 In this case the locking is done on a bdev object that is known to be a
 partition.
@@ -334,7 +337,7 @@ Troubleshooting:
 ----------------
 
 The validator tracks a maximum of MAX_LOCKDEP_KEYS number of lock classes.
-Exceeding this number will trigger the following lockdep warning:
+Exceeding this number will trigger the following lockdep warning::
 
 	(DEBUG_LOCKS_WARN_ON(id >= MAX_LOCKDEP_KEYS))
 
@@ -420,7 +423,8 @@ the critical section of another reader of the same lock instance.
 
 The difference between recursive readers and non-recursive readers is because:
 recursive readers get blocked only by a write lock *holder*, while non-recursive
-readers could get blocked by a write lock *waiter*. Considering the follow example:
+readers could get blocked by a write lock *waiter*. Considering the follow
+example::
 
 	TASK A:			TASK B:
 
@@ -448,20 +452,22 @@ There are simply four block conditions:
 
 Block condition matrix, Y means the row blocks the column, and N means otherwise.
 
-	    | E | r | R |
 	+---+---+---+---+
-	  E | Y | Y | Y |
+	|   | E | r | R |
 	+---+---+---+---+
-	  r | Y | Y | N |
+	| E | Y | Y | Y |
+	+---+---+---+---+
+	| r | Y | Y | N |
+	+---+---+---+---+
+	| R | Y | Y | N |
 	+---+---+---+---+
-	  R | Y | Y | N |
 
 	(W: writers, r: non-recursive readers, R: recursive readers)
 
 
 acquired recursively. Unlike non-recursive read locks, recursive read locks
 only get blocked by current write lock *holders* other than write lock
-*waiters*, for example:
+*waiters*, for example::
 
 	TASK A:			TASK B:
 
@@ -491,7 +497,7 @@ Recursive locks don't block each other, while non-recursive locks do (this is
 even true for two non-recursive read locks). A non-recursive lock can block the
 corresponding recursive lock, and vice versa.
 
-A deadlock case with recursive locks involved is as follow:
+A deadlock case with recursive locks involved is as follow::
 
 	TASK A:			TASK B:
 
@@ -510,7 +516,7 @@ because there are 3 types for lockers, there are, in theory, 9 types of lock
 dependencies, but we can show that 4 types of lock dependencies are enough for
 deadlock detection.
 
-For each lock dependency:
+For each lock dependency::
 
 	L1 -> L2
 
@@ -525,20 +531,25 @@ same types).
 With the above combination for simplification, there are 4 types of dependency edges
 in the lockdep graph:
 
-1) -(ER)->: exclusive writer to recursive reader dependency, "X -(ER)-> Y" means
+1) -(ER)->:
+	    exclusive writer to recursive reader dependency, "X -(ER)-> Y" means
 	    X -> Y and X is a writer and Y is a recursive reader.
 
-2) -(EN)->: exclusive writer to non-recursive locker dependency, "X -(EN)-> Y" means
+2) -(EN)->:
+	    exclusive writer to non-recursive locker dependency, "X -(EN)-> Y" means
 	    X -> Y and X is a writer and Y is either a writer or non-recursive reader.
 
-3) -(SR)->: shared reader to recursive reader dependency, "X -(SR)-> Y" means
+3) -(SR)->:
+	    shared reader to recursive reader dependency, "X -(SR)-> Y" means
 	    X -> Y and X is a reader (recursive or not) and Y is a recursive reader.
 
-4) -(SN)->: shared reader to non-recursive locker dependency, "X -(SN)-> Y" means
+4) -(SN)->:
+	    shared reader to non-recursive locker dependency, "X -(SN)-> Y" means
 	    X -> Y and X is a reader (recursive or not) and Y is either a writer or
 	    non-recursive reader.
 
-Note that given two locks, they may have multiple dependencies between them, for example:
+Note that given two locks, they may have multiple dependencies between them,
+for example::
 
 	TASK A:
 
@@ -592,11 +603,11 @@ circles that won't cause deadlocks.
 
 Proof for sufficiency (Lemma 1):
 
-Let's say we have a strong circle:
+Let's say we have a strong circle::
 
 	L1 -> L2 ... -> Ln -> L1
 
-, which means we have dependencies:
+, which means we have dependencies::
 
 	L1 -> L2
 	L2 -> L3
@@ -633,7 +644,7 @@ a lock held by P2, and P2 is waiting for a lock held by P3, ... and Pn is waitin
 for a lock held by P1. Let's name the lock Px is waiting as Lx, so since P1 is waiting
 for L1 and holding Ln, so we will have Ln -> L1 in the dependency graph. Similarly,
 we have L1 -> L2, L2 -> L3, ..., Ln-1 -> Ln in the dependency graph, which means we
-have a circle:
+have a circle::
 
 	Ln -> L1 -> L2 -> ... -> Ln
 
-- 
2.26.2


  parent reply	other threads:[~2020-10-27 10:01 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27  9:51 [PATCH v3 00/32] Documentation build fixes against v5.10-rc1 Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 01/32] scripts: kernel-doc: use :c:union when needed Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 02/32] sphinx: conf.py: properly handle Sphinx 4.0 Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 03/32] docs: hwmon: adm1266.rst: fix a broken reference Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 04/32] docs: admin-guide: net.rst: add a missing blank line Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 05/32] docs: kasan.rst: add two missing blank lines Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 06/32] docs: net: statistics.rst: remove a duplicated kernel-doc Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 07/32] docs: hwmon: mp2975.rst: address some html build warnings Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 08/32] docs: userspace-api: add iommu.rst to the index file Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 09/32] blk-mq: docs: add kernel-doc description for a new struct member Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 10/32] drm: kernel-doc: document drm_dp_set_subconnector_property() params Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 11/32] drm/dp: fix kernel-doc warnings at drm_dp_helper.c Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 12/32] drm/dp: fix a kernel-doc issue at drm_edid.c Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 13/32] mm: pagemap.h: fix two kernel-doc markups Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 14/32] net: phy: remove kernel-doc duplication Mauro Carvalho Chehab
2020-10-27 12:41   ` Andrew Lunn
2020-10-27  9:51 ` [PATCH v3 15/32] crypto: sun8x-ce*: update entries to its documentation Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 16/32] ice: docs fix a devlink info that broke a table Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 17/32] MAINTAINERS: fix broken doc refs due to yaml conversion Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27  9:51 ` Mauro Carvalho Chehab [this message]
2020-10-27  9:51 ` [PATCH v3 19/32] locking/refcount: move kernel-doc markups to the proper place Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 20/32] IB/srpt: docs: add a description for cq_size member Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-28  3:48   ` Bart Van Assche
2020-10-28  3:48     ` Bart Van Assche
2020-10-27  9:51 ` [PATCH v3 21/32] docs: fs: api-summary.rst: get rid of kernel-doc include Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 22/32] drm: amdgpu: kernel-doc: update some adev parameters Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 23/32] jbd2: fix a kernel-doc markup Mauro Carvalho Chehab
2020-10-27 21:26   ` Theodore Y. Ts'o
2020-10-27  9:51 ` [PATCH v3 24/32] drm: drm_edid: remove a duplicated kernel-doc declaration Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 25/32] drm: kernel-doc: add description for a new function parameter Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27 10:04   ` Gerd Hoffmann
2020-10-27 10:04     ` Gerd Hoffmann
2020-10-27  9:51 ` [PATCH v3 26/32] gpu: docs: amdgpu.rst: get rid of wrong kernel-doc markups Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 27/32] drm: kernel-doc: drm_dp_helper.h: fix a typo Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 28/32] drm: amdgpu_dm: " Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 29/32] selftests: kselftest_harness.h: fix kernel-doc markups Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 30/32] amdgpu: fix a few kernel-doc markup issues Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27  9:51 ` [PATCH v3 31/32] drm: drm_print.h: fix kernel-doc markups Mauro Carvalho Chehab
2020-10-27  9:51   ` Mauro Carvalho Chehab
2020-10-27 10:22   ` Daniel Vetter
2020-10-27 10:22     ` Daniel Vetter
2020-10-27  9:51 ` [PATCH v3 32/32] docs: SafeSetID: fix a warning Mauro Carvalho Chehab
2020-10-28 17:46 ` [PATCH v3 00/32] Documentation build fixes against v5.10-rc1 Jonathan Corbet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b9431ac5c01e38111cd59928a93e7259ab7db0f.1603791716.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=boqun.feng@gmail.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.