treewide: Add \noindent where necessary
PATCH 1/1 treewide: Add \noindent where necessary
From e11254e95c6d33eaf999a1e1c4831af2e141fb91 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 4 Sep 2016 08:01:50 +0900
Subject: [PATCH] treewide: Add \noindent where necessary
Since commit 213f584cd55b ("Add a few epigraphs") and following commits, implicit no-indentation of first paragraph of a Chapter has been lost.
This commit adds explicit "\noindent" after \epigraph{}s.
It also adds "\noindent" where some environment is used just after "\section{}", "subsection{}", or "subsubsection{}.
--- SMPdesign/SMPdesign.tex | 1 + SMPdesign/beyond.tex | 1 + advsync/advsync.tex | 1 + appendix/primitives/primitives.tex | 1 + appendix/questions/questions.tex | 1 + appendix/questions/time.tex | 1 + appendix/whymb/whymemorybarriers.tex | 1 + count/count.tex | 7 +++++++ cpu/cpu.tex | 1 + datastruct/datastruct.tex | 4 ++++ debugging/debugging.tex | 2 ++ defer/defer.tex | 1 + defer/rcufundamental.tex | 1 + defer/rcuusage.tex | 1 + defer/refcnt.tex | 1 + defer/toyrcu.tex | 9 +++++++++ formal/axiomatic.tex | 1 + formal/dyntickrcu.tex | 7 +++++++ formal/formal.tex | 1 + formal/ppcmem.tex | 1 + formal/spinhint.tex | 3 +++ future/cpu.tex | 1 + future/future.tex | 1 + intro/intro.tex | 1 + locking/locking-existence.tex | 1 + locking/locking.tex | 4 ++++ owned/owned.tex | 1 + rt/rt.tex | 4 ++++ together/applyrcu.tex | 4 ++++ together/together.tex | 1 + toolsoftrade/toolsoftrade.tex | 1 + 31 files changed, 66 insertions(+)
SMPdesign/SMPdesign.tex +1 -0
@@ -4,6 +4,7 @@ \epigraph{Divide and rule.}{\emph{Philip II of Macedon}} +\noindent This chapter describes how to design software to take advantage of the multiple CPUs that are increasingly appearing in commodity systems. It does this by presenting a number of idioms, or
SMPdesign/beyond.tex +1 -0
@@ -86,6 +86,7 @@ presents future directions and concluding remarks. \label{fig:SMPdesign:SEQ Pseudocode} \end{figure} +\noindent PWQ is based on SEQ, which is shown in Figure~\ref{fig:SMPdesign:SEQ Pseudocode} (\path{maze_seq.c}).
advsync/advsync.tex +1 -0
@@ -5,6 +5,7 @@ \epigraph{If a little knowledge is a dangerous thing, just imagine all the havoc you could wreak with a lot of knowledge!}{\emph{Unknown}} +\noindent This section discusses a number of ways of using weaker, and hopefully lower-cost, synchronization primitives. This weakening can be quite helpful, in fact, some have argued
appendix/primitives/primitives.tex +1 -0
@@ -2,6 +2,7 @@ \QuickQuizChapter{app:primitives:Synchronization Primitives}{Synchronization Primitives} +\noindent All but the simplest parallel programs require synchronization primitives. This appendix gives a quick overview of a set of primitives based
appendix/questions/questions.tex +1 -0
@@ -6,6 +6,7 @@ \epigraph{Ask me no questions, and I'll tell you no fibs.} {\emph{``She Stoops to Conquer'', Oliver Goldsmith}} +\noindent The following sections discuss some important questions relating to SMP programming. Each section also shows how to {\em avoid} having to worry about
appendix/questions/time.tex +1 -0
@@ -11,6 +11,7 @@ \ContributedBy{Figure}{fig:app:questions:What Time Is It?}{Melissa Broussard} \end{figure} +\noindent A key issue with timekeeping on multicore computer systems is illustrated by Figure~\ref{fig:app:questions:What Time Is It?}. One problem is that it takes time to read out the time.
appendix/whymb/whymemorybarriers.tex +1 -0
@@ -2,6 +2,7 @@ \QuickQuizChapter{chp:app:whymb:Why Memory Barriers?}{Why Memory Barriers?} +\noindent So what possessed CPU designers to cause them to inflict memory barriers on poor unsuspecting SMP software designers?
count/count.tex +7 -0
@@ -4,6 +4,7 @@ \epigraph{As easy as 1, 2, 3!}{\emph{Unknown}} +\noindent Counting is perhaps the simplest and most natural thing a computer can do. However, counting efficiently and scalably on a large shared-memory multiprocessor can be quite challenging.
@@ -187,6 +188,7 @@ are more appropriate for advanced students. \label{fig:count:Just Count!} \end{figure} +\noindent Let's start with something simple, for example, the straightforward use of arithmetic shown in Figure~\ref{fig:count:Just Count!} (\path{count_nonatomic.c}).
@@ -986,6 +988,7 @@ comes at the cost of the additional thread running \co{eventual()}. \label{fig:count:Per-Thread Statistical Counters} \end{figure} +\noindent Fortunately, gcc provides an \co{__thread} storage class that provides per-thread storage. This can be used as shown in
@@ -1412,6 +1415,7 @@ Section~\ref{sec:SMPdesign:Parallel Fastpath}. \label{fig:count:Simple Limit Counter Variable Relationships} \end{figure} +\noindent Figure~\ref{fig:count:Simple Limit Counter Variables} shows both the per-thread and global variables used by this implementation.
@@ -1944,6 +1948,7 @@ This task is undertaken in the next section. \label{fig:count:Approximate Limit Counter Balancing} \end{figure} +\noindent Because this implementation (\path{count_lim_app.c}) is quite similar to that in the previous section (Figures~\ref{fig:count:Simple Limit Counter Variables},
@@ -2580,6 +2585,7 @@ atomic operations are not necessary, as shown in the next section. \label{fig:count:Signal-Theft State Machine} \end{figure} +\noindent Even though per-thread state will now be manipulated only by the corresponding thread, there will still need to be synchronization with the signal handlers.
@@ -2695,6 +2701,7 @@ The slowpath then sets that thread's \co{theft} state to IDLE. \label{fig:count:Signal-Theft Limit Counter Data} \end{figure} +\noindent Figure~\ref{fig:count:Signal-Theft Limit Counter Data} (\path{count_lim_sig.c}) shows the data structures used by the signal-theft based counter
cpu/cpu.tex +1 -0
@@ -6,6 +6,7 @@ \epigraph{Premature abstraction is the root of all evil.} {\emph{A cast of thousands}} +\noindent Most people have an intuitive understanding that passing messages between systems is considerably more expensive than performing simple calculations within the confines of a single system.
datastruct/datastruct.tex +4 -0
@@ -6,6 +6,7 @@ about data structures and their relationships.} {\emph{Linus Torvalds}} +\noindent Efficient access to data is critically important, so that discussions of algorithms include time complexity of the related data structures~\cite{ThomasHCorman2001Algorithms}.
@@ -172,6 +173,7 @@ offers excellent scalability. \label{fig:datastruct:Hash-Table Data-Structure Diagram} \end{figure} +\noindent Figure~\ref{fig:datastruct:Hash-Table Data Structures} (\path{hash_bkt.c}) shows a set of data structures used in a simple fixed-sized hash
@@ -568,6 +570,7 @@ section~\cite{McKenney:2013:SDS:2483852.2483867}. \label{fig:datastruct:RCU-Protected Hash-Table Read-Side Concurrency Control} \end{figure} +\noindent For an RCU-protected hash table with per-bucket locking, updaters use locking exactly as described in Section~\ref{sec:datastruct:Partitionable Data Structures},
@@ -1055,6 +1058,7 @@ which is the subject of the next section. \label{fig:datastruct:Resizable Hash-Table Data Structures} \end{figure} +\noindent Resizing is accomplished by the classic approach of inserting a level of indirection, in this case, the \co{ht} structure shown on lines~12-25 of
debugging/debugging.tex +2 -0
@@ -4,6 +4,7 @@ \epigraph{If it is not tested, it doesn't work.}{\emph{Unknown}} +\noindent I have had a few parallel programs work the first time, but that is only because I have written a large number parallel programs over the past two decades.
@@ -2305,6 +2306,7 @@ detecting interference via measurement \ContributedBy{Figure}{fig:debugging:Choose Validation Methods Wisely}{Melissa Broussard} \end{figure} +\noindent Although validation never will be an exact science, much can be gained by taking an organized approach to it, as an organized approach will help you choose the right validation tools for your job, avoiding
defer/defer.tex +1 -0
@@ -5,6 +5,7 @@ \epigraph{All things come to those who wait.}{\emph{Violet Fane}} +\noindent The strategy of deferring work goes back before the dawn of recorded history. It has occasionally been derided as procrastination or even as sheer laziness.
defer/rcufundamental.tex +1 -0
@@ -93,6 +93,7 @@ summarizes RCU fundamentals. \label{fig:defer:Data Structure Publication (Unsafe)} \end{figure} +\noindent One key attribute of RCU is the ability to safely scan data, even though that data is being modified concurrently. To provide this ability for concurrent insertion,
defer/rcuusage.tex +1 -0
@@ -135,6 +135,7 @@ Section~\ref{sec:defer:RCU Usage Summary} provides a summary. \label{fig:defer:RCU Pre-BSD Routing Table Add/Delete} \end{figure} +\noindent Figures~\ref{fig:defer:RCU Pre-BSD Routing Table Lookup} and~\ref{fig:defer:RCU Pre-BSD Routing Table Add/Delete} show code for an RCU-protected Pre-BSD routing table
defer/refcnt.tex +1 -0
@@ -117,6 +117,7 @@ \label{fig:defer:Reference-Counted Pre-BSD Routing Table Add/Delete} \end{figure} +\noindent Reference counting tracks the number of references to a given object in order to prevent that object from being prematurely freed. As such, it has a long and honorable history of use dating back to
defer/toyrcu.tex +9 -0
@@ -59,6 +59,7 @@ provides a summary and a list of desirable RCU properties. \label{fig:defer:Lock-Based RCU Implementation} \end{figure} +\noindent Perhaps the simplest RCU implementation leverages locking, as shown in Figure~\ref{fig:defer:Lock-Based RCU Implementation}
@@ -201,6 +202,7 @@ in the next section. \label{fig:defer:Per-Thread Lock-Based RCU Implementation} \end{figure} +\noindent Figure~\ref{fig:defer:Per-Thread Lock-Based RCU Implementation} (\path{rcu_lock_percpu.h} and \path{rcu_lock_percpu.c}) shows an implementation based on one lock per thread.
@@ -324,6 +326,7 @@ the shortcomings of the lock-based implementation. \label{fig:defer:RCU Implementation Using Single Global Reference Counter} \end{figure} +\noindent A slightly more sophisticated RCU implementation is shown in Figure~\ref{fig:defer:RCU Implementation Using Single Global Reference Counter} (\path{rcu_rcg.h} and \path{rcu_rcg.c}).
@@ -492,6 +495,7 @@ scheme that is more favorable to writers. \label{fig:defer:RCU Read-Side Using Global Reference-Count Pair} \end{figure} +\noindent Figure~\ref{fig:defer:RCU Read-Side Using Global Reference-Count Pair} (\path{rcu_rcgp.h}) shows the read-side primitives of an RCU implementation that uses a pair
@@ -826,6 +830,7 @@ scheme that provides greatly improved read-side performance and scalability. \label{fig:defer:RCU Read-Side Using Per-Thread Reference-Count Pair} \end{figure} +\noindent Figure~\ref{fig:defer:RCU Read-Side Using Per-Thread Reference-Count Pair} (\path{rcu_rcpl.h}) shows the read-side primitives of an RCU implementation that uses per-thread
@@ -1033,6 +1038,7 @@ concurrent RCU updates. \label{fig:defer:RCU Read-Side Using Per-Thread Reference-Count Pair and Shared Update} \end{figure} +\noindent Figure~\ref{fig:defer:RCU Read-Side Using Per-Thread Reference-Count Pair and Shared Update} (\path{rcu_rcpls.h}) shows the read-side primitives for an RCU implementation using per-thread
@@ -1262,6 +1268,7 @@ thread-local accesses to one, as is done in the next section. \label{fig:defer:Free-Running Counter Using RCU} \end{figure} +\noindent Figure~\ref{fig:defer:Free-Running Counter Using RCU} (\path{rcu.h} and \path{rcu.c}) shows an RCU implementation based on a single global free-running counter
@@ -1463,6 +1470,7 @@ variables. \label{fig:defer:Nestable RCU Using a Free-Running Counter} \end{figure} +\noindent Figure~\ref{fig:defer:Nestable RCU Using a Free-Running Counter} (\path{rcu_nest.h} and \path{rcu_nest.c}) show an RCU implementation based on a single global free-running counter,
@@ -1730,6 +1738,7 @@ overhead. \label{fig:defer:Quiescent-State-Based RCU Read Side} \end{figure} +\noindent Figure~\ref{fig:defer:Quiescent-State-Based RCU Read Side} (\path{rcu_qs.h}) shows the read-side primitives used to construct a user-level
formal/axiomatic.tex +1 -0
@@ -31,6 +31,7 @@ \label{fig:formal:IRIW Litmus Test} \end{figure*} +\noindent Although the PPCMEM tool can solve the famous ``independent reads of independent writes'' (IRIW) litmus test shown in Figure~\ref{fig:formal:IRIW Litmus Test}, doing so requires no less than
formal/dyntickrcu.tex +7 -0
@@ -313,6 +313,7 @@ preemptible RCU's grace-period machinery. \label{fig:formal:Preemptible RCU State Machine} \end{figure} +\noindent Of the four preemptible RCU grace-period states shown in Figure~\ref{fig:formal:Preemptible RCU State Machine}, only the \co{rcu_try_flip_waitack_state()}
@@ -1796,6 +1797,7 @@ states, passing without errors. \label{fig:formal:Variable-Name-Typo Fix Patch} \end{figure} +\noindent This effort provided some lessons (re)learned: \begin{enumerate}
@@ -1876,6 +1878,7 @@ Manfred Spraul~\cite{ManfredSpraul2008StateMachineRCU}. \label{fig:formal:Variables for Simple Dynticks Interface} \end{figure} +\noindent Figure~\ref{fig:formal:Variables for Simple Dynticks Interface} shows the new per-CPU state variables. These variables are grouped into structs to allow multiple independent
@@ -1977,6 +1980,7 @@ passed through a quiescent state during that interval. \label{fig:formal:Entering and Exiting Dynticks-Idle Mode} \end{figure} +\noindent Figure~\ref{fig:formal:Entering and Exiting Dynticks-Idle Mode} shows the \co{rcu_enter_nohz()} and \co{rcu_exit_nohz()}, which enter and exit dynticks-idle mode, also known as ``nohz'' mode.
@@ -2034,6 +2038,7 @@ the opposite \co{dynticks} polarity. \label{fig:formal:NMIs From Dynticks-Idle Mode} \end{figure} +\noindent Figure~\ref{fig:formal:NMIs From Dynticks-Idle Mode} shows the \co{rcu_nmi_enter()} and \co{rcu_nmi_exit()} functions, which inform RCU of NMI entry and exit, respectively, from dynticks-idle
@@ -2089,6 +2094,7 @@ respectively. \label{fig:formal:Interrupts From Dynticks-Idle Mode} \end{figure} +\noindent Figure~\ref{fig:formal:Interrupts From Dynticks-Idle Mode} shows \co{rcu_irq_enter()} and \co{rcu_irq_exit()}, which inform RCU of entry to and exit from, respectively, irq context.
@@ -2146,6 +2152,7 @@ a reschedule API if so. \label{fig:formal:Saving Dyntick Progress Counters} \end{figure} +\noindent Figure~\ref{fig:formal:Saving Dyntick Progress Counters} shows \co{dyntick_save_progress_counter()}, which takes a snapshot of the specified CPU's \co{dynticks} and \co{dynticks_nmi}
formal/formal.tex +1 -0
@@ -8,6 +8,7 @@ \OriginallyPublished{Appendix}{chp:formal:Formal Verification}{Formal Verification}{Linux Weekly News}{PaulEMcKenney2007QRCUspin,PaulEMcKenney2008dynticksRCU,PaulEMcKenney2011ppcmem} +\noindent Parallel algorithms can be hard to write, and even harder to debug. Testing, though essential, is insufficient, as fatal race conditions can have extremely low probabilities of occurrence.
formal/ppcmem.tex +1 -0
@@ -85,6 +85,7 @@ discusses the implications. \label{fig:sec:formal:PPCMEM Litmus Test} \end{figure} +\noindent An example PowerPC litmus test for PPCMEM is shown in Figure~\ref{fig:sec:formal:PPCMEM Litmus Test}. The ARM interface works exactly the same way, but with ARM instructions
formal/spinhint.tex +3 -0
@@ -109,6 +109,7 @@ more complex uses. \label{fig:analysis:Promela Code for Non-Atomic Increment} \end{figure} +\noindent Figure~\ref{fig:analysis:Promela Code for Non-Atomic Increment} demonstrates the textbook race condition resulting from non-atomic increment.
@@ -337,6 +338,7 @@ unreached in proctype :init: \label{fig:analysis:Atomic Increment spin Output} \end{figure} +\noindent It is easy to fix this example by placing the body of the incrementer processes in an atomic blocks as shown in Figure~\ref{fig:analysis:Promela Code for Atomic Increment}.
@@ -632,6 +634,7 @@ Now we are ready for more complex examples. \label{fig:analysis:Promela Code for Spinlock} \end{figure} +\noindent Since locks are generally useful, \co{spin_lock()} and \co{spin_unlock()} macros are provided in \path{lock.h}, which may be included from
future/cpu.tex +1 -0
@@ -180,6 +180,7 @@ Servers seem to be choosing the former, while embedded systems on a chip \label{fig:future:Breakevens vs. r, Worst-Case lambda, Four CPUs} \end{figure} +\noindent And one more quote from 2004~\cite{PaulEdwardMcKenneyPhD}: \begin{quote}
future/future.tex +1 -0
@@ -6,6 +6,7 @@ \epigraph{Prediction is very difficult, especially about the future.} {\emph{Niels Bohr}} +\noindent This chapter presents some conflicting visions of the future of parallel programming. It is not clear which of these will come to pass, in fact, it is not
intro/intro.tex +1 -0
@@ -6,6 +6,7 @@ \epigraph{If parallel programming is so hard, why are there any parallel programs?}{\emph{Unknown}} +\noindent Parallel programming has earned a reputation as one of the most difficult areas a hacker can tackle. Papers and textbooks warn of the perils of deadlock, livelock,
locking/locking-existence.tex +1 -0
@@ -29,6 +29,7 @@ \label{fig:locking:Per-Element Locking Without Existence Guarantees} \end{figure} +\noindent A key challenge in parallel programming is to provide \emph{existence guarantees}~\cite{Gamsa99}, so that attempts to access a given object can rely on that object
locking/locking.tex +4 -0
@@ -8,6 +8,7 @@ to the memory of Winston Churchill and to whoever he was quoting}} +\noindent In recent concurrency research, the role of villain is often played by locking. In many papers and presentations,
@@ -531,6 +532,7 @@ this is unlikely. \label{fig:locking:Protocol Layering and Deadlock} \end{figure} +\noindent But suppose that there is no reasonable locking hierarchy. This can happen in real life, for example, in layered network protocol stacks where packets flow in both directions.
@@ -874,6 +876,7 @@ quite useful in many settings. \label{fig:locking:Abusing Conditional Locking} \end{figure} +\noindent Although conditional locking can be an effective deadlock-avoidance mechanism, it can be abused. Consider for example the beautifully symmetric example shown in
@@ -1649,6 +1652,7 @@ environments. \label{fig:locking:Sample Lock Based on Atomic Exchange} \end{figure} +\noindent This section reviews the implementation shown in Figure~\ref{fig:locking:Sample Lock Based on Atomic Exchange}. The data structure for this lock is just an \co{int}, as shown on
owned/owned.tex +1 -0
@@ -5,6 +5,7 @@ \epigraph{It is mine, I tell you. My own. My precious. Yes, my precious.} {\emph{Gollum in ``The Fellowship of the Ring'', J.R.R.~Tolkien}} +\noindent One of the simplest ways to avoid the synchronization overhead that comes with locking is to parcel the data out among the threads (or, in the case of kernels, CPUs)
rt/rt.tex +4 -0
@@ -5,6 +5,7 @@ \epigraph{The difference between you and me is that I was right in time.} {\emph{Konrad Adenauer}} +\noindent An important emerging area in computing is that of parallel real-time computing. Section~\ref{sec:rt:What is Real-Time Computing?}
@@ -80,6 +81,7 @@ some measure of exactly how soft it is. \ContributedBy{Figure}{fig:rt:Hard Real-Time Response Guarantee, Meet Hammer}{Melissa Broussard} \end{figure} +\noindent In contrast, the definition of hard real time is quite definite. After all, a given system either always meets its deadlines or it doesn't.
@@ -685,6 +687,7 @@ the next section. \label{fig:rt:Linux Ported to RTOS} \end{figure} +\noindent There are a number of strategies that may be used to implement a real-time system. One approach is to port a general-purpose non-real-time OS on top
@@ -1882,6 +1885,7 @@ data-structure access to real-time programs. \ContributedBy{Figure}{fig:rt:The Dark Side of Real-Fast Computing}{Sarah McKenney} \end{figure} +\noindent The choice between real-time and real-fast computing can be a difficult one. Because real-time systems often inflict a throughput penalty on non-real-time computing, using real-time when it is not required can cause problems,
together/applyrcu.tex +4 -0
@@ -189,6 +189,7 @@ held constant, ensuring that \co{read_count()} sees consistent data. \label{fig:together:RCU and Per-Thread Statistical Counters} \end{figure} +\noindent Lines~1-4 of Figure~\ref{fig:together:RCU and Per-Thread Statistical Counters} show the \co{countarray} structure, which contains a
@@ -306,6 +307,7 @@ Line~69 can then safely free the old \co{countarray} structure. Figure~\ref{fig:together:RCU and Per-Thread Statistical Counters}! } \QuickQuizEnd +\noindent Use of RCU enables exiting threads to wait until other threads are guaranteed to be done using the exiting threads' \co{__thread} variables. This allows the \co{read_count()} function to dispense with locking,
@@ -404,6 +406,7 @@ tradeoff. \label{fig:together:RCU-Protected Variable-Length Array} \end{figure} +\noindent Suppose we have an RCU-protected variable-length array, as shown in Figure~\ref{fig:together:RCU-Protected Variable-Length Array}. The length of the array \co{->a[]} can change dynamically, and at any
@@ -499,6 +502,7 @@ A more general version of this approach is presented in the next section. \label{fig:together:Uncorrelated Measurement Fields} \end{figure} +\noindent Suppose that each of Sch\"odinger's animals is represented by the data element shown in Figure~\ref{fig:together:Uncorrelated Measurement Fields}.
together/together.tex +1 -0
@@ -10,6 +10,7 @@ % And the paragraph preceding this is also instructive: % ``I may be pissed off, but that doesn't mean I can't learn. +\noindent This chapter gives a few hints on handling some concurrent-programming puzzles, starting with counter conundrums in Section~\ref{sec:together:Counter Conundrums},
toolsoftrade/toolsoftrade.tex +1 -0
@@ -5,6 +5,7 @@ \epigraph{You are only as good as your tools, and your tools are only as good as you are.}{\emph{Unknown}} +\noindent This chapter provides a brief introduction to some basic tools of the parallel-programming trade, focusing mainly on those available to user applications running on operating systems similar to Linux.
Signature · 1 line
1.9.1
Quoted 9 lines · Akira Yokosawa
Quoted 1 line
From
e11254e95c6d33eaf999a1e1c4831af2e141fb91Mon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Sun, 4 Sep 2016 08:01:50 +0900
Subject: [PATCH] treewide: Add \noindent where necessarySince commit
213f584cd55b("Add a few epigraphs") and following commits, implicit no-indentation of first paragraph of a Chapter has been lost.
Quoted 6 lines
This commit adds explicit "\noindent" after \epigraph{}s.
It also adds "\noindent" where some environment is used just after "\section{}", "subsection{}", or "subsubsection{}.
Signed-off-by Akira Yokosawa <[email protected]>
Good eyes! I honestly had not noticed.
But wouldn't it make more sense to fix the epigraph package? For that matter, what exactly are the rules regarding epigraphs and indentation of first paragraphs and chapters?
Thanxx, Paul
Quoted 689 lines
--- SMPdesign/SMPdesign.tex | 1 + SMPdesign/beyond.tex | 1 + advsync/advsync.tex | 1 + appendix/primitives/primitives.tex | 1 + appendix/questions/questions.tex | 1 + appendix/questions/time.tex | 1 + appendix/whymb/whymemorybarriers.tex | 1 + count/count.tex | 7 +++++++ cpu/cpu.tex | 1 + datastruct/datastruct.tex | 4 ++++ debugging/debugging.tex | 2 ++ defer/defer.tex | 1 + defer/rcufundamental.tex | 1 + defer/rcuusage.tex | 1 + defer/refcnt.tex | 1 + defer/toyrcu.tex | 9 +++++++++ formal/axiomatic.tex | 1 + formal/dyntickrcu.tex | 7 +++++++ formal/formal.tex | 1 + formal/ppcmem.tex | 1 + formal/spinhint.tex | 3 +++ future/cpu.tex | 1 + future/future.tex | 1 + intro/intro.tex | 1 + locking/locking-existence.tex | 1 + locking/locking.tex | 4 ++++ owned/owned.tex | 1 + rt/rt.tex | 4 ++++ together/applyrcu.tex | 4 ++++ together/together.tex | 1 + toolsoftrade/toolsoftrade.tex | 1 + 31 files changed, 66 insertions(+)SMPdesign/SMPdesign.tex +1
-0@@ -4,6 +4,7 @@ \epigraph{Divide and rule.}{\emph{Philip II of Macedon}} +\noindent This chapter describes how to design software to take advantage of the multiple CPUs that are increasingly appearing in commodity systems. It does this by presenting a number of idioms, orSMPdesign/beyond.tex +1
-0@@ -86,6 +86,7 @@ presents future directions and concluding remarks. \label{fig:SMPdesign:SEQ Pseudocode} \end{figure} +\noindent PWQ is based on SEQ, which is shown in Figure~\ref{fig:SMPdesign:SEQ Pseudocode} (\path{maze_seq.c}).advsync/advsync.tex +1
-0@@ -5,6 +5,7 @@ \epigraph{If a little knowledge is a dangerous thing, just imagine all the havoc you could wreak with a lot of knowledge!}{\emph{Unknown}} +\noindent This section discusses a number of ways of using weaker, and hopefully lower-cost, synchronization primitives. This weakening can be quite helpful, in fact, some have arguedappendix/primitives/primitives.tex +1
-0@@ -2,6 +2,7 @@ \QuickQuizChapter{app:primitives:Synchronization Primitives}{Synchronization Primitives} +\noindent All but the simplest parallel programs require synchronization primitives. This appendix gives a quick overview of a set of primitives basedappendix/questions/questions.tex +1
-0@@ -6,6 +6,7 @@ \epigraph{Ask me no questions, and I'll tell you no fibs.} {\emph{``She Stoops to Conquer'', Oliver Goldsmith}} +\noindent The following sections discuss some important questions relating to SMP programming. Each section also shows how to {\em avoid} having to worry aboutappendix/questions/time.tex +1
-0@@ -11,6 +11,7 @@ \ContributedBy{Figure}{fig:app:questions:What Time Is It?}{Melissa Broussard} \end{figure} +\noindent A key issue with timekeeping on multicore computer systems is illustrated by Figure~\ref{fig:app:questions:What Time Is It?}. One problem is that it takes time to read out the time.appendix/whymb/whymemorybarriers.tex +1
-0@@ -2,6 +2,7 @@ \QuickQuizChapter{chp:app:whymb:Why Memory Barriers?}{Why Memory Barriers?} +\noindent So what possessed CPU designers to cause them to inflict memory barriers on poor unsuspecting SMP software designers?count/count.tex +7
-0@@ -4,6 +4,7 @@ \epigraph{As easy as 1, 2, 3!}{\emph{Unknown}} +\noindent Counting is perhaps the simplest and most natural thing a computer can do. However, counting efficiently and scalably on a large shared-memory multiprocessor can be quite challenging.@@ -187,6 +188,7 @@ are more appropriate for advanced students. \label{fig:count:Just Count!} \end{figure} +\noindent Let's start with something simple, for example, the straightforward use of arithmetic shown in Figure~\ref{fig:count:Just Count!} (\path{count_nonatomic.c}).@@ -986,6 +988,7 @@ comes at the cost of the additional thread running \co{eventual()}. \label{fig:count:Per-Thread Statistical Counters} \end{figure} +\noindent Fortunately, gcc provides an \co{__thread} storage class that provides per-thread storage. This can be used as shown in@@ -1412,6 +1415,7 @@ Section~\ref{sec:SMPdesign:Parallel Fastpath}. \label{fig:count:Simple Limit Counter Variable Relationships} \end{figure} +\noindent Figure~\ref{fig:count:Simple Limit Counter Variables} shows both the per-thread and global variables used by this implementation.@@ -1944,6 +1948,7 @@ This task is undertaken in the next section. \label{fig:count:Approximate Limit Counter Balancing} \end{figure} +\noindent Because this implementation (\path{count_lim_app.c}) is quite similar to that in the previous section (Figures~\ref{fig:count:Simple Limit Counter Variables},@@ -2580,6 +2585,7 @@ atomic operations are not necessary, as shown in the next section. \label{fig:count:Signal-Theft State Machine} \end{figure} +\noindent Even though per-thread state will now be manipulated only by the corresponding thread, there will still need to be synchronization with the signal handlers.@@ -2695,6 +2701,7 @@ The slowpath then sets that thread's \co{theft} state to IDLE. \label{fig:count:Signal-Theft Limit Counter Data} \end{figure} +\noindent Figure~\ref{fig:count:Signal-Theft Limit Counter Data} (\path{count_lim_sig.c}) shows the data structures used by the signal-theft based countercpu/cpu.tex +1
-0@@ -6,6 +6,7 @@ \epigraph{Premature abstraction is the root of all evil.} {\emph{A cast of thousands}} +\noindent Most people have an intuitive understanding that passing messages between systems is considerably more expensive than performing simple calculations within the confines of a single system.datastruct/datastruct.tex +4
-0@@ -6,6 +6,7 @@ about data structures and their relationships.} {\emph{Linus Torvalds}} +\noindent Efficient access to data is critically important, so that discussions of algorithms include time complexity of the related data structures~\cite{ThomasHCorman2001Algorithms}.@@ -172,6 +173,7 @@ offers excellent scalability. \label{fig:datastruct:Hash-Table Data-Structure Diagram} \end{figure} +\noindent Figure~\ref{fig:datastruct:Hash-Table Data Structures} (\path{hash_bkt.c}) shows a set of data structures used in a simple fixed-sized hash@@ -568,6 +570,7 @@ section~\cite{McKenney:2013:SDS:2483852.2483867}. \label{fig:datastruct:RCU-Protected Hash-Table Read-Side Concurrency Control} \end{figure} +\noindent For an RCU-protected hash table with per-bucket locking, updaters use locking exactly as described in Section~\ref{sec:datastruct:Partitionable Data Structures},@@ -1055,6 +1058,7 @@ which is the subject of the next section. \label{fig:datastruct:Resizable Hash-Table Data Structures} \end{figure} +\noindent Resizing is accomplished by the classic approach of inserting a level of indirection, in this case, the \co{ht} structure shown on lines~12-25 ofdebugging/debugging.tex +2
-0@@ -4,6 +4,7 @@ \epigraph{If it is not tested, it doesn't work.}{\emph{Unknown}} +\noindent I have had a few parallel programs work the first time, but that is only because I have written a large number parallel programs over the past two decades.@@ -2305,6 +2306,7 @@ detecting interference via measurement \ContributedBy{Figure}{fig:debugging:Choose Validation Methods Wisely}{Melissa Broussard} \end{figure} +\noindent Although validation never will be an exact science, much can be gained by taking an organized approach to it, as an organized approach will help you choose the right validation tools for your job, avoidingdefer/defer.tex +1
-0@@ -5,6 +5,7 @@ \epigraph{All things come to those who wait.}{\emph{Violet Fane}} +\noindent The strategy of deferring work goes back before the dawn of recorded history. It has occasionally been derided as procrastination or even as sheer laziness.defer/rcufundamental.tex +1
-0@@ -93,6 +93,7 @@ summarizes RCU fundamentals. \label{fig:defer:Data Structure Publication (Unsafe)} \end{figure} +\noindent One key attribute of RCU is the ability to safely scan data, even though that data is being modified concurrently. To provide this ability for concurrent insertion,defer/rcuusage.tex +1
-0@@ -135,6 +135,7 @@ Section~\ref{sec:defer:RCU Usage Summary} provides a summary. \label{fig:defer:RCU Pre-BSD Routing Table Add/Delete} \end{figure} +\noindent Figures~\ref{fig:defer:RCU Pre-BSD Routing Table Lookup} and~\ref{fig:defer:RCU Pre-BSD Routing Table Add/Delete} show code for an RCU-protected Pre-BSD routing tabledefer/refcnt.tex +1
-0@@ -117,6 +117,7 @@ \label{fig:defer:Reference-Counted Pre-BSD Routing Table Add/Delete} \end{figure} +\noindent Reference counting tracks the number of references to a given object in order to prevent that object from being prematurely freed. As such, it has a long and honorable history of use dating back todefer/toyrcu.tex +9
-0@@ -59,6 +59,7 @@ provides a summary and a list of desirable RCU properties. \label{fig:defer:Lock-Based RCU Implementation} \end{figure} +\noindent Perhaps the simplest RCU implementation leverages locking, as shown in Figure~\ref{fig:defer:Lock-Based RCU Implementation}@@ -201,6 +202,7 @@ in the next section. \label{fig:defer:Per-Thread Lock-Based RCU Implementation} \end{figure} +\noindent Figure~\ref{fig:defer:Per-Thread Lock-Based RCU Implementation} (\path{rcu_lock_percpu.h} and \path{rcu_lock_percpu.c}) shows an implementation based on one lock per thread.@@ -324,6 +326,7 @@ the shortcomings of the lock-based implementation. \label{fig:defer:RCU Implementation Using Single Global Reference Counter} \end{figure} +\noindent A slightly more sophisticated RCU implementation is shown in Figure~\ref{fig:defer:RCU Implementation Using Single Global Reference Counter} (\path{rcu_rcg.h} and \path{rcu_rcg.c}).@@ -492,6 +495,7 @@ scheme that is more favorable to writers. \label{fig:defer:RCU Read-Side Using Global Reference-Count Pair} \end{figure} +\noindent Figure~\ref{fig:defer:RCU Read-Side Using Global Reference-Count Pair} (\path{rcu_rcgp.h}) shows the read-side primitives of an RCU implementation that uses a pair@@ -826,6 +830,7 @@ scheme that provides greatly improved read-side performance and scalability. \label{fig:defer:RCU Read-Side Using Per-Thread Reference-Count Pair} \end{figure} +\noindent Figure~\ref{fig:defer:RCU Read-Side Using Per-Thread Reference-Count Pair} (\path{rcu_rcpl.h}) shows the read-side primitives of an RCU implementation that uses per-thread@@ -1033,6 +1038,7 @@ concurrent RCU updates. \label{fig:defer:RCU Read-Side Using Per-Thread Reference-Count Pair and Shared Update} \end{figure} +\noindent Figure~\ref{fig:defer:RCU Read-Side Using Per-Thread Reference-Count Pair and Shared Update} (\path{rcu_rcpls.h}) shows the read-side primitives for an RCU implementation using per-thread@@ -1262,6 +1268,7 @@ thread-local accesses to one, as is done in the next section. \label{fig:defer:Free-Running Counter Using RCU} \end{figure} +\noindent Figure~\ref{fig:defer:Free-Running Counter Using RCU} (\path{rcu.h} and \path{rcu.c}) shows an RCU implementation based on a single global free-running counter@@ -1463,6 +1470,7 @@ variables. \label{fig:defer:Nestable RCU Using a Free-Running Counter} \end{figure} +\noindent Figure~\ref{fig:defer:Nestable RCU Using a Free-Running Counter} (\path{rcu_nest.h} and \path{rcu_nest.c}) show an RCU implementation based on a single global free-running counter,@@ -1730,6 +1738,7 @@ overhead. \label{fig:defer:Quiescent-State-Based RCU Read Side} \end{figure} +\noindent Figure~\ref{fig:defer:Quiescent-State-Based RCU Read Side} (\path{rcu_qs.h}) shows the read-side primitives used to construct a user-levelformal/axiomatic.tex +1
-0@@ -31,6 +31,7 @@ \label{fig:formal:IRIW Litmus Test} \end{figure*} +\noindent Although the PPCMEM tool can solve the famous ``independent reads of independent writes'' (IRIW) litmus test shown in Figure~\ref{fig:formal:IRIW Litmus Test}, doing so requires no less thanformal/dyntickrcu.tex +7
-0@@ -313,6 +313,7 @@ preemptible RCU's grace-period machinery. \label{fig:formal:Preemptible RCU State Machine} \end{figure} +\noindent Of the four preemptible RCU grace-period states shown in Figure~\ref{fig:formal:Preemptible RCU State Machine}, only the \co{rcu_try_flip_waitack_state()}@@ -1796,6 +1797,7 @@ states, passing without errors. \label{fig:formal:Variable-Name-Typo Fix Patch} \end{figure} +\noindent This effort provided some lessons (re)learned: \begin{enumerate}@@ -1876,6 +1878,7 @@ Manfred Spraul~\cite{ManfredSpraul2008StateMachineRCU}. \label{fig:formal:Variables for Simple Dynticks Interface} \end{figure} +\noindent Figure~\ref{fig:formal:Variables for Simple Dynticks Interface} shows the new per-CPU state variables. These variables are grouped into structs to allow multiple independent@@ -1977,6 +1980,7 @@ passed through a quiescent state during that interval. \label{fig:formal:Entering and Exiting Dynticks-Idle Mode} \end{figure} +\noindent Figure~\ref{fig:formal:Entering and Exiting Dynticks-Idle Mode} shows the \co{rcu_enter_nohz()} and \co{rcu_exit_nohz()}, which enter and exit dynticks-idle mode, also known as ``nohz'' mode.@@ -2034,6 +2038,7 @@ the opposite \co{dynticks} polarity. \label{fig:formal:NMIs From Dynticks-Idle Mode} \end{figure} +\noindent Figure~\ref{fig:formal:NMIs From Dynticks-Idle Mode} shows the \co{rcu_nmi_enter()} and \co{rcu_nmi_exit()} functions, which inform RCU of NMI entry and exit, respectively, from dynticks-idle@@ -2089,6 +2094,7 @@ respectively. \label{fig:formal:Interrupts From Dynticks-Idle Mode} \end{figure} +\noindent Figure~\ref{fig:formal:Interrupts From Dynticks-Idle Mode} shows \co{rcu_irq_enter()} and \co{rcu_irq_exit()}, which inform RCU of entry to and exit from, respectively, irq context.@@ -2146,6 +2152,7 @@ a reschedule API if so. \label{fig:formal:Saving Dyntick Progress Counters} \end{figure} +\noindent Figure~\ref{fig:formal:Saving Dyntick Progress Counters} shows \co{dyntick_save_progress_counter()}, which takes a snapshot of the specified CPU's \co{dynticks} and \co{dynticks_nmi}formal/formal.tex +1
-0@@ -8,6 +8,7 @@ \OriginallyPublished{Appendix}{chp:formal:Formal Verification}{Formal Verification}{Linux Weekly News}{PaulEMcKenney2007QRCUspin,PaulEMcKenney2008dynticksRCU,PaulEMcKenney2011ppcmem} +\noindent Parallel algorithms can be hard to write, and even harder to debug. Testing, though essential, is insufficient, as fatal race conditions can have extremely low probabilities of occurrence.formal/ppcmem.tex +1
-0@@ -85,6 +85,7 @@ discusses the implications. \label{fig:sec:formal:PPCMEM Litmus Test} \end{figure} +\noindent An example PowerPC litmus test for PPCMEM is shown in Figure~\ref{fig:sec:formal:PPCMEM Litmus Test}. The ARM interface works exactly the same way, but with ARM instructionsformal/spinhint.tex +3
-0@@ -109,6 +109,7 @@ more complex uses. \label{fig:analysis:Promela Code for Non-Atomic Increment} \end{figure} +\noindent Figure~\ref{fig:analysis:Promela Code for Non-Atomic Increment} demonstrates the textbook race condition resulting from non-atomic increment.@@ -337,6 +338,7 @@ unreached in proctype :init: \label{fig:analysis:Atomic Increment spin Output} \end{figure} +\noindent It is easy to fix this example by placing the body of the incrementer processes in an atomic blocks as shown in Figure~\ref{fig:analysis:Promela Code for Atomic Increment}.@@ -632,6 +634,7 @@ Now we are ready for more complex examples. \label{fig:analysis:Promela Code for Spinlock} \end{figure} +\noindent Since locks are generally useful, \co{spin_lock()} and \co{spin_unlock()} macros are provided in \path{lock.h}, which may be included fromfuture/cpu.tex +1
-0@@ -180,6 +180,7 @@ Servers seem to be choosing the former, while embedded systems on a chip \label{fig:future:Breakevens vs. r, Worst-Case lambda, Four CPUs} \end{figure} +\noindent And one more quote from 2004~\cite{PaulEdwardMcKenneyPhD}: \begin{quote}future/future.tex +1
-0@@ -6,6 +6,7 @@ \epigraph{Prediction is very difficult, especially about the future.} {\emph{Niels Bohr}} +\noindent This chapter presents some conflicting visions of the future of parallel programming. It is not clear which of these will come to pass, in fact, it is notintro/intro.tex +1
-0@@ -6,6 +6,7 @@ \epigraph{If parallel programming is so hard, why are there any parallel programs?}{\emph{Unknown}} +\noindent Parallel programming has earned a reputation as one of the most difficult areas a hacker can tackle. Papers and textbooks warn of the perils of deadlock, livelock,locking/locking-existence.tex +1
-0@@ -29,6 +29,7 @@ \label{fig:locking:Per-Element Locking Without Existence Guarantees} \end{figure} +\noindent A key challenge in parallel programming is to provide \emph{existence guarantees}~\cite{Gamsa99}, so that attempts to access a given object can rely on that objectlocking/locking.tex +4
-0@@ -8,6 +8,7 @@ to the memory of Winston Churchill and to whoever he was quoting}} +\noindent In recent concurrency research, the role of villain is often played by locking. In many papers and presentations,@@ -531,6 +532,7 @@ this is unlikely. \label{fig:locking:Protocol Layering and Deadlock} \end{figure} +\noindent But suppose that there is no reasonable locking hierarchy. This can happen in real life, for example, in layered network protocol stacks where packets flow in both directions.@@ -874,6 +876,7 @@ quite useful in many settings. \label{fig:locking:Abusing Conditional Locking} \end{figure} +\noindent Although conditional locking can be an effective deadlock-avoidance mechanism, it can be abused. Consider for example the beautifully symmetric example shown in@@ -1649,6 +1652,7 @@ environments. \label{fig:locking:Sample Lock Based on Atomic Exchange} \end{figure} +\noindent This section reviews the implementation shown in Figure~\ref{fig:locking:Sample Lock Based on Atomic Exchange}. The data structure for this lock is just an \co{int}, as shown onowned/owned.tex +1
-0@@ -5,6 +5,7 @@ \epigraph{It is mine, I tell you. My own. My precious. Yes, my precious.} {\emph{Gollum in ``The Fellowship of the Ring'', J.R.R.~Tolkien}} +\noindent One of the simplest ways to avoid the synchronization overhead that comes with locking is to parcel the data out among the threads (or, in the case of kernels, CPUs)rt/rt.tex +4
-0@@ -5,6 +5,7 @@ \epigraph{The difference between you and me is that I was right in time.} {\emph{Konrad Adenauer}} +\noindent An important emerging area in computing is that of parallel real-time computing. Section~\ref{sec:rt:What is Real-Time Computing?}@@ -80,6 +81,7 @@ some measure of exactly how soft it is. \ContributedBy{Figure}{fig:rt:Hard Real-Time Response Guarantee, Meet Hammer}{Melissa Broussard} \end{figure} +\noindent In contrast, the definition of hard real time is quite definite. After all, a given system either always meets its deadlines or it doesn't.@@ -685,6 +687,7 @@ the next section. \label{fig:rt:Linux Ported to RTOS} \end{figure} +\noindent There are a number of strategies that may be used to implement a real-time system. One approach is to port a general-purpose non-real-time OS on top@@ -1882,6 +1885,7 @@ data-structure access to real-time programs. \ContributedBy{Figure}{fig:rt:The Dark Side of Real-Fast Computing}{Sarah McKenney} \end{figure} +\noindent The choice between real-time and real-fast computing can be a difficult one. Because real-time systems often inflict a throughput penalty on non-real-time computing, using real-time when it is not required can cause problems,together/applyrcu.tex +4
-0@@ -189,6 +189,7 @@ held constant, ensuring that \co{read_count()} sees consistent data. \label{fig:together:RCU and Per-Thread Statistical Counters} \end{figure} +\noindent Lines~1-4 of Figure~\ref{fig:together:RCU and Per-Thread Statistical Counters} show the \co{countarray} structure, which contains a@@ -306,6 +307,7 @@ Line~69 can then safely free the old \co{countarray} structure. Figure~\ref{fig:together:RCU and Per-Thread Statistical Counters}! } \QuickQuizEnd +\noindent Use of RCU enables exiting threads to wait until other threads are guaranteed to be done using the exiting threads' \co{__thread} variables. This allows the \co{read_count()} function to dispense with locking,@@ -404,6 +406,7 @@ tradeoff. \label{fig:together:RCU-Protected Variable-Length Array} \end{figure} +\noindent Suppose we have an RCU-protected variable-length array, as shown in Figure~\ref{fig:together:RCU-Protected Variable-Length Array}. The length of the array \co{->a[]} can change dynamically, and at any@@ -499,6 +502,7 @@ A more general version of this approach is presented in the next section. \label{fig:together:Uncorrelated Measurement Fields} \end{figure} +\noindent Suppose that each of Sch\"odinger's animals is represented by the data element shown in Figure~\ref{fig:together:Uncorrelated Measurement Fields}.together/together.tex +1
-0@@ -10,6 +10,7 @@ % And the paragraph preceding this is also instructive: % ``I may be pissed off, but that doesn't mean I can't learn. +\noindent This chapter gives a few hints on handling some concurrent-programming puzzles, starting with counter conundrums in Section~\ref{sec:together:Counter Conundrums},toolsoftrade/toolsoftrade.tex +1
-0@@ -5,6 +5,7 @@ \epigraph{You are only as good as your tools, and your tools are only as good as you are.}{\emph{Unknown}} +\noindent This chapter provides a brief introduction to some basic tools of the parallel-programming trade, focusing mainly on those available to user applications running on operating systems similar to Linux.Signature · 1 line
1.9.1
Quoted 10 lines · Paul E. McKenney
Quoted 9 lines · Akira Yokosawa
Quoted 1 line
From
e11254e95c6d33eaf999a1e1c4831af2e141fb91Mon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Sun, 4 Sep 2016 08:01:50 +0900
Subject: [PATCH] treewide: Add \noindent where necessarySince commit
213f584cd55b("Add a few epigraphs") and following commits, implicit no-indentation of first paragraph of a Chapter has been lost.
Quoted 8 lines
Quoted 6 lines
This commit adds explicit "\noindent" after \epigraph{}s.
It also adds "\noindent" where some environment is used just after "\section{}", "subsection{}", or "subsubsection{}.
Signed-off-by Akira Yokosawa <[email protected]>Good eyes! I honestly had not noticed.
Well, now I know why. In the two-column layout, there was no change in indentation of the first paragraph of a chapter...
I suppose you mostly see the two-column layout so it's natural you didn't see any difference.
I don't know why, but when you specify "twocolumn" option to the "book" documentclass, the first paragraph of a chapter *is* indented.
I noticed the difference in perfbook-1c.pdf first, and wrongly assumed it was also the case in two-column layout.
Sorry for my confusion.
I have no idea if the behavior of twocolumn option is intended or not.
So the addition of epigraphs actually made the indentation consistent in both two-column and one-column layout.
I can resubmit a patch that only changes at the first paragraphs of sections.
Quoted 4 lines
But wouldn't it make more sense to fix the epigraph package? For that matter, what exactly are the rules regarding epigraphs and indentation of first paragraphs and chapters?
\epigraph{} command does have this side-effect in one-column layout. I found several examples where people use \noindent after \epigraph{}, but there seems to be no strong rules here.
So just doing consistently can be said of as the rule. It's the editor's call, I think.
Thanks.
Quoted 2 lines
Thanxx, Paul
[snip]
Quoted 46 lines · Akira Yokosawa
Quoted 10 lines · Paul E. McKenney
Quoted 9 lines · Akira Yokosawa
Quoted 1 line
From
e11254e95c6d33eaf999a1e1c4831af2e141fb91Mon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Sun, 4 Sep 2016 08:01:50 +0900
Subject: [PATCH] treewide: Add \noindent where necessarySince commit
213f584cd55b("Add a few epigraphs") and following commits, implicit no-indentation of first paragraph of a Chapter has been lost.Quoted 8 lines
Quoted 6 lines
This commit adds explicit "\noindent" after \epigraph{}s.
It also adds "\noindent" where some environment is used just after "\section{}", "subsection{}", or "subsubsection{}.
Signed-off-by Akira Yokosawa <[email protected]>Good eyes! I honestly had not noticed.
Well, now I know why. In the two-column layout, there was no change in indentation of the first paragraph of a chapter...
I suppose you mostly see the two-column layout so it's natural you didn't see any difference.I don't know why, but when you specify "twocolumn" option to the "book" documentclass, the first paragraph of a chapter *is* indented.
I noticed the difference in perfbook-1c.pdf first, and wrongly assumed it was also the case in two-column layout.
Sorry for my confusion.
I have no idea if the behavior of twocolumn option is intended or not.
So the addition of epigraphs actually made the indentation consistent in both two-column and one-column layout.
I can resubmit a patch that only changes at the first paragraphs of sections.
Quoted 4 lines
But wouldn't it make more sense to fix the epigraph package? For that matter, what exactly are the rules regarding epigraphs and indentation of first paragraphs and chapters?
Quoted 6 lines
\epigraph{} command does have this side-effect in one-column layout. I found several examples where people use \noindent after \epigraph{}, but there seems to be no strong rules here.
So just doing consistently can be said of as the rule. It's the editor's call, I think.
When there is no clear rule, as in this case, we should let the tool (in this case, LaTeX) be our guide. ;-)
Thanx, Paul