* [PATCH 1/3] locking: Add missed unbreakable spaces
@ 2018-07-17 0:34 SeongJae Park
2018-07-17 0:34 ` [PATCH 2/3] locking: Fix wrong line number SeongJae Park
2018-07-17 0:34 ` [PATCH 3/3] locking: Fix a typo, 'a another' SeongJae Park
0 siblings, 2 replies; 3+ messages in thread
From: SeongJae Park @ 2018-07-17 0:34 UTC (permalink / raw)
To: paulmck; +Cc: perfbook, SeongJae Park
This commit adds missed unbreakable spaces for lock names, line numbers,
and CPU numbers.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
locking/locking.tex | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/locking/locking.tex b/locking/locking.tex
index 33dad9e..467208a 100644
--- a/locking/locking.tex
+++ b/locking/locking.tex
@@ -124,7 +124,7 @@ We can create a directed-graph representation of a deadlock scenario
with nodes for threads and locks, as shown in
Figure~\ref{fig:locking:Deadlock Cycle}.
An arrow from a lock to a thread indicates that the thread holds
-the lock, for example, Thread~B holds Locks~2 and 4.
+the lock, for example, Thread~B holds Locks~2 and~4.
An arrow from a thread to a lock indicates that the thread is waiting
on the lock, for example, Thread~B is waiting on Lock~3.
@@ -303,7 +303,7 @@ To see the benefits of local locking hierarchies, compare
Figures~\ref{fig:lock:Without Local Locking Hierarchy for qsort()} and
\ref{fig:lock:Local Locking Hierarchy for qsort()}.
In both figures, application functions \co{foo()} and \co{bar()}
-invoke \co{qsort()} while holding Locks~A and B, respectively.
+invoke \co{qsort()} while holding Locks~A and~B, respectively.
Because this is a parallel implementation of \co{qsort()}, it acquires
Lock~C.
Function \co{foo()} passes function \co{cmp()} to \co{qsort()},
@@ -353,9 +353,9 @@ releasing all locks before invoking unknown code.
However, we can instead construct a layered locking hierarchy, as shown in
Figure~\ref{fig:lock:Layered Locking Hierarchy for qsort()}.
here, the \co{cmp()} function uses a new Lock~D that is acquired after
-all of Locks~A, B, and C, avoiding deadlock.
+all of Locks~A, B, and~C, avoiding deadlock.
we therefore have three layers to the global deadlock hierarchy, the
-first containing Locks~A and B, the second containing Lock~C, and
+first containing Locks~A and~B, the second containing Lock~C, and
the third containing Lock~D.
\begin{listing}[tbp]
@@ -584,7 +584,7 @@ This primitive acquires the lock immediately if the lock is available
If \co{spin_trylock()} was successful, line~15 does the needed
layer-1 processing.
-Otherwise, line~6 releases the lock, and lines~7 and 8 acquire them in
+Otherwise, line~6 releases the lock, and lines~7 and~8 acquire them in
the correct order.
Unfortunately, there might be multiple networking devices on
the system (e.g., Ethernet and WiFi), so that the \co{layer_1()}
@@ -1024,12 +1024,12 @@ This can happen on machines with shared caches or NUMA characteristics,
for example, as shown in
Figure~\ref{fig:lock:System Architecture and Lock Unfairness}.
If CPU~0 releases a lock that all the other CPUs are attempting
-to acquire, the interconnect shared between CPUs~0 and 1 means that
+to acquire, the interconnect shared between CPUs~0 and~1 means that
CPU~1 will have an advantage over CPUs~2-7.
Therefore CPU~1 will likely acquire the lock.
If CPU~1 hold the lock long enough for CPU~0 to be requesting the
lock by the time CPU~1 releases it and vice versa, the lock can
-shuttle between CPUs~0 and 1, bypassing CPUs~2-7.
+shuttle between CPUs~0 and~1, bypassing CPUs~2-7.
\QuickQuiz{}
Wouldn't it be better just to use a good parallel design
--
2.10.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/3] locking: Fix wrong line number
2018-07-17 0:34 [PATCH 1/3] locking: Add missed unbreakable spaces SeongJae Park
@ 2018-07-17 0:34 ` SeongJae Park
2018-07-17 0:34 ` [PATCH 3/3] locking: Fix a typo, 'a another' SeongJae Park
1 sibling, 0 replies; 3+ messages in thread
From: SeongJae Park @ 2018-07-17 0:34 UTC (permalink / raw)
To: paulmck; +Cc: perfbook, SeongJae Park
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
locking/locking.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/locking/locking.tex b/locking/locking.tex
index 467208a..49d3e5e 100644
--- a/locking/locking.tex
+++ b/locking/locking.tex
@@ -1659,7 +1659,7 @@ as shown on line~2.
} \QuickQuizEnd
Lock acquisition is carried out by the \co{xchg_lock()} function
-shown on lines~4-9.
+shown on lines~4-10.
This function uses a nested loop, with the outer loop repeatedly
atomically exchanging the value of the lock with the value one
(meaning ``locked'').
--
2.10.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 3/3] locking: Fix a typo, 'a another'
2018-07-17 0:34 [PATCH 1/3] locking: Add missed unbreakable spaces SeongJae Park
2018-07-17 0:34 ` [PATCH 2/3] locking: Fix wrong line number SeongJae Park
@ 2018-07-17 0:34 ` SeongJae Park
1 sibling, 0 replies; 3+ messages in thread
From: SeongJae Park @ 2018-07-17 0:34 UTC (permalink / raw)
To: paulmck; +Cc: perfbook, SeongJae Park
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
locking/locking.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/locking/locking.tex b/locking/locking.tex
index 49d3e5e..7e93bdb 100644
--- a/locking/locking.tex
+++ b/locking/locking.tex
@@ -724,7 +724,7 @@ outside of a signal handler without blocking signals.
Therefore, it is illegal to acquire a lock that is acquired outside
of a signal handler without blocking signals while holding
- a another lock that is acquired within a signal handler.
+ another lock that is acquired within a signal handler.
} \QuickQuizEnd
If a lock is acquired by the handlers for several signals, then each
--
2.10.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-17 0:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-17 0:34 [PATCH 1/3] locking: Add missed unbreakable spaces SeongJae Park
2018-07-17 0:34 ` [PATCH 2/3] locking: Fix wrong line number SeongJae Park
2018-07-17 0:34 ` [PATCH 3/3] locking: Fix a typo, 'a another' SeongJae Park
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.