* [PATCH 0/3] Fix layout hiccups in answers to quick quizzes
@ 2017-11-04 1:38 Akira Yokosawa
2017-11-04 1:39 ` [PATCH 1/3] hyphen2endash.sh: Add patterns for 'nn-mm days' and 'nn-mm sheets' Akira Yokosawa
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Akira Yokosawa @ 2017-11-04 1:38 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
From fa20d77f7a35114dd6bf93e362b44235b163f1ad Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 4 Nov 2017 09:01:08 +0900
Subject: [PATCH 0/3] Fix layout hiccups in answers to quick quizzes
Hi Paul,
This patch set picks up some minor tweaks regarding answers to
quick quizzes.
Patch #1 adds a couple of patterns to hyphen2endash.sh
Patch #2 adjusts line-break position after nn-mm so that the pattern
added in Patch #1 can be applied.
Patch #3 fixes some layout hiccups in answers to quick quizzes.
Thanks, Akira
--
Akira Yokosawa (3):
hyphen2endash.sh: Add patterns for 'nn-mm days' and 'nn-mm sheets'
cpu/overheads: Don't break just after nn-mm
Fix layout hiccups in answers to quick quizzes
cpu/overheads.tex | 4 ++--
defer/rcuapi.tex | 7 ++++---
defer/rcufundamental.tex | 1 +
memorder/memorder.tex | 7 ++++---
toolsoftrade/toolsoftrade.tex | 2 +-
utilities/hyphen2endash.sh | 6 ++++++
6 files changed, 18 insertions(+), 9 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] hyphen2endash.sh: Add patterns for 'nn-mm days' and 'nn-mm sheets'
2017-11-04 1:38 [PATCH 0/3] Fix layout hiccups in answers to quick quizzes Akira Yokosawa
@ 2017-11-04 1:39 ` Akira Yokosawa
2017-11-04 1:40 ` [PATCH 2/3] cpu/overheads: Don't break just after nn-mm Akira Yokosawa
2017-11-04 1:41 ` [PATCH 3/3] Fix layout hiccups in answers to quick quizzes Akira Yokosawa
2 siblings, 0 replies; 7+ messages in thread
From: Akira Yokosawa @ 2017-11-04 1:39 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
From 844896af3fefe18c0e4dd32bdf6be2c9d8a776f8 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Thu, 2 Nov 2017 22:42:14 +0900
Subject: [PATCH 1/3] hyphen2endash.sh: Add patterns for 'nn-mm days' and 'nn-mm sheets'
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
utilities/hyphen2endash.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/utilities/hyphen2endash.sh b/utilities/hyphen2endash.sh
index 29e3896..1586804 100644
--- a/utilities/hyphen2endash.sh
+++ b/utilities/hyphen2endash.sh
@@ -23,6 +23,10 @@
# nn-mm~microsecond -> nn--mm~microsecond
# nn-mm~millisecond -> nn--mm~millisecond
# nn-mm~\emp -> nn--mm~\emp
+# nn-mm days -> nn--mm~days
+# nn-mm~days -> nn--mm~days
+# nn-mm sheets -> nn--mm~sheets
+# nn-mm~sheets -> nn--mm~sheets
#
# 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
@@ -54,6 +58,8 @@ cat $1 |
-e 's/\([0-9]\+\)-\([0-9]\+\)~microsecond/\1--\2~microsecond/g' \
-e 's/\([0-9]\+\)-\([0-9]\+\)~millisecond/\1--\2~millisecond/g' \
-e 's/\([0-9]\+\)-\([0-9]\+\)~\\emp/\1--\2~\\emp/g' \
+ -e 's/\([0-9]\+\)-\([0-9]\+\)[ ~]days/\1--\2~days/g' \
+ -e 's/\([0-9]\+\)-\([0-9]\+\)[ ~]sheets/\1--\2~sheets/g' \
-e 's/\/\* Lines~\([0-9]\+\)--\([0-9]\+\) \*\//\/\* Lines \1-\2 \*\//g'
# Last pattern is to preserve "Lines n-m" in comments within code snippet
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] cpu/overheads: Don't break just after nn-mm
2017-11-04 1:38 [PATCH 0/3] Fix layout hiccups in answers to quick quizzes Akira Yokosawa
2017-11-04 1:39 ` [PATCH 1/3] hyphen2endash.sh: Add patterns for 'nn-mm days' and 'nn-mm sheets' Akira Yokosawa
@ 2017-11-04 1:40 ` Akira Yokosawa
2017-11-04 4:40 ` Paul E. McKenney
2017-11-04 1:41 ` [PATCH 3/3] Fix layout hiccups in answers to quick quizzes Akira Yokosawa
2 siblings, 1 reply; 7+ messages in thread
From: Akira Yokosawa @ 2017-11-04 1:40 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
From 96995ec9781970d633f554579465e9f053ec316a Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 4 Nov 2017 07:44:36 +0900
Subject: [PATCH 2/3] cpu/overheads: Don't break just after nn-mm
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
cpu/overheads.tex | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cpu/overheads.tex b/cpu/overheads.tex
index bd4c814..366b071 100644
--- a/cpu/overheads.tex
+++ b/cpu/overheads.tex
@@ -290,8 +290,8 @@ cycles, as shown in the ``Global Comms'' row.
How can I possibly get my head around them?
\QuickQuizAnswer{
Get a roll of toilet paper.
- In the USA, each roll will normally have somewhere around 350-500
- sheets.
+ In the USA, each roll will normally have somewhere around
+ 350-500 sheets.
Tear off one sheet to represent a single clock cycle, setting it aside.
Now unroll the rest of the roll.
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] Fix layout hiccups in answers to quick quizzes
2017-11-04 1:38 [PATCH 0/3] Fix layout hiccups in answers to quick quizzes Akira Yokosawa
2017-11-04 1:39 ` [PATCH 1/3] hyphen2endash.sh: Add patterns for 'nn-mm days' and 'nn-mm sheets' Akira Yokosawa
2017-11-04 1:40 ` [PATCH 2/3] cpu/overheads: Don't break just after nn-mm Akira Yokosawa
@ 2017-11-04 1:41 ` Akira Yokosawa
2 siblings, 0 replies; 7+ messages in thread
From: Akira Yokosawa @ 2017-11-04 1:41 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
From fa20d77f7a35114dd6bf93e362b44235b163f1ad Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 4 Nov 2017 08:34:01 +0900
Subject: [PATCH 3/3] Fix layout hiccups in answers to quick quizzes
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
defer/rcuapi.tex | 7 ++++---
defer/rcufundamental.tex | 1 +
memorder/memorder.tex | 7 ++++---
toolsoftrade/toolsoftrade.tex | 2 +-
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/defer/rcuapi.tex b/defer/rcuapi.tex
index d4e434d..55811a1 100644
--- a/defer/rcuapi.tex
+++ b/defer/rcuapi.tex
@@ -367,9 +367,10 @@ 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
{
\begin{verbbox}
1 idx = srcu_read_lock(&ssa);
@@ -387,7 +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
diff --git a/defer/rcufundamental.tex b/defer/rcufundamental.tex
index 4c16478..f2cfab2 100644
--- a/defer/rcufundamental.tex
+++ b/defer/rcufundamental.tex
@@ -750,6 +750,7 @@ versions of the list active at a given time.
Listing~\ref{lst:defer:Concurrent RCU Deletion}.
\begin{listing}[htbp]
+\scriptsize
{
\begin{verbbox}
1 spin_lock(&mylock);
diff --git a/memorder/memorder.tex b/memorder/memorder.tex
index 3ba4d3a..0e823d4 100644
--- a/memorder/memorder.tex
+++ b/memorder/memorder.tex
@@ -1854,8 +1854,8 @@ exists (1:r1=1 /\ 1:r2=0)
\theverbbox
\caption{Litmus Test Distinguishing Multicopy Atomic From Other Multicopy Atomic}
\label{lst:memorder:Litmus Test Distinguishing Multicopy Atomic From Other Multicopy Atomic}
-\end{listing}
-
+\end{listing}%
+%
Listing~\ref{lst:memorder:Litmus Test Distinguishing Multicopy Atomic From Other Multicopy Atomic}
(\path{C-MP-OMCA+o-o-o+o-rmb-o.litmus})
shows such a test.
@@ -2299,7 +2299,8 @@ exists (1:r2=0 /\ x1=2)
\theverbbox
\caption{R Litmus Test With Write Memory Barrier (No Ordering)}
\label{lst:memorder:R Litmus Test With Write Memory Barrier (No Ordering)}
-\end{listing}
+\end{listing}%
+%
Wrong.
Listing~\ref{lst:memorder:R Litmus Test With Write Memory Barrier (No Ordering)}
diff --git a/toolsoftrade/toolsoftrade.tex b/toolsoftrade/toolsoftrade.tex
index d37a295..7d3e038 100644
--- a/toolsoftrade/toolsoftrade.tex
+++ b/toolsoftrade/toolsoftrade.tex
@@ -727,7 +727,7 @@ by \co{lock_writer()} while holding the lock.
The reason that ``x = 0'' was output was that \co{lock_reader()}
acquired the lock first.
Had \co{lock_writer()} instead acquired the lock first, then
- the output would have been ``x = 3''.
+ the output would have been \mbox{``x = 3''}.
However, because the code fragment started \co{lock_reader()} first
and because this run was performed on a multiprocessor,
one would normally expect \co{lock_reader()} to acquire the
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] cpu/overheads: Don't break just after nn-mm
2017-11-04 1:40 ` [PATCH 2/3] cpu/overheads: Don't break just after nn-mm Akira Yokosawa
@ 2017-11-04 4:40 ` Paul E. McKenney
2017-11-04 5:24 ` Akira Yokosawa
0 siblings, 1 reply; 7+ messages in thread
From: Paul E. McKenney @ 2017-11-04 4:40 UTC (permalink / raw)
To: Akira Yokosawa; +Cc: perfbook
On Sat, Nov 04, 2017 at 10:40:40AM +0900, Akira Yokosawa wrote:
> >From 96995ec9781970d633f554579465e9f053ec316a Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Sat, 4 Nov 2017 07:44:36 +0900
> Subject: [PATCH 2/3] cpu/overheads: Don't break just after nn-mm
>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
You lost me with this one. Shouldn't there be a non-breaking space
between the "350-500" and the "sheets"? Or is there some magic here
that I am missing?
Thanx, Paul
> ---
> cpu/overheads.tex | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/cpu/overheads.tex b/cpu/overheads.tex
> index bd4c814..366b071 100644
> --- a/cpu/overheads.tex
> +++ b/cpu/overheads.tex
> @@ -290,8 +290,8 @@ cycles, as shown in the ``Global Comms'' row.
> How can I possibly get my head around them?
> \QuickQuizAnswer{
> Get a roll of toilet paper.
> - In the USA, each roll will normally have somewhere around 350-500
> - sheets.
> + In the USA, each roll will normally have somewhere around
> + 350-500 sheets.
> Tear off one sheet to represent a single clock cycle, setting it aside.
> Now unroll the rest of the roll.
>
> --
> 2.7.4
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] cpu/overheads: Don't break just after nn-mm
2017-11-04 4:40 ` Paul E. McKenney
@ 2017-11-04 5:24 ` Akira Yokosawa
2017-11-04 16:09 ` Paul E. McKenney
0 siblings, 1 reply; 7+ messages in thread
From: Akira Yokosawa @ 2017-11-04 5:24 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
On 2017/11/03 21:40:25 -0700, Paul E. McKenney wrote:
> On Sat, Nov 04, 2017 at 10:40:40AM +0900, Akira Yokosawa wrote:
>> >From 96995ec9781970d633f554579465e9f053ec316a Mon Sep 17 00:00:00 2001
>> From: Akira Yokosawa <akiyks@gmail.com>
>> Date: Sat, 4 Nov 2017 07:44:36 +0900
>> Subject: [PATCH 2/3] cpu/overheads: Don't break just after nn-mm
>>
>> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
>
> You lost me with this one. Shouldn't there be a non-breaking space
> between the "350-500" and the "sheets"? Or is there some magic here
> that I am missing?
I intentionally chose normal space because the preceding number is
3 digits and "sheets" can't be hyphenated. It can cause large underfil
in 2c layout.
In the current Answer, line breaking is done at different places in
both 1c and 2c layout, so it doesn't matter at the moment.
Also, non-breaking spaces can be enforced by a script something like
hypen2endash.sh. The added pattern in Patch #1 does the conversion
to nbsp. (I use this script for mostly 1c layout.)
Thoughts?
Thanks, Akira
>
> Thanx, Paul
>
>> ---
>> cpu/overheads.tex | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/cpu/overheads.tex b/cpu/overheads.tex
>> index bd4c814..366b071 100644
>> --- a/cpu/overheads.tex
>> +++ b/cpu/overheads.tex
>> @@ -290,8 +290,8 @@ cycles, as shown in the ``Global Comms'' row.
>> How can I possibly get my head around them?
>> \QuickQuizAnswer{
>> Get a roll of toilet paper.
>> - In the USA, each roll will normally have somewhere around 350-500
>> - sheets.
>> + In the USA, each roll will normally have somewhere around
>> + 350-500 sheets.
>> Tear off one sheet to represent a single clock cycle, setting it aside.
>> Now unroll the rest of the roll.
>>
>> --
>> 2.7.4
>>
>>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] cpu/overheads: Don't break just after nn-mm
2017-11-04 5:24 ` Akira Yokosawa
@ 2017-11-04 16:09 ` Paul E. McKenney
0 siblings, 0 replies; 7+ messages in thread
From: Paul E. McKenney @ 2017-11-04 16:09 UTC (permalink / raw)
To: Akira Yokosawa; +Cc: perfbook
On Sat, Nov 04, 2017 at 02:24:22PM +0900, Akira Yokosawa wrote:
> On 2017/11/03 21:40:25 -0700, Paul E. McKenney wrote:
> > On Sat, Nov 04, 2017 at 10:40:40AM +0900, Akira Yokosawa wrote:
> >> >From 96995ec9781970d633f554579465e9f053ec316a Mon Sep 17 00:00:00 2001
> >> From: Akira Yokosawa <akiyks@gmail.com>
> >> Date: Sat, 4 Nov 2017 07:44:36 +0900
> >> Subject: [PATCH 2/3] cpu/overheads: Don't break just after nn-mm
> >>
> >> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> >
> > You lost me with this one. Shouldn't there be a non-breaking space
> > between the "350-500" and the "sheets"? Or is there some magic here
> > that I am missing?
>
> I intentionally chose normal space because the preceding number is
> 3 digits and "sheets" can't be hyphenated. It can cause large underfil
> in 2c layout.
> In the current Answer, line breaking is done at different places in
> both 1c and 2c layout, so it doesn't matter at the moment.
>
> Also, non-breaking spaces can be enforced by a script something like
> hypen2endash.sh. The added pattern in Patch #1 does the conversion
> to nbsp. (I use this script for mostly 1c layout.)
>
> Thoughts?
OK, I am finally seeing the connection between this change and the
change to the sripts. So, yes, it has no direct effect on LaTeX,
but does have an indirect effect after the scripts have run. And some
quick-quiz answers do look much better as well!
I applied and pushed all three, thank you
> Thanks, Akira
>
> >
> > Thanx, Paul
> >
> >> ---
> >> cpu/overheads.tex | 4 ++--
> >> 1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/cpu/overheads.tex b/cpu/overheads.tex
> >> index bd4c814..366b071 100644
> >> --- a/cpu/overheads.tex
> >> +++ b/cpu/overheads.tex
> >> @@ -290,8 +290,8 @@ cycles, as shown in the ``Global Comms'' row.
> >> How can I possibly get my head around them?
> >> \QuickQuizAnswer{
> >> Get a roll of toilet paper.
> >> - In the USA, each roll will normally have somewhere around 350-500
> >> - sheets.
> >> + In the USA, each roll will normally have somewhere around
> >> + 350-500 sheets.
> >> Tear off one sheet to represent a single clock cycle, setting it aside.
> >> Now unroll the rest of the roll.
> >>
> >> --
> >> 2.7.4
> >>
> >>
> >
> >
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-11-04 16:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-04 1:38 [PATCH 0/3] Fix layout hiccups in answers to quick quizzes Akira Yokosawa
2017-11-04 1:39 ` [PATCH 1/3] hyphen2endash.sh: Add patterns for 'nn-mm days' and 'nn-mm sheets' Akira Yokosawa
2017-11-04 1:40 ` [PATCH 2/3] cpu/overheads: Don't break just after nn-mm Akira Yokosawa
2017-11-04 4:40 ` Paul E. McKenney
2017-11-04 5:24 ` Akira Yokosawa
2017-11-04 16:09 ` Paul E. McKenney
2017-11-04 1:41 ` [PATCH 3/3] Fix layout hiccups in answers to quick quizzes Akira Yokosawa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox