All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -perfbook 0/4] Address potential widowing of headings
@ 2021-12-08  7:37 Akira Yokosawa
  2021-12-08  7:39 ` [PATCH -perfbook 1/4] cleverefcheck.pl: Add test of listing next to heading Akira Yokosawa
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Akira Yokosawa @ 2021-12-08  7:37 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

Hi Paul,

There was some confusion on my side WRT undesired page/column
breaks.

While testing the added checks in cleverefcheck.pl, I saw too
many potential such cases flagged.  This made me do some tests
to reproduce unfortunate page/column breaks.

There are three such patterns I have confirmed.

1. "listing" environment (with contents of fancyvrb) next to proper
LaTeX headings (\chapter, \section, \subsection, etc.)

2. Any environment (not necessarily float) next to QQA heading
of "Answer:"

3. Any environment (not necessarily float) next to epigraph

This means commit f106e0e6dc43 ("defer/rcuusage: Move float objects
away of section titles") has no merit.  It is safe to revert it if
you'd like.  I was confused by patterns 2 and 3 and thought that
floating objects can cause undesired breaks. 

Patches 1/4--3/4 add tests in cleverefcheck.pl that check patterns
listed above respectively.

Patch 4/4 fixes problematic places flagged by the updated script.
Feel free to wordsmith the leading phrases I added in QQAs.

        Thanks, Akira
--
Akira Yokosawa (4):
  cleverefcheck.pl: Add test of listing next to heading
  cleverefcheck.pl: Add test of \begin{...} at head of QQA
  cleverefcheck.pl: Add test of \begin{...} next to epigraph
  treewide: Address potential widowing of headings

 appendix/questions/after.tex  |  4 +++
 datastruct/datastruct.tex     | 14 +++++-----
 defer/refcnt.tex              | 24 ++++++++---------
 formal/axiomatic.tex          | 22 +++++++--------
 locking/locking-existence.tex |  9 ++++---
 memorder/memorder.tex         |  6 ++---
 utilities/cleverefcheck.pl    | 50 +++++++++++++++++++++++++++++++++++
 7 files changed, 92 insertions(+), 37 deletions(-)


base-commit: f106e0e6dc436683bb119dd8992c6f173994d182
-- 
2.17.1


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

* [PATCH -perfbook 1/4] cleverefcheck.pl: Add test of listing next to heading
  2021-12-08  7:37 [PATCH -perfbook 0/4] Address potential widowing of headings Akira Yokosawa
@ 2021-12-08  7:39 ` Akira Yokosawa
  2021-12-08  7:41 ` [PATCH -perfbook 2/4] cleverefcheck.pl: Add test of \begin{...} at head of QQA Akira Yokosawa
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2021-12-08  7:39 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

There is a side effect of fancyvrb, or the Verbatim{L|N|U}
environments derived from Verbatim, in that floating "listing"
environments placed just next to chapter/section headings are
treated as page/column-break candidates, and results in a widowed
heading.

Other floating objects such as "figure" and "table" do not
have this issue as long as they are free of fancyvrb.

Add tests to detect "listing" environments who come next to
\chapter/\section/\subsection/... commands.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 utilities/cleverefcheck.pl | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/utilities/cleverefcheck.pl b/utilities/cleverefcheck.pl
index 0085fdb5..f46cd89f 100755
--- a/utilities/cleverefcheck.pl
+++ b/utilities/cleverefcheck.pl
@@ -25,8 +25,11 @@ my $IX_ptn = qr/(^|\s+)IX[^\s\{]*{/ ;
 my $api_ptn = qr/(^|\s+)api[^\s\{]*{/ ;
 my $ppl_ptn = qr/(^|\s+)ppl[^\s\{]*{/ ;
 my $acr_ptn = qr/(^|\s+)[aA]cr[^\s\{]*{/ ;
+my $heading_ptn = qr/(\\chapter|\\section|\\subsection|\\subsubsection)/ ;
+my $listing_ptn = qr/\\begin\{(listing|Verbatim)/ ;
 my $in_footnote = 0 ;
 my $footnote_save = 0;
+my $after_heading = 0;
 
 sub check_line {
     my $raw_line = $line;
@@ -102,6 +105,18 @@ sub check_line {
 	    print $ARGV[0], ':', $line_num, ':', $raw_line;
 	}
     }
+    if ($after_heading) {
+	if ($line =~ /^\s*$/) {
+	    # ignore empty/blank line
+	}
+	if ($line =~ /^\s*\{*[A-Za-z0-9]/) {
+	    $after_heading = 0 ;  # normal line, OK
+	}
+	if ($line =~ /$listing_ptn/) {
+	    print $ARGV[0], ':', $line_num, ':', $raw_line, "^^^ listing next to heading ^^^\n";
+	    $after_heading = 0 ;
+	}
+    }
     if ($line =~ /$Verbatim_end/) {
 	$skip = 0;
     } else {
@@ -135,6 +150,9 @@ sub check_line {
 	    }
 	}
     }
+    if ($line =~ /$heading_ptn/) {
+	$after_heading = 1 ;
+    }
 }
 
 open(my $fh, '<:encoding(UTF-8)', $ARGV[0])
-- 
2.17.1



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

* [PATCH -perfbook 2/4] cleverefcheck.pl: Add test of \begin{...} at head of QQA
  2021-12-08  7:37 [PATCH -perfbook 0/4] Address potential widowing of headings Akira Yokosawa
  2021-12-08  7:39 ` [PATCH -perfbook 1/4] cleverefcheck.pl: Add test of listing next to heading Akira Yokosawa
@ 2021-12-08  7:41 ` Akira Yokosawa
  2021-12-08  7:49 ` [PATCH -perfbook 3/4] cleverefcheck.pl: Add test of \begin{...} next to epigraph Akira Yokosawa
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2021-12-08  7:41 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

QQA's heading of "Answer:" looks similar to a section heading,
but it behaves differently when there is some environment next
to it.
Also, if there is an empty line at the head of QQA, "Answer:" can
be widowed.

Add tests to detect such potential break patterns in QQA.

Note: \begin{fcvref} is an exception.  It doesn't induce
page/column break.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 utilities/cleverefcheck.pl | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/utilities/cleverefcheck.pl b/utilities/cleverefcheck.pl
index f46cd89f..74ac9d72 100755
--- a/utilities/cleverefcheck.pl
+++ b/utilities/cleverefcheck.pl
@@ -27,9 +27,11 @@ my $ppl_ptn = qr/(^|\s+)ppl[^\s\{]*{/ ;
 my $acr_ptn = qr/(^|\s+)[aA]cr[^\s\{]*{/ ;
 my $heading_ptn = qr/(\\chapter|\\section|\\subsection|\\subsubsection)/ ;
 my $listing_ptn = qr/\\begin\{(listing|Verbatim)/ ;
+my $qqa_ptn = qr/\\E?QuickQuizAnswer[BEM]?/ ;
 my $in_footnote = 0 ;
 my $footnote_save = 0;
 my $after_heading = 0;
+my $after_qqa = 0;
 
 sub check_line {
     my $raw_line = $line;
@@ -117,6 +119,18 @@ sub check_line {
 	    $after_heading = 0 ;
 	}
     }
+    if ($after_qqa) {
+	if ($line =~ /^\s*$/) {
+	    print $ARGV[0], ':', $line_num, ':', $raw_line, "~~~ Empty line at QQA head ^^^\n" ;
+	}
+	if ($line =~ /^\s*\\begin/ && $line !~ /fcvref/) {
+	    print $ARGV[0], ':', $line_num, ':', $raw_line, "^^^ environment next to QQA ~~~\n";
+	    $after_qqa = 0 ;
+	}
+	if ($line =~ /^\s*\{*[^\\]+/) {
+	    $after_qqa = 0;
+	}
+    }
     if ($line =~ /$Verbatim_end/) {
 	$skip = 0;
     } else {
@@ -153,6 +167,9 @@ sub check_line {
     if ($line =~ /$heading_ptn/) {
 	$after_heading = 1 ;
     }
+    if ($line =~ /$qqa_ptn/) {
+	$after_qqa = 1 ;
+    }
 }
 
 open(my $fh, '<:encoding(UTF-8)', $ARGV[0])
-- 
2.17.1



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

* [PATCH -perfbook 3/4] cleverefcheck.pl: Add test of \begin{...} next to epigraph
  2021-12-08  7:37 [PATCH -perfbook 0/4] Address potential widowing of headings Akira Yokosawa
  2021-12-08  7:39 ` [PATCH -perfbook 1/4] cleverefcheck.pl: Add test of listing next to heading Akira Yokosawa
  2021-12-08  7:41 ` [PATCH -perfbook 2/4] cleverefcheck.pl: Add test of \begin{...} at head of QQA Akira Yokosawa
@ 2021-12-08  7:49 ` Akira Yokosawa
  2021-12-08  7:52 ` [PATCH -perfbook 4/4] treewide: Address potential widowing of headings Akira Yokosawa
  2021-12-08 19:55 ` [PATCH -perfbook 0/4] " Paul E. McKenney
  4 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2021-12-08  7:49 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

If a section heading has an epigraph next to it and an
environment of some sort follows the epigraph, the behavior
of a proper LaTeX heading is lost.

Add tests to detect such potential break patterns following
epigraphs.

Notes:
  o "Any environment" does not include "fcvref".
  o "listing" is caught by other tests for it.
  o glossary.tex has "description" list next to its epigraph.
    As it is at the head of an appendix and won't cause
    page/colum break, it is ignored.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 utilities/cleverefcheck.pl | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/utilities/cleverefcheck.pl b/utilities/cleverefcheck.pl
index 74ac9d72..6e9a59e8 100755
--- a/utilities/cleverefcheck.pl
+++ b/utilities/cleverefcheck.pl
@@ -28,10 +28,12 @@ my $acr_ptn = qr/(^|\s+)[aA]cr[^\s\{]*{/ ;
 my $heading_ptn = qr/(\\chapter|\\section|\\subsection|\\subsubsection)/ ;
 my $listing_ptn = qr/\\begin\{(listing|Verbatim)/ ;
 my $qqa_ptn = qr/\\E?QuickQuizAnswer[BEM]?/ ;
+my $epig_ptn = qr/\\[Ee]pigraph/ ;
 my $in_footnote = 0 ;
 my $footnote_save = 0;
 my $after_heading = 0;
 my $after_qqa = 0;
+my $after_epig = 0;
 
 sub check_line {
     my $raw_line = $line;
@@ -117,6 +119,7 @@ sub check_line {
 	if ($line =~ /$listing_ptn/) {
 	    print $ARGV[0], ':', $line_num, ':', $raw_line, "^^^ listing next to heading ^^^\n";
 	    $after_heading = 0 ;
+	    $after_epig = 0 ;  # after epigraph or not does not matter for listing
 	}
     }
     if ($after_qqa) {
@@ -131,6 +134,15 @@ sub check_line {
 	    $after_qqa = 0;
 	}
     }
+    if ($after_epig) {
+	if ($line =~ /^\s*$/) {  # empty line ends epigraph
+	    $after_epig -= 1 ;
+	}
+	if ($line =~ /^\s*\\begin/ && $line !~ /(fcvref|listing)/) {
+	    print $ARGV[0], ':', $line_num, ':', $raw_line, "^^^ environment next to epigraph ^^^\n";
+	    $after_epig = 0 ;
+	}
+    }
     if ($line =~ /$Verbatim_end/) {
 	$skip = 0;
     } else {
@@ -170,6 +182,9 @@ sub check_line {
     if ($line =~ /$qqa_ptn/) {
 	$after_qqa = 1 ;
     }
+    if ($line =~ /$epig_ptn/ && $ARGV[0] !~ /glossary\.tex/) { # exempt glossary.tex
+	$after_epig = 2 ;
+    }
 }
 
 open(my $fh, '<:encoding(UTF-8)', $ARGV[0])
-- 
2.17.1



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

* [PATCH -perfbook 4/4] treewide: Address potential widowing of headings
  2021-12-08  7:37 [PATCH -perfbook 0/4] Address potential widowing of headings Akira Yokosawa
                   ` (2 preceding siblings ...)
  2021-12-08  7:49 ` [PATCH -perfbook 3/4] cleverefcheck.pl: Add test of \begin{...} next to epigraph Akira Yokosawa
@ 2021-12-08  7:52 ` Akira Yokosawa
  2021-12-08 19:55 ` [PATCH -perfbook 0/4] " Paul E. McKenney
  4 siblings, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2021-12-08  7:52 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

Fix potential page/column break patterns flagged by the updated
cleverefcheck.pl.

 o Move code snippets away from section headings.
 o Add leading phrases to enumerate lists in QQAs.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 appendix/questions/after.tex  |  4 ++++
 datastruct/datastruct.tex     | 14 +++++++-------
 defer/refcnt.tex              | 24 ++++++++++++------------
 formal/axiomatic.tex          | 22 +++++++++++-----------
 locking/locking-existence.tex |  9 +++++----
 memorder/memorder.tex         |  6 +++---
 6 files changed, 42 insertions(+), 37 deletions(-)

diff --git a/appendix/questions/after.tex b/appendix/questions/after.tex
index bd7c46b5..b78bc684 100644
--- a/appendix/questions/after.tex
+++ b/appendix/questions/after.tex
@@ -38,6 +38,8 @@ e.g., where time has appeared to go backwards.
 	What SMP coding errors can you see in these examples?
 	See \path{time.c} for full code.
 }\QuickQuizAnswer{
+	Here are errors you'd find:
+
 	\begin{enumerate}
 	\item	Missing barrier() or volatile on tight loops.
 	\item	Missing memory barriers on update side.
@@ -173,6 +175,8 @@ seq    & \multicolumn{1}{c}{time (seconds)} & delta~  &  a &  b &  c \\
 	consumer reads?
 	See \path{timelocked.c} for full code.
 }\QuickQuizAnswer{
+	Here are possible scenarios:
+
 	\begin{enumerate}
 	\item	The consumer might be preempted for long time periods.
 	\item	A long-running interrupt might delay the consumer.
diff --git a/datastruct/datastruct.tex b/datastruct/datastruct.tex
index ba429dfc..7186b611 100644
--- a/datastruct/datastruct.tex
+++ b/datastruct/datastruct.tex
@@ -1067,13 +1067,6 @@ or all of the above.
 	  You can't cross a chasm in two small steps.}
 	 {\emph{David Lloyd George}}
 
-\begin{figure}
-\centering
-\resizebox{3in}{!}{\includegraphics{cartoons/2014_Hash-table-hydra}}
-\caption{Partitioning Problems}
-\ContributedBy{Figure}{fig:datastruct:Partitioning Problems}{Melissa Broussard}
-\end{figure}
-
 Fixed-size hash tables are perfectly partitionable, but resizable hash
 tables pose partitioning challenges when growing or shrinking, as
 fancifully depicted in
@@ -1081,6 +1074,13 @@ fancifully depicted in
 However, it turns out that it is possible to construct high-performance
 scalable RCU-protected hash tables, as described in the following sections.
 
+\begin{figure}
+\centering
+\resizebox{3in}{!}{\includegraphics{cartoons/2014_Hash-table-hydra}}
+\caption{Partitioning Problems}
+\ContributedBy{Figure}{fig:datastruct:Partitioning Problems}{Melissa Broussard}
+\end{figure}
+
 \subsection{Resizable Hash Table Design}
 \label{sec:datastruct:Resizable Hash Table Design}
 
diff --git a/defer/refcnt.tex b/defer/refcnt.tex
index 80d69e71..14e2def6 100644
--- a/defer/refcnt.tex
+++ b/defer/refcnt.tex
@@ -7,18 +7,6 @@
 %
 \epigraph{I am never letting you go!}{Unknown}
 
-\begin{listing}
-\input{CodeSamples/defer/route_refcnt@lookup.fcv}
-\caption{Reference-Counted Pre-BSD Routing Table Lookup (BUGGY!!!)}
-\label{lst:defer:Reference-Counted Pre-BSD Routing Table Lookup}
-\end{listing}
-
-\begin{listing}
-\input{CodeSamples/defer/route_refcnt@add_del.fcv}
-\caption{Reference-Counted Pre-BSD Routing Table Add\slash Delete (BUGGY!!!)}
-\label{lst:defer:Reference-Counted Pre-BSD Routing Table Add/Delete}
-\end{listing}
-
 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
@@ -35,6 +23,18 @@ on while that worker is inside.
 Reference counting is thus an excellent time-honored candidate for a
 concurrent implementation of Pre-BSD routing.
 
+\begin{listing}
+\input{CodeSamples/defer/route_refcnt@lookup.fcv}
+\caption{Reference-Counted Pre-BSD Routing Table Lookup (BUGGY!!!)}
+\label{lst:defer:Reference-Counted Pre-BSD Routing Table Lookup}
+\end{listing}
+
+\begin{listing}
+\input{CodeSamples/defer/route_refcnt@add_del.fcv}
+\caption{Reference-Counted Pre-BSD Routing Table Add\slash Delete (BUGGY!!!)}
+\label{lst:defer:Reference-Counted Pre-BSD Routing Table Add/Delete}
+\end{listing}
+
 To that end,
 \cref{lst:defer:Reference-Counted Pre-BSD Routing Table Lookup}
 shows data structures and the \co{route_lookup()} function and
diff --git a/formal/axiomatic.tex b/formal/axiomatic.tex
index bf5b8263..9e3c0b69 100644
--- a/formal/axiomatic.tex
+++ b/formal/axiomatic.tex
@@ -9,6 +9,17 @@
 \epigraph{Theory helps us to bear our ignorance of facts.}
 	{\emph{George Santayana}}
 
+Although the PPCMEM tool can solve the famous ``independent reads of
+independent writes'' (IRIW) litmus test shown in
+\cref{lst:formal:IRIW Litmus Test}, doing so requires no less than
+fourteen CPU hours and generates no less than ten gigabytes of state space.
+That said, this situation is a great improvement over that before the advent
+of PPCMEM, where solving this problem required perusing volumes of
+reference manuals, attempting proofs, discussing with experts, and
+being unsure of the final answer.
+Although fourteen hours can seem like a long time, it is much shorter
+than weeks or even months.
+
 \begin{listing}
 \begin{fcvlabel}[ln:formal:IRIW Litmus Test]
 \begin{VerbatimL}[commandchars=\%\@\$]
@@ -34,17 +45,6 @@ exists
 \label{lst:formal:IRIW Litmus Test}
 \end{listing}
 
-Although the PPCMEM tool can solve the famous ``independent reads of
-independent writes'' (IRIW) litmus test shown in
-\cref{lst:formal:IRIW Litmus Test}, doing so requires no less than
-fourteen CPU hours and generates no less than ten gigabytes of state space.
-That said, this situation is a great improvement over that before the advent
-of PPCMEM, where solving this problem required perusing volumes of
-reference manuals, attempting proofs, discussing with experts, and
-being unsure of the final answer.
-Although fourteen hours can seem like a long time, it is much shorter
-than weeks or even months.
-
 However, the time required is a bit surprising given the simplicity
 of the litmus test, which has two threads storing to two separate variables
 and two other threads loading from these two variables in opposite
diff --git a/locking/locking-existence.tex b/locking/locking-existence.tex
index 7058e852..38e432a2 100644
--- a/locking/locking-existence.tex
+++ b/locking/locking-existence.tex
@@ -7,6 +7,11 @@
 %
 \epigraph{Existence precedes and rules essence.}{\emph{Jean-Paul Sartre}}
 
+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
+being in existence throughout a given access attempt.
+
 \begin{listing}
 \begin{fcvlabel}[ln:locking:Per-Element Locking Without Existence Guarantees]
 \begin{VerbatimL}[commandchars=\\\@\$]
@@ -31,10 +36,6 @@ int delete(int key)
 \label{lst:locking:Per-Element Locking Without Existence Guarantees}
 \end{listing}
 
-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
-being in existence throughout a given access attempt.
 In some cases, existence guarantees are implicit:
 
 \begin{enumerate}
diff --git a/memorder/memorder.tex b/memorder/memorder.tex
index 6ba634e9..cd828b0a 100644
--- a/memorder/memorder.tex
+++ b/memorder/memorder.tex
@@ -1967,13 +1967,13 @@ This means that the \co{exists} clause on \clnref{exists} really can trigger.
 	But it is not necessary to worry about propagation unless
 	there are at least three threads in the litmus test, right?
 }\QuickQuizAnswer{
+	Wrong.
+
 \begin{listing}
 \input{CodeSamples/formal/litmus/C-R+o-wmb-o+o-mb-o@whole.fcv}
 \caption{R Litmus Test With Write Memory Barrier (No Ordering)}
 \label{lst:memorder:R Litmus Test With Write Memory Barrier (No Ordering)}
-\end{listing}%
-%
-	Wrong.
+\end{listing}
 
 	\begin{fcvref}[ln:formal:C-R+o-wmb-o+o-mb-o:whole]
 	\Cref{lst:memorder:R Litmus Test With Write Memory Barrier (No Ordering)}
-- 
2.17.1



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

* Re: [PATCH -perfbook 0/4] Address potential widowing of headings
  2021-12-08  7:37 [PATCH -perfbook 0/4] Address potential widowing of headings Akira Yokosawa
                   ` (3 preceding siblings ...)
  2021-12-08  7:52 ` [PATCH -perfbook 4/4] treewide: Address potential widowing of headings Akira Yokosawa
@ 2021-12-08 19:55 ` Paul E. McKenney
  2021-12-08 22:20   ` Akira Yokosawa
  4 siblings, 1 reply; 10+ messages in thread
From: Paul E. McKenney @ 2021-12-08 19:55 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Wed, Dec 08, 2021 at 04:37:26PM +0900, Akira Yokosawa wrote:
> Hi Paul,
> 
> There was some confusion on my side WRT undesired page/column
> breaks.
> 
> While testing the added checks in cleverefcheck.pl, I saw too
> many potential such cases flagged.  This made me do some tests
> to reproduce unfortunate page/column breaks.
> 
> There are three such patterns I have confirmed.
> 
> 1. "listing" environment (with contents of fancyvrb) next to proper
> LaTeX headings (\chapter, \section, \subsection, etc.)
> 
> 2. Any environment (not necessarily float) next to QQA heading
> of "Answer:"
> 
> 3. Any environment (not necessarily float) next to epigraph
> 
> This means commit f106e0e6dc43 ("defer/rcuusage: Move float objects
> away of section titles") has no merit.  It is safe to revert it if
> you'd like.  I was confused by patterns 2 and 3 and thought that
> floating objects can cause undesired breaks. 
> 
> Patches 1/4--3/4 add tests in cleverefcheck.pl that check patterns
> listed above respectively.
> 
> Patch 4/4 fixes problematic places flagged by the updated script.
> Feel free to wordsmith the leading phrases I added in QQAs.

Queued and pushed with minor wordsmithing to parts of 4/4,
thank you!

						Thanx, Paul

>         Thanks, Akira
> --
> Akira Yokosawa (4):
>   cleverefcheck.pl: Add test of listing next to heading
>   cleverefcheck.pl: Add test of \begin{...} at head of QQA
>   cleverefcheck.pl: Add test of \begin{...} next to epigraph
>   treewide: Address potential widowing of headings
> 
>  appendix/questions/after.tex  |  4 +++
>  datastruct/datastruct.tex     | 14 +++++-----
>  defer/refcnt.tex              | 24 ++++++++---------
>  formal/axiomatic.tex          | 22 +++++++--------
>  locking/locking-existence.tex |  9 ++++---
>  memorder/memorder.tex         |  6 ++---
>  utilities/cleverefcheck.pl    | 50 +++++++++++++++++++++++++++++++++++
>  7 files changed, 92 insertions(+), 37 deletions(-)
> 
> 
> base-commit: f106e0e6dc436683bb119dd8992c6f173994d182
> -- 
> 2.17.1
> 

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

* Re: [PATCH -perfbook 0/4] Address potential widowing of headings
  2021-12-08 19:55 ` [PATCH -perfbook 0/4] " Paul E. McKenney
@ 2021-12-08 22:20   ` Akira Yokosawa
  2021-12-08 23:58     ` Paul E. McKenney
  0 siblings, 1 reply; 10+ messages in thread
From: Akira Yokosawa @ 2021-12-08 22:20 UTC (permalink / raw)
  To: paulmck; +Cc: perfbook, Akira Yokosawa

On Wed, 8 Dec 2021 11:55:47 -0800, Paul E. McKenney wrote:
> On Wed, Dec 08, 2021 at 04:37:26PM +0900, Akira Yokosawa wrote:
>> Hi Paul,
>>
>> There was some confusion on my side WRT undesired page/column
>> breaks.
>>
>> While testing the added checks in cleverefcheck.pl, I saw too
>> many potential such cases flagged.  This made me do some tests
>> to reproduce unfortunate page/column breaks.
>>
>> There are three such patterns I have confirmed.
>>
>> 1. "listing" environment (with contents of fancyvrb) next to proper
>> LaTeX headings (\chapter, \section, \subsection, etc.)
>>
>> 2. Any environment (not necessarily float) next to QQA heading
>> of "Answer:"
>>
>> 3. Any environment (not necessarily float) next to epigraph
>>
>> This means commit f106e0e6dc43 ("defer/rcuusage: Move float objects
>> away of section titles") has no merit.  It is safe to revert it if
>> you'd like.  I was confused by patterns 2 and 3 and thought that
>> floating objects can cause undesired breaks. 
>>
>> Patches 1/4--3/4 add tests in cleverefcheck.pl that check patterns
>> listed above respectively.
>>
>> Patch 4/4 fixes problematic places flagged by the updated script.
>> Feel free to wordsmith the leading phrases I added in QQAs.
> 
> Queued and pushed with minor wordsmithing to parts of 4/4,
> thank you!

So the diff below looks somewhat out of context, because the Quiz
part of QQ A.2 is "How could there be such a large gap between
successive consumer reads?".

----
@@ -175,7 +175,7 @@ seq    & \multicolumn{1}{c}{time (seconds)} & delta~  &  a &  b &  c \\
        consumer reads?
        See \path{timelocked.c} for full code.
 }\QuickQuizAnswer{
-       Here are possible scenarios:
+       Here are a few of the errors:
 
        \begin{enumerate}
        \item   The consumer might be preempted for long time periods.
----

Thoughts?

        Thanks, Akira

> 
> 						Thanx, Paul
> 
>>         Thanks, Akira
>> --
>> Akira Yokosawa (4):
>>   cleverefcheck.pl: Add test of listing next to heading
>>   cleverefcheck.pl: Add test of \begin{...} at head of QQA
>>   cleverefcheck.pl: Add test of \begin{...} next to epigraph
>>   treewide: Address potential widowing of headings
>>
>>  appendix/questions/after.tex  |  4 +++
>>  datastruct/datastruct.tex     | 14 +++++-----
>>  defer/refcnt.tex              | 24 ++++++++---------
>>  formal/axiomatic.tex          | 22 +++++++--------
>>  locking/locking-existence.tex |  9 ++++---
>>  memorder/memorder.tex         |  6 ++---
>>  utilities/cleverefcheck.pl    | 50 +++++++++++++++++++++++++++++++++++
>>  7 files changed, 92 insertions(+), 37 deletions(-)
>>
>>
>> base-commit: f106e0e6dc436683bb119dd8992c6f173994d182
>> -- 
>> 2.17.1
>>

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

* Re: [PATCH -perfbook 0/4] Address potential widowing of headings
  2021-12-08 22:20   ` Akira Yokosawa
@ 2021-12-08 23:58     ` Paul E. McKenney
  2021-12-09  0:03       ` Akira Yokosawa
  0 siblings, 1 reply; 10+ messages in thread
From: Paul E. McKenney @ 2021-12-08 23:58 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Thu, Dec 09, 2021 at 07:20:20AM +0900, Akira Yokosawa wrote:
> On Wed, 8 Dec 2021 11:55:47 -0800, Paul E. McKenney wrote:
> > On Wed, Dec 08, 2021 at 04:37:26PM +0900, Akira Yokosawa wrote:
> >> Hi Paul,
> >>
> >> There was some confusion on my side WRT undesired page/column
> >> breaks.
> >>
> >> While testing the added checks in cleverefcheck.pl, I saw too
> >> many potential such cases flagged.  This made me do some tests
> >> to reproduce unfortunate page/column breaks.
> >>
> >> There are three such patterns I have confirmed.
> >>
> >> 1. "listing" environment (with contents of fancyvrb) next to proper
> >> LaTeX headings (\chapter, \section, \subsection, etc.)
> >>
> >> 2. Any environment (not necessarily float) next to QQA heading
> >> of "Answer:"
> >>
> >> 3. Any environment (not necessarily float) next to epigraph
> >>
> >> This means commit f106e0e6dc43 ("defer/rcuusage: Move float objects
> >> away of section titles") has no merit.  It is safe to revert it if
> >> you'd like.  I was confused by patterns 2 and 3 and thought that
> >> floating objects can cause undesired breaks. 
> >>
> >> Patches 1/4--3/4 add tests in cleverefcheck.pl that check patterns
> >> listed above respectively.
> >>
> >> Patch 4/4 fixes problematic places flagged by the updated script.
> >> Feel free to wordsmith the leading phrases I added in QQAs.
> > 
> > Queued and pushed with minor wordsmithing to parts of 4/4,
> > thank you!
> 
> So the diff below looks somewhat out of context, because the Quiz
> part of QQ A.2 is "How could there be such a large gap between
> successive consumer reads?".
> 
> ----
> @@ -175,7 +175,7 @@ seq    & \multicolumn{1}{c}{time (seconds)} & delta~  &  a &  b &  c \\
>         consumer reads?
>         See \path{timelocked.c} for full code.
>  }\QuickQuizAnswer{
> -       Here are possible scenarios:
> +       Here are a few of the errors:
>  
>         \begin{enumerate}
>         \item   The consumer might be preempted for long time periods.
> ----
> 
> Thoughts?

I changed this to "Here are a few reasons for such gaps:".  Does
that work for you?

						Thanx, Paul

>         Thanks, Akira
> 
> > 
> > 						Thanx, Paul
> > 
> >>         Thanks, Akira
> >> --
> >> Akira Yokosawa (4):
> >>   cleverefcheck.pl: Add test of listing next to heading
> >>   cleverefcheck.pl: Add test of \begin{...} at head of QQA
> >>   cleverefcheck.pl: Add test of \begin{...} next to epigraph
> >>   treewide: Address potential widowing of headings
> >>
> >>  appendix/questions/after.tex  |  4 +++
> >>  datastruct/datastruct.tex     | 14 +++++-----
> >>  defer/refcnt.tex              | 24 ++++++++---------
> >>  formal/axiomatic.tex          | 22 +++++++--------
> >>  locking/locking-existence.tex |  9 ++++---
> >>  memorder/memorder.tex         |  6 ++---
> >>  utilities/cleverefcheck.pl    | 50 +++++++++++++++++++++++++++++++++++
> >>  7 files changed, 92 insertions(+), 37 deletions(-)
> >>
> >>
> >> base-commit: f106e0e6dc436683bb119dd8992c6f173994d182
> >> -- 
> >> 2.17.1
> >>

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

* Re: [PATCH -perfbook 0/4] Address potential widowing of headings
  2021-12-08 23:58     ` Paul E. McKenney
@ 2021-12-09  0:03       ` Akira Yokosawa
  2021-12-09  6:28         ` Zhouyi Zhou
  0 siblings, 1 reply; 10+ messages in thread
From: Akira Yokosawa @ 2021-12-09  0:03 UTC (permalink / raw)
  To: paulmck; +Cc: perfbook, Akira Yokosawa

On Wed, 8 Dec 2021 15:58:58 -0800, Paul E. McKenney wrote:
> On Thu, Dec 09, 2021 at 07:20:20AM +0900, Akira Yokosawa wrote:
[...]
>> So the diff below looks somewhat out of context, because the Quiz
>> part of QQ A.2 is "How could there be such a large gap between
>> successive consumer reads?".
>>
>> ----
>> @@ -175,7 +175,7 @@ seq    & \multicolumn{1}{c}{time (seconds)} & delta~  &  a &  b &  c \\
>>         consumer reads?
>>         See \path{timelocked.c} for full code.
>>  }\QuickQuizAnswer{
>> -       Here are possible scenarios:
>> +       Here are a few of the errors:
>>  
>>         \begin{enumerate}
>>         \item   The consumer might be preempted for long time periods.
>> ----
>>
>> Thoughts?
> 
> I changed this to "Here are a few reasons for such gaps:".  Does
> that work for you?

Works for me!

        Thanks, Akira

> 
> 						Thanx, Paul
> 
>>         Thanks, Akira
[...]

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

* Re: [PATCH -perfbook 0/4] Address potential widowing of headings
  2021-12-09  0:03       ` Akira Yokosawa
@ 2021-12-09  6:28         ` Zhouyi Zhou
  0 siblings, 0 replies; 10+ messages in thread
From: Zhouyi Zhou @ 2021-12-09  6:28 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: paulmck, perfbook

On Thu, Dec 9, 2021 at 9:30 AM Akira Yokosawa <akiyks@gmail.com> wrote:
>
> On Wed, 8 Dec 2021 15:58:58 -0800, Paul E. McKenney wrote:
> > On Thu, Dec 09, 2021 at 07:20:20AM +0900, Akira Yokosawa wrote:
> [...]
> >> So the diff below looks somewhat out of context, because the Quiz
> >> part of QQ A.2 is "How could there be such a large gap between
> >> successive consumer reads?".
> >>
> >> ----
> >> @@ -175,7 +175,7 @@ seq    & \multicolumn{1}{c}{time (seconds)} & delta~  &  a &  b &  c \\
> >>         consumer reads?
> >>         See \path{timelocked.c} for full code.
> >>  }\QuickQuizAnswer{
> >> -       Here are possible scenarios:
> >> +       Here are a few of the errors:
> >>
> >>         \begin{enumerate}
> >>         \item   The consumer might be preempted for long time periods.
> >> ----
> >>
> >> Thoughts?
> >
> > I changed this to "Here are a few reasons for such gaps:".  Does
> > that work for you?
>
> Works for me!

Works for me too ;-)
>
>         Thanks, Akira
>
> >
> >                                               Thanx, Paul
> >
> >>         Thanks, Akira
> [...]
Thanks, Zhouyi

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

end of thread, other threads:[~2021-12-09  6:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08  7:37 [PATCH -perfbook 0/4] Address potential widowing of headings Akira Yokosawa
2021-12-08  7:39 ` [PATCH -perfbook 1/4] cleverefcheck.pl: Add test of listing next to heading Akira Yokosawa
2021-12-08  7:41 ` [PATCH -perfbook 2/4] cleverefcheck.pl: Add test of \begin{...} at head of QQA Akira Yokosawa
2021-12-08  7:49 ` [PATCH -perfbook 3/4] cleverefcheck.pl: Add test of \begin{...} next to epigraph Akira Yokosawa
2021-12-08  7:52 ` [PATCH -perfbook 4/4] treewide: Address potential widowing of headings Akira Yokosawa
2021-12-08 19:55 ` [PATCH -perfbook 0/4] " Paul E. McKenney
2021-12-08 22:20   ` Akira Yokosawa
2021-12-08 23:58     ` Paul E. McKenney
2021-12-09  0:03       ` Akira Yokosawa
2021-12-09  6:28         ` Zhouyi Zhou

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.