All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Improve page/column breaks in Appendix E
@ 2020-03-06 22:46 Akira Yokosawa
  2020-03-06 22:47 ` [PATCH 1/6] qqz.sty: " Akira Yokosawa
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Akira Yokosawa @ 2020-03-06 22:46 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

Hi Paul,

I think I figured out the way to do what you wanted the other day.
Instead of putting \goodbreak in \QuickQ, putting it in \QuickE
looks like the right approach.

Patch 1/6 does the change.
Patch 2/6 fixes a regression in the first attempt to put \goodbreak
in front of QQZ.
Patches 3/6--6/6 fix minor issues in QQAz.
Feel free to rephrase the added opening sentence in Patch 4/6.

        Thanks, Akira
--
Akira Yokosawa (6):
  qqz.sty: Improve page/column breaks in Appendix E
  qqz.sty: Fix position of \goodbreak for accuracy of hyperlinks
  toolsoftrade: Use nbsp in front of single letter variable
  debugging: Add opening sentence in Answer to QQZ 11.2
  defer/rcuusage: Reverse nesting of fcvref and enumerate envs
  SMPdesign/partexercises: Move figure env next to first paragraph in QQA

 SMPdesign/partexercises.tex   | 15 +++++++--------
 debugging/debugging.tex       |  2 ++
 defer/rcuusage.tex            |  4 ++--
 qqz.sty                       | 10 +++++-----
 toolsoftrade/toolsoftrade.tex |  7 +++----
 5 files changed, 19 insertions(+), 19 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/6] qqz.sty: Improve page/column breaks in Appendix E
  2020-03-06 22:46 [PATCH 0/6] Improve page/column breaks in Appendix E Akira Yokosawa
@ 2020-03-06 22:47 ` Akira Yokosawa
  2020-03-06 22:49 ` [PATCH 2/6] qqz.sty: Fix position of \goodbreak for accuracy of hyperlinks Akira Yokosawa
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Akira Yokosawa @ 2020-03-06 22:47 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 3f5304088091cdbc434d7dacf5835e65c79da5ca Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Thu, 5 Mar 2020 23:40:39 +0900
Subject: [PATCH 1/6] qqz.sty: Improve page/column breaks in Appendix E

For "Quick Quiz" headings to be more likely at the top of pages/
columns in Appendix E, put \goodbreak hint after the white box mark
at the end of QQA.

Also tweak glue parameters to suppress the increase in the total
number of pages.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 qqz.sty | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/qqz.sty b/qqz.sty
index e2dbade6..9b2aed8e 100644
--- a/qqz.sty
+++ b/qqz.sty
@@ -66,7 +66,7 @@
 	\Epigraph{The Answer to the Ultimate Question of Life, The Universe,
 		  and Everything.}
 		 {\emph{``The Hitchhikers Guide to the Galaxy'', Douglas~Adams}}
-	\setlength{\parskip}{0.0pt plus 2ex}
+	\setlength{\parskip}{0.0pt plus 1ex}
 	\input{qqz}
 	\setlength{\parskip}{0.0pt plus 1.0pt}% return to default
 }
@@ -85,11 +85,11 @@
 
 \newcommand{\QuickA}[1]{%
 	\hyperref[QQ.\QuickQuizAnswerChapter.\thequickquizctrC]{\rule{7pt}{7pt}}
-	\par\vspace{0.5\baselineskip plus .5ex minus .3ex}
+	\par\vspace{0.2\baselineskip plus .2ex minus .1ex}
 	\noindent\textbf{Answer:} \\ }
 
 \newcommand{\QuickE}{%
 	\hyperref[QQE.\QuickQuizAnswerChapter.\thequickquizctrC]{\ding{113}}
-	\vspace{1.0\baselineskip plus 2ex minus .5ex}
+	\goodbreak\vspace{0.7\baselineskip plus .5ex minus .2ex}
 }
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/6] qqz.sty: Fix position of \goodbreak for accuracy of hyperlinks
  2020-03-06 22:46 [PATCH 0/6] Improve page/column breaks in Appendix E Akira Yokosawa
  2020-03-06 22:47 ` [PATCH 1/6] qqz.sty: " Akira Yokosawa
@ 2020-03-06 22:49 ` Akira Yokosawa
  2020-03-06 22:50 ` [PATCH 3/6] toolsoftrade: Use nbsp in front of single letter variable Akira Yokosawa
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Akira Yokosawa @ 2020-03-06 22:49 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 440b3f3bbdd2dc212e7f277c950338f22529f532 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Fri, 6 Mar 2020 00:05:09 +0900
Subject: [PATCH 2/6] qqz.sty: Fix position of \goodbreak for accuracy of hyperlinks

Commit 9e256de3262f ("qqz.sty: Permit column/page break in front of
Quick Quiz heading") put \goodbreak after \refstepcounter{}.
This caused backward hyperlinks to QQZs at the top of pages/columns
to point the bottom of the previous pages/columns.

Fix this by placing \goodbreak in front of \refstepcounter{}.

Fixes: 9e256de3262f ("qqz.sty: Permit column/page break in front of Quick Quiz heading")
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 qqz.sty | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/qqz.sty b/qqz.sty
index 9b2aed8e..cc394160 100644
--- a/qqz.sty
+++ b/qqz.sty
@@ -33,8 +33,8 @@
 	\label{#1}
 	}
 \newcommand{\QuickQuiz}[1]{
-	\refstepcounter{quickquizctr}
-	\goodbreak\QuickQHeading{QQ}{QQA}{\thechapter.\thequickquizctr}}
+	\goodbreak\refstepcounter{quickquizctr}%
+	\QuickQHeading{QQ}{QQA}{\thechapter.\thequickquizctr}}
 \newcommand{\QuickQuizAnswer}[1]{%
 	\refstepcounter{quickquizctrE}%
 	\hyperref[QQA.\thechapter.\thequickquizctr]{\rule{7pt}{7pt}}%
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/6] toolsoftrade: Use nbsp in front of single letter variable
  2020-03-06 22:46 [PATCH 0/6] Improve page/column breaks in Appendix E Akira Yokosawa
  2020-03-06 22:47 ` [PATCH 1/6] qqz.sty: " Akira Yokosawa
  2020-03-06 22:49 ` [PATCH 2/6] qqz.sty: Fix position of \goodbreak for accuracy of hyperlinks Akira Yokosawa
@ 2020-03-06 22:50 ` Akira Yokosawa
  2020-03-06 22:51 ` [PATCH 4/6] debugging: Add opening sentence in Answer to QQZ 11.2 Akira Yokosawa
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Akira Yokosawa @ 2020-03-06 22:50 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 415ec82df62f29b0901b124c6991f05117432835 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Fri, 6 Mar 2020 00:18:34 +0900
Subject: [PATCH 3/6] toolsoftrade: Use nbsp in front of single letter variable

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 toolsoftrade/toolsoftrade.tex | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/toolsoftrade/toolsoftrade.tex b/toolsoftrade/toolsoftrade.tex
index 01529a0c..79d6c2cd 100644
--- a/toolsoftrade/toolsoftrade.tex
+++ b/toolsoftrade/toolsoftrade.tex
@@ -681,7 +681,7 @@ values of \co{x} stored by \co{lock_writer()}.
 \QuickQuiz{}
 	Wait a minute here!!!
 	Listing~\ref{lst:toolsoftrade:Demonstration of Same Exclusive Lock}
-	didn't initialize shared variable \co{x},
+	didn't initialize shared variable~\co{x},
 	so why does it need to be initialized in
 	Listing~\ref{lst:toolsoftrade:Demonstration of Different Exclusive Locks}?
 \QuickQuizAnswer{
@@ -689,11 +689,10 @@ values of \co{x} stored by \co{lock_writer()}.
 	Listing~\ref{lst:toolsoftrade:Demonstration of Exclusive Locks}.
 	Because the code in
 	Listing~\ref{lst:toolsoftrade:Demonstration of Same Exclusive Lock}
-	ran first, it could rely on the compile-time initialization of
-	\co{x}.
+	ran first, it could rely on the compile-time initialization of~\co{x}.
 	The code in
 	Listing~\ref{lst:toolsoftrade:Demonstration of Different Exclusive Locks}
-	ran next, so it had to re-initialize \co{x}.
+	ran next, so it had to re-initialize~\co{x}.
 } \QuickQuizEnd
 
 Although there is quite a bit more to POSIX exclusive locking, these
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/6] debugging: Add opening sentence in Answer to QQZ 11.2
  2020-03-06 22:46 [PATCH 0/6] Improve page/column breaks in Appendix E Akira Yokosawa
                   ` (2 preceding siblings ...)
  2020-03-06 22:50 ` [PATCH 3/6] toolsoftrade: Use nbsp in front of single letter variable Akira Yokosawa
@ 2020-03-06 22:51 ` Akira Yokosawa
  2020-03-06 22:52 ` [PATCH 5/6] defer/rcuusage: Reverse nesting of fcvref and enumerate envs Akira Yokosawa
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Akira Yokosawa @ 2020-03-06 22:51 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From dff3065e9c873a499fcc03e5c190e3e531f2199c Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Fri, 6 Mar 2020 20:40:00 +0900
Subject: [PATCH 4/6] debugging: Add opening sentence in Answer to QQZ 11.2

