All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Update qqzreorder.pl
@ 2017-11-18 15:03 Akira Yokosawa
  2017-11-18 15:04 ` [PATCH 1/3] Update qqzreorder.pl to take care of listing at the end of QQA Akira Yokosawa
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Akira Yokosawa @ 2017-11-18 15:03 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From a2d0cd80fb99a15bd5265f12863ac8f0183f9a9b Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 18 Nov 2017 23:43:37 +0900
Subject: [PATCH 0/3] Update qqzreorder.pl

Hi Paul,

In commit 90197e37d310 ("Fix layout hiccups in answers to quick
quizzes"), I missed that code snippets at the end of QQAs were
taken care of by qqzreorder.pl. The hiccup I saw in rcuapi.tex
was the regression of conversion of code snippets to "listing"
environment. I should have updated qqzreorder.pl at the time
so that it could take care of "listing"s at the end of QQAs.

Patch #1 updates qqzreorder.pl and tweaks a code snippet in
memorder's QQA, which has such a listing at the end of a QQA.

Patch #2 reverts the unnecessary changes in the above mentioned
commit. It has no effect in the resulting PDF, but the spacial
case handling should be done in a consistent manner.

Patch #3 fixes unrelated trivial typos.

       Thanks, Akira
--
Akira Yokosawa (3):
  Update qqzreorder.pl to take care of listing at the end of QQA
  Partial revert of 'Fix layout hiccups in answers to quick quizzes'
  memorder: Fix trivial typo

 defer/rcuapi.tex        |  7 +++----
 memorder/memorder.tex   |  5 +++--
 utilities/qqzreorder.pl | 24 ++++++++++++------------
 3 files changed, 18 insertions(+), 18 deletions(-)

-- 
2.7.4


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

* [PATCH 1/3] Update qqzreorder.pl to take care of listing at the end of QQA
  2017-11-18 15:03 [PATCH 0/3] Update qqzreorder.pl Akira Yokosawa
@ 2017-11-18 15:04 ` Akira Yokosawa
  2017-11-18 15:06 ` [PATCH 2/3] Partial revert of 'Fix layout hiccups in answers to quick quizzes' Akira Yokosawa
  2017-11-18 15:07 ` [PATCH 3/3] memorder: Fix trivial typo Akira Yokosawa
  2 siblings, 0 replies; 6+ messages in thread
From: Akira Yokosawa @ 2017-11-18 15:04 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 75056ec5dd25a1e6daa45cf4592e51fbb26685a8 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 18 Nov 2017 21:03:23 +0900
Subject: [PATCH 1/3] Update qqzreorder.pl to take care of listing at the end of QQA

Also add a blank line above \begin{listing} so that the reordered
\QuickE{} is output at the right place.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 memorder/memorder.tex   |  1 +
 utilities/qqzreorder.pl | 24 ++++++++++++------------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/memorder/memorder.tex b/memorder/memorder.tex
index 7a72c68..68dc09b 100644
--- a/memorder/memorder.tex
+++ b/memorder/memorder.tex
@@ -2634,6 +2634,7 @@ suffice to prevent the \co{exists} clause from triggering.
 	shows a somewhat nonsensical but very real example.
 	Creating a more useful (but still real) litmus test is left
 	as an exercise for the reader.