Beginning an answer with an enumerate list can cause the "Answer"
heading to be orphaned.  Avoid it by adding an opening sentence.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 debugging/debugging.tex | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/debugging/debugging.tex b/debugging/debugging.tex
index 07350fe1..cef456af 100644
--- a/debugging/debugging.tex
+++ b/debugging/debugging.tex
@@ -231,6 +231,8 @@ validation is just the right type of job for you.
 	What test inputs should you provide to this program to test it
 	for use with \co{time} output generated by single-threaded programs?
 \QuickQuizAnswer{
+	Can you say ``Yes'' to all the following questions?
+
 	\begin{enumerate}
 	\item	Do you have a test case in which all the time is
 		consumed in user mode by a CPU-bound program?
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/6] defer/rcuusage: Reverse nesting of fcvref and enumerate envs
  2020-03-06 22:46 [PATCH 0/6] Improve page/column breaks in Appendix E Akira Yokosawa
                   ` (3 preceding siblings ...)
  2020-03-06 22:51 ` [PATCH 4/6] debugging: Add opening sentence in Answer to QQZ 11.2 Akira Yokosawa
@ 2020-03-06 22:52 ` Akira Yokosawa
  2020-03-06 22:53 ` [PATCH 6/6] SMPdesign/partexercises: Move figure env next to first paragraph in QQA Akira Yokosawa
  2020-03-07  1:29 ` [PATCH 0/6] Improve page/column breaks in Appendix E Paul E. McKenney
  6 siblings, 0 replies; 8+ messages in thread
From: Akira Yokosawa @ 2020-03-06 22:52 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 18c81bd11d841184bee4336e78f3e9296d5f2df8 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Fri, 6 Mar 2020 20:53:01 +0900
Subject: [PATCH 5/6] defer/rcuusage: Reverse nesting of fcvref and enumerate envs

This change enables qqzreoder.pl to move the ending white box
to the end of the last item in the list.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 defer/rcuusage.tex | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/defer/rcuusage.tex b/defer/rcuusage.tex
index cc25c536..e6c3cf7e 100644
--- a/defer/rcuusage.tex
+++ b/defer/rcuusage.tex
@@ -942,11 +942,11 @@ and line~\lnref{ret_0:b} indicates failure to delete the specified key.
 	before releasing the lock on line~\lnref{rel2}?
 	\end{fcvref}
 \QuickQuizAnswer{
-	\begin{fcvref}[ln:defer:Existence Guarantees Enable Per-Element Locking]
 	Suppose we reverse the order of these two lines.
 	Then this code is vulnerable to the following sequence of
 	events:
 	\begin{enumerate}
+	\begin{fcvref}[ln:defer:Existence Guarantees Enable Per-Element Locking]
 	\item	CPU~0 invokes \co{delete()}, and finds the element
 		to be deleted, executing through line~\lnref{rdunlock2}.
 		It has not yet actually deleted the element, but
@@ -971,8 +971,8 @@ and line~\lnref{ret_0:b} indicates failure to delete the specified key.
 		that has been freed, and, worse yet, possibly
 		reallocated as some other type of data structure.
 		This is a fatal memory-corruption error.
-	\end{enumerate}
 	\end{fcvref}
+	\end{enumerate}
 } \QuickQuizEnd
 
 Alert readers will recognize this as only a slight variation on
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 6/6] SMPdesign/partexercises: Move figure env next to first paragraph in QQA
  2020-03-06 22:46 [PATCH 0/6] Improve page/column breaks in Appendix E Akira Yokosawa
                   ` (4 preceding siblings ...)
  2020-03-06 22:52 ` [PATCH 5/6] defer/rcuusage: Reverse nesting of fcvref and enumerate envs Akira Yokosawa
@ 2020-03-06 22:53 ` Akira Yokosawa
  2020-03-07  1:29 ` [PATCH 0/6] Improve page/column breaks in Appendix E Paul E. McKenney
  6 siblings, 0 replies; 8+ messages in thread
From: Akira Yokosawa @ 2020-03-06 22:53 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 6a10517e8890a37b34c4d3dbbb91372df1906ac1 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Fri, 6 Mar 2020 21:14:19 +0900
Subject: [PATCH 6/6] SMPdesign/partexercises: Move figure env next to first paragraph in QQA

This change removes the extra indent at the beginning of the
answer.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 SMPdesign/partexercises.tex | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/SMPdesign/partexercises.tex b/SMPdesign/partexercises.tex
index 4ceaefeb..12945935 100644
--- a/SMPdesign/partexercises.tex
+++ b/SMPdesign/partexercises.tex
@@ -134,14 +134,6 @@ the acquisition and release algorithms.
 	Is there a better solution to the Dining
 	Philosophers Problem?
 \QuickQuizAnswer{
-%
-\begin{figure}[tb]
-\centering
-\includegraphics[scale=.7]{SMPdesign/DiningPhilosopher5PEM}
-\caption{Dining Philosophers Problem, Fully Partitioned}
-\QContributedBy{Figure}{fig:SMPdesign:Dining Philosophers Problem, Fully Partitioned}{Kornilios Kourtis}
-\end{figure}
-%
 	One such improved solution is shown in
 	Figure~\ref{fig:SMPdesign:Dining Philosophers Problem, Fully Partitioned},
 	where the philosophers are simply provided with an additional
@@ -150,6 +142,13 @@ the acquisition and release algorithms.
 	is never any need for philosophers to wait on one another.
 	In addition, this approach offers greatly improved disease control.
 
+\begin{figure}[tb]
+\centering
+\includegraphics[scale=.7]{SMPdesign/DiningPhilosopher5PEM}
+\caption{Dining Philosophers Problem, Fully Partitioned}
+\QContributedBy{Figure}{fig:SMPdesign:Dining Philosophers Problem, Fully Partitioned}{Kornilios Kourtis}
+\end{figure}
+
 	This solution might seem like cheating to some, but such
 	``cheating'' is key to finding good solutions to many
 	concurrency problems.
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/6] Improve page/column breaks in Appendix E
  2020-03-06 22:46 [PATCH 0/6] Improve page/column breaks in Appendix E Akira Yokosawa
                   ` (5 preceding siblings ...)
  2020-03-06 22:53 ` [PATCH 6/6] SMPdesign/partexercises: Move figure env next to first paragraph in QQA Akira Yokosawa
@ 2020-03-07  1:29 ` Paul E. McKenney
  6 siblings, 0 replies; 8+ messages in thread
From: Paul E. McKenney @ 2020-03-07  1:29 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Sat, Mar 07, 2020 at 07:46:44AM +0900, Akira Yokosawa wrote:
> Hi Paul,
> 
> I think I figured out the way to do what you wanted the other day.
> Instead of putting \goodbreak in \QuickQ, putting it in \QuickE
> looks like the right approach.
> 
> Patch 1/6 does the change.
> Patch 2/6 fixes a regression in the first attempt to put \goodbreak
> in front of QQZ.
> Patches 3/6--6/6 fix minor issues in QQAz.
> Feel free to rephrase the added opening sentence in Patch 4/6.

It looks fine!

Good stuff, queued and pushed, thank you!

							Thanx, Paul

>         Thanks, Akira
> --
> Akira Yokosawa (6):
>   qqz.sty: Improve page/column breaks in Appendix E
>   qqz.sty: Fix position of \goodbreak for accuracy of hyperlinks
>   toolsoftrade: Use nbsp in front of single letter variable
>   debugging: Add opening sentence in Answer to QQZ 11.2
>   defer/rcuusage: Reverse nesting of fcvref and enumerate envs
>   SMPdesign/partexercises: Move figure env next to first paragraph in QQA
> 
>  SMPdesign/partexercises.tex   | 15 +++++++--------
>  debugging/debugging.tex       |  2 ++
>  defer/rcuusage.tex            |  4 ++--
>  qqz.sty                       | 10 +++++-----
>  toolsoftrade/toolsoftrade.tex |  7 +++----
>  5 files changed, 19 insertions(+), 19 deletions(-)
> 
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-03-07  1:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06 22:46 [PATCH 0/6] Improve page/column breaks in Appendix E Akira Yokosawa
2020-03-06 22:47 ` [PATCH 1/6] qqz.sty: " Akira Yokosawa
2020-03-06 22:49 ` [PATCH 2/6] qqz.sty: Fix position of \goodbreak for accuracy of hyperlinks Akira Yokosawa
2020-03-06 22:50 ` [PATCH 3/6] toolsoftrade: Use nbsp in front of single letter variable Akira Yokosawa
2020-03-06 22:51 ` [PATCH 4/6] debugging: Add opening sentence in Answer to QQZ 11.2 Akira Yokosawa
2020-03-06 22:52 ` [PATCH 5/6] defer/rcuusage: Reverse nesting of fcvref and enumerate envs Akira Yokosawa
2020-03-06 22:53 ` [PATCH 6/6] SMPdesign/partexercises: Move figure env next to first paragraph in QQA Akira Yokosawa
2020-03-07  1:29 ` [PATCH 0/6] Improve page/column breaks in Appendix E Paul E. McKenney

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.