+
 \begin{listing}[tbp]
 { \scriptsize
 \begin{verbbox}[\LstLineNo]
diff --git a/utilities/qqzreorder.pl b/utilities/qqzreorder.pl
index 197d5a0..624d68b 100644
--- a/utilities/qqzreorder.pl
+++ b/utilities/qqzreorder.pl
@@ -2,8 +2,8 @@
 #
 # Move line of \QuickE{} below \end{enumerate} to just above
 # the \end{enumerate}.
-# Move line of \QuickE{} below \end{figure} to above
-# \begin{figure} corresponding to it.
+# Move line of \QuickE{} below \end{listing} to above
+# \begin{listing} corresponding to it.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -25,8 +25,8 @@

 my $line;
 my $after_end_enum = 0;
-my $in_figure = 0;
-my $after_figure = 0;
+my $in_listing = 0;
+my $after_listing = 0;
 my $line_idx = 1;
 my @line_buf;

@@ -42,15 +42,15 @@ while($line = <>) {
 	$after_end_enum = 0;
 	next;
     }
-    if ($in_figure) {
-	if ($line =~ /\\end\{figure\}/) {
-	    $after_figure = 1;
-	    $in_figure = 0;
+    if ($in_listing) {
+	if ($line =~ /\\end\{listing\}/) {
+	    $after_listing = 1;
+	    $in_listing = 0;
 	}
 	$line_buf[++$line_idx] = $line;
 	next;
     }
-    if ($after_figure) {
+    if ($after_listing) {
 	if ($line =~ /%/) {
 	    $line_buf[++$line_idx] = $line;
 	    next;
@@ -68,7 +68,7 @@ while($line = <>) {
 	    $line_buf[1] = $line;
 	}
 	$line_idx = 1;
-	$after_figure = 0;
+	$after_listing = 0;
 	next;
     }
     if ($line =~ /\\end\{enumerate\}/) {
@@ -77,8 +77,8 @@ while($line = <>) {
 	$after_end_enum = 1;
 	next;
     }
-    if ($line =~ /\\begin\{figure\}/) {
-	$in_figure = 1;
+    if ($line =~ /\\begin\{listing\}/) {
+	$in_listing = 1;
 	$line_buf[++$line_idx] = $line;
 	next;
     }
-- 
2.7.4



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

* [PATCH 2/3] Partial revert of 'Fix layout hiccups in answers to quick quizzes'
  2017-11-18 15:03 [PATCH 0/3] Update qqzreorder.pl Akira Yokosawa
  2017-11-18 15:04 ` [PATCH 1/3] Update qqzreorder.pl to take care of listing at the end of QQA Akira Yokosawa
@ 2017-11-18 15:06 ` Akira Yokosawa
  2017-11-18 15:07 ` [PATCH 3/3] memorder: Fix trivial typo Akira Yokosawa
  2 siblings, 0 replies; 6+ messages in thread
From: Akira Yokosawa @ 2017-11-18 15:06 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 3f6060fdcfe12b94ac56380e4211c06316b141c5 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 18 Nov 2017 23:30:40 +0900
Subject: [PATCH 2/3] Partial revert of 'Fix layout hiccups in answers to quick quizzes'

As qqzreorder.pl can take care of "listing" at the end of QQA now,
some of the changes made in commit 90197e37d310 ("Fix layout hiccups
in answers to quick quizzes") can be reverted.

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

diff --git a/defer/rcuapi.tex b/defer/rcuapi.tex
index 55811a1..7fbb189 100644
--- a/defer/rcuapi.tex
+++ b/defer/rcuapi.tex
@@ -367,8 +367,8 @@ returns a value that must be passed into the corresponding
 	In practice, however, doing this is almost certainly a bad idea.
 	In particular, the code shown in
 	Listing~\ref{lst:defer:Multistage SRCU Deadlocks}
-	could still result in deadlock.%
-%
+	could still result in deadlock.
+
 \begin{listing}[htbp]
 \scriptsize
 {
@@ -388,8 +388,7 @@ returns a value that must be passed into the corresponding
 \theverbbox
 \caption{Multistage SRCU Deadlocks}
 \label{lst:defer:Multistage SRCU Deadlocks}
-\end{listing}%
-%
+\end{listing}
 } \QuickQuizEnd

 The Linux kernel currently has a surprising number of RCU APIs and
-- 
2.7.4



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

* [PATCH 3/3] memorder: Fix trivial typo
  2017-11-18 15:03 [PATCH 0/3] Update qqzreorder.pl Akira Yokosawa
  2017-11-18 15:04 ` [PATCH 1/3] Update qqzreorder.pl to take care of listing at the end of QQA Akira Yokosawa
  2017-11-18 15:06 ` [PATCH 2/3] Partial revert of 'Fix layout hiccups in answers to quick quizzes' Akira Yokosawa
@ 2017-11-18 15:07 ` Akira Yokosawa
  2017-11-18 20:10   ` Paul E. McKenney
  2 siblings, 1 reply; 6+ messages in thread
From: Akira Yokosawa @ 2017-11-18 15:07 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From a2d0cd80fb99a15bd5265f12863ac8f0183f9a9b Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 18 Nov 2017 23:39:26 +0900
Subject: [PATCH 3/3] memorder: Fix trivial typo

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

diff --git a/memorder/memorder.tex b/memorder/memorder.tex
index 68dc09b..d11df62 100644
--- a/memorder/memorder.tex
+++ b/memorder/memorder.tex
@@ -10,7 +10,7 @@ Causality and sequencing are deeply intuitive, and hackers often
 tend to have a much stronger grasp of these concepts than does
 the general population.
 These intuitions can be extremely powerful tools when writing, analyzing,
-and debugging both sequential code and parallel code that makes
+and debugging both sequential code and parallel code that make
 use of standard mutual-exclusion mechanisms, such as locking and
 RCU.
 Unfortunately, these intuitions break down completely in face of
@@ -38,7 +38,7 @@ follows up with more detail on what representative hardware platforms
 actually do to unwary parallel programmers.
 Finally, Section~\ref{sec:memorder:Where is Memory Ordering Needed?}
 provides some rules of thumb for what situations require parallel
-programmers to take special action to preserver memory ordering.
+programmers to take special action to preserve memory ordering.

 \section{Ordering: Why and How?}
 \label{sec:memorder:Ordering: Why and How?}
-- 
2.7.4



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

* Re: [PATCH 3/3] memorder: Fix trivial typo
  2017-11-18 15:07 ` [PATCH 3/3] memorder: Fix trivial typo Akira Yokosawa
@ 2017-11-18 20:10   ` Paul E. McKenney
  2017-11-18 22:43     ` Akira Yokosawa
  0 siblings, 1 reply; 6+ messages in thread
From: Paul E. McKenney @ 2017-11-18 20:10 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Sun, Nov 19, 2017 at 12:07:02AM +0900, Akira Yokosawa wrote:
> >From a2d0cd80fb99a15bd5265f12863ac8f0183f9a9b Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Sat, 18 Nov 2017 23:39:26 +0900
> Subject: [PATCH 3/3] memorder: Fix trivial typo
> 
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>

I applied all three, and especially like the script taking up some
of the manual handling of quick quizzes with figures!

One thing I left out, please see below.

							Thanx, Paul

> ---
>  memorder/memorder.tex | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/memorder/memorder.tex b/memorder/memorder.tex
> index 68dc09b..d11df62 100644
> --- a/memorder/memorder.tex
> +++ b/memorder/memorder.tex
> @@ -10,7 +10,7 @@ Causality and sequencing are deeply intuitive, and hackers often
>  tend to have a much stronger grasp of these concepts than does
>  the general population.
>  These intuitions can be extremely powerful tools when writing, analyzing,
> -and debugging both sequential code and parallel code that makes
> +and debugging both sequential code and parallel code that make
>  use of standard mutual-exclusion mechanisms, such as locking and
>  RCU.
>  Unfortunately, these intuitions break down completely in face of

If it was "intuitions" that made use of "standard mutual-exclusion
mechanisms", this fix would be correct.  Plural "intuitions" would
require plural "make".  (And no, I have no idea why English adds "s"
to nouns to denote plural, but removes "s" from verbs to denote plural.
Probably because it is English...)

But it is "code" that made use of "standard mutual-exclusion mechanisms".
I am treating "code" like "water", that is, "lines of code" would be
plural (like "molecules of water"), but "code" is singular (like "water").

I also treat "data" as singular, that is, as a collective noun.  This
is controversial, and people who like "data" to be plural probably also
like "code" to be plural when referring to lines of code.

https://en.wikipedia.org/wiki/Data_(word)

And it appears that most people are now willing to put up with "data"
as a collective noun when applied to computers.  Others are probably
still protesting that "data" is the plural form of "datum" in Latin.

But, yes, English!  :-/

							Thanx, Paul

> @@ -38,7 +38,7 @@ follows up with more detail on what representative hardware platforms
>  actually do to unwary parallel programmers.
>  Finally, Section~\ref{sec:memorder:Where is Memory Ordering Needed?}
>  provides some rules of thumb for what situations require parallel
> -programmers to take special action to preserver memory ordering.
> +programmers to take special action to preserve memory ordering.
> 
>  \section{Ordering: Why and How?}
>  \label{sec:memorder:Ordering: Why and How?}
> -- 
> 2.7.4
> 
> 


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

* Re: [PATCH 3/3] memorder: Fix trivial typo
  2017-11-18 20:10   ` Paul E. McKenney
@ 2017-11-18 22:43     ` Akira Yokosawa
  0 siblings, 0 replies; 6+ messages in thread
From: Akira Yokosawa @ 2017-11-18 22:43 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

On 2017/11/18 12:10:27 -0800, Paul E. McKenney wrote:
> On Sun, Nov 19, 2017 at 12:07:02AM +0900, Akira Yokosawa wrote:
>> >From a2d0cd80fb99a15bd5265f12863ac8f0183f9a9b Mon Sep 17 00:00:00 2001
>> From: Akira Yokosawa <akiyks@gmail.com>
>> Date: Sat, 18 Nov 2017 23:39:26 +0900
>> Subject: [PATCH 3/3] memorder: Fix trivial typo
>>
>> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> 
> I applied all three, and especially like the script taking up some
> of the manual handling of quick quizzes with figures!
> 
> One thing I left out, please see below.
> 
> 							Thanx, Paul
> 
>> ---
>>  memorder/memorder.tex | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/memorder/memorder.tex b/memorder/memorder.tex
>> index 68dc09b..d11df62 100644
>> --- a/memorder/memorder.tex
>> +++ b/memorder/memorder.tex
>> @@ -10,7 +10,7 @@ Causality and sequencing are deeply intuitive, and hackers often
>>  tend to have a much stronger grasp of these concepts than does
>>  the general population.
>>  These intuitions can be extremely powerful tools when writing, analyzing,
>> -and debugging both sequential code and parallel code that makes
>> +and debugging both sequential code and parallel code that make
>>  use of standard mutual-exclusion mechanisms, such as locking and
>>  RCU.
>>  Unfortunately, these intuitions break down completely in face of
> 
> If it was "intuitions" that made use of "standard mutual-exclusion
> mechanisms", this fix would be correct.  Plural "intuitions" would
> require plural "make".  (And no, I have no idea why English adds "s"
> to nouns to denote plural, but removes "s" from verbs to denote plural.
> Probably because it is English...)
> 
> But it is "code" that made use of "standard mutual-exclusion mechanisms".
> I am treating "code" like "water", that is, "lines of code" would be
> plural (like "molecules of water"), but "code" is singular (like "water").

I see. What happened in my mind was a dumb pattern match with:

    "Both X and Y that makes use of ..."

> 
> I also treat "data" as singular, that is, as a collective noun.  This
> is controversial, and people who like "data" to be plural probably also
> like "code" to be plural when referring to lines of code.
> 
> https://en.wikipedia.org/wiki/Data_(word)
> 
> And it appears that most people are now willing to put up with "data"
> as a collective noun when applied to computers.  Others are probably
> still protesting that "data" is the plural form of "datum" in Latin.
> 
> But, yes, English!  :-/

Yes. "data" always bother/bothers me...  :-(

      Thanks, Akira

> 
> 							Thanx, Paul
> 
>> @@ -38,7 +38,7 @@ follows up with more detail on what representative hardware platforms
>>  actually do to unwary parallel programmers.
>>  Finally, Section~\ref{sec:memorder:Where is Memory Ordering Needed?}
>>  provides some rules of thumb for what situations require parallel
>> -programmers to take special action to preserver memory ordering.
>> +programmers to take special action to preserve memory ordering.
>>
>>  \section{Ordering: Why and How?}
>>  \label{sec:memorder:Ordering: Why and How?}
>> -- 
>> 2.7.4
>>
>>
> 
> 


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

end of thread, other threads:[~2017-11-18 22:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-18 15:03 [PATCH 0/3] Update qqzreorder.pl Akira Yokosawa
2017-11-18 15:04 ` [PATCH 1/3] Update qqzreorder.pl to take care of listing at the end of QQA Akira Yokosawa
2017-11-18 15:06 ` [PATCH 2/3] Partial revert of 'Fix layout hiccups in answers to quick quizzes' Akira Yokosawa
2017-11-18 15:07 ` [PATCH 3/3] memorder: Fix trivial typo Akira Yokosawa
2017-11-18 20:10   ` Paul E. McKenney
2017-11-18 22:43     ` Akira Yokosawa

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.