* [PATCH -perfbook 1/7] formal/spinhint: Don't use \qco{} for long message
2023-04-29 23:01 [PATCH -perfbook 0/7] Collection of minor fixes and updates Akira Yokosawa
@ 2023-04-29 23:05 ` Akira Yokosawa
2023-04-29 23:40 ` SeongJae Park
2023-04-29 23:07 ` [PATCH -perfbook 2/7] formal/ppcmem: Use \qco{} as intended Akira Yokosawa
` (5 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Akira Yokosawa @ 2023-04-29 23:05 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: SeongJae Park, perfbook, Akira Yokosawa
\qco{} is intended to be used for short snippets and suppresses line
breaks in its argument by using \nbco{} in its definition.
Commit 88fd12717c61 ("formal/spinhint: Use \qco{} instead of``\co{}''")
applied \qco{} for a long error message.
It causes "Underfull \hbox" of large badness preceding it.
In perfbook-1c.log and perfbook-eb.log:
Underfull \hbox (badness 10000) in paragraph at lines 277--281
[]\T1/ntxtlf/m/n/10 (+20) If you see a mes-sage from [][][][] say-ing:
[]
In perfbook.log:
Underfull \hbox (badness 2495) in paragraph at lines 277--281
[]\T1/ntxtlf/m/n/10 (+20) If you see a mes-sage from [][][][] say-ing:
[]
Revert the change and permit line breaks in the middle of the quoted
message.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Cc: SeongJae Park <sj38.park@gmail.com>
---
formal/spinhint.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/formal/spinhint.tex b/formal/spinhint.tex
index 9bb5f5749470..16764aef8620 100644
--- a/formal/spinhint.tex
+++ b/formal/spinhint.tex
@@ -275,7 +275,7 @@ Given a source file \path{qrcu.spin}, one can use the following commands:
10.5\,GB of memory even with the \co{-DCOLLAPSE} flag.
If you see a message from \co{./pan} saying:
- \qco{error: max search depth too small}, you need to increase
+ ``\co{error: max search depth too small}'', you need to increase
the maximum depth by a \co{-mN} option for a complete search.
The default is \co{-m10000}.
--
2.25.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH -perfbook 1/7] formal/spinhint: Don't use \qco{} for long message
2023-04-29 23:05 ` [PATCH -perfbook 1/7] formal/spinhint: Don't use \qco{} for long message Akira Yokosawa
@ 2023-04-29 23:40 ` SeongJae Park
0 siblings, 0 replies; 12+ messages in thread
From: SeongJae Park @ 2023-04-29 23:40 UTC (permalink / raw)
To: Akira Yokosawa; +Cc: Paul E. McKenney, SeongJae Park, perfbook
On Sun, 30 Apr 2023 08:05:30 +0900 Akira Yokosawa <akiyks@gmail.com> wrote:
> \qco{} is intended to be used for short snippets and suppresses line
> breaks in its argument by using \nbco{} in its definition.
> Commit 88fd12717c61 ("formal/spinhint: Use \qco{} instead of``\co{}''")
> applied \qco{} for a long error message.
> It causes "Underfull \hbox" of large badness preceding it.
>
> In perfbook-1c.log and perfbook-eb.log:
>
> Underfull \hbox (badness 10000) in paragraph at lines 277--281
> []\T1/ntxtlf/m/n/10 (+20) If you see a mes-sage from [][][][] say-ing:
> []
>
> In perfbook.log:
>
> Underfull \hbox (badness 2495) in paragraph at lines 277--281
> []\T1/ntxtlf/m/n/10 (+20) If you see a mes-sage from [][][][] say-ing:
> []
>
> Revert the change and permit line breaks in the middle of the quoted
> message.
Thank you for fixing this, Akira!
>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> Cc: SeongJae Park <sj38.park@gmail.com>
Reviewed-by: SeongJae Park <sj38.park@gmail.com>
Thanks,
SJ
> ---
> formal/spinhint.tex | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/formal/spinhint.tex b/formal/spinhint.tex
> index 9bb5f5749470..16764aef8620 100644
> --- a/formal/spinhint.tex
> +++ b/formal/spinhint.tex
> @@ -275,7 +275,7 @@ Given a source file \path{qrcu.spin}, one can use the following commands:
> 10.5\,GB of memory even with the \co{-DCOLLAPSE} flag.
>
> If you see a message from \co{./pan} saying:
> - \qco{error: max search depth too small}, you need to increase
> + ``\co{error: max search depth too small}'', you need to increase
> the maximum depth by a \co{-mN} option for a complete search.
> The default is \co{-m10000}.
>
> --
> 2.25.1
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH -perfbook 2/7] formal/ppcmem: Use \qco{} as intended
2023-04-29 23:01 [PATCH -perfbook 0/7] Collection of minor fixes and updates Akira Yokosawa
2023-04-29 23:05 ` [PATCH -perfbook 1/7] formal/spinhint: Don't use \qco{} for long message Akira Yokosawa
@ 2023-04-29 23:07 ` Akira Yokosawa
2023-04-29 23:41 ` SeongJae Park
2023-04-29 23:08 ` [PATCH -perfbook 3/7] Add acronyms of LKMM and KCSAN Akira Yokosawa
` (4 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Akira Yokosawa @ 2023-04-29 23:07 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: SeongJae Park, perfbook, Akira Yokosawa
Commit f87fadc4c8ea ("formal/ppcmem: Use \qco{} instead of ``\co{}''")
did not use \qco{} in one of the hunks.
Use \qco{} as intended.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Cc: SeongJae Park <sj38.park@gmail.com>
---
formal/ppcmem.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/formal/ppcmem.tex b/formal/ppcmem.tex
index 10526bca88ae..9d7704fa43d0 100644
--- a/formal/ppcmem.tex
+++ b/formal/ppcmem.tex
@@ -99,7 +99,7 @@ exists @lnlbl[assert:b]
\begin{fcvref}[ln:formal:PPCMEM Litmus Test]
In the example, \clnref{type} identifies the type of system (\qco{ARM} or
-\co{PPC}) and contains the title for the model.
+\qco{PPC}) and contains the title for the model.
\Clnref{altname} provides a place for an
alternative name for the test, which you will usually want to leave
blank as shown in the above example.
--
2.25.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH -perfbook 2/7] formal/ppcmem: Use \qco{} as intended
2023-04-29 23:07 ` [PATCH -perfbook 2/7] formal/ppcmem: Use \qco{} as intended Akira Yokosawa
@ 2023-04-29 23:41 ` SeongJae Park
2023-04-30 0:26 ` Paul E. McKenney
0 siblings, 1 reply; 12+ messages in thread
From: SeongJae Park @ 2023-04-29 23:41 UTC (permalink / raw)
To: Akira Yokosawa; +Cc: Paul E. McKenney, SeongJae Park, perfbook
On Sun, 30 Apr 2023 08:07:18 +0900 Akira Yokosawa <akiyks@gmail.com> wrote:
> Commit f87fadc4c8ea ("formal/ppcmem: Use \qco{} instead of ``\co{}''")
> did not use \qco{} in one of the hunks.
>
> Use \qco{} as intended.
Nice catch! Thank you for this fix!
>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> Cc: SeongJae Park <sj38.park@gmail.com>
Reviewed-by: SeongJae Park <sj38.park@gmail.com>
Thanks,
SJ
> ---
> formal/ppcmem.tex | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/formal/ppcmem.tex b/formal/ppcmem.tex
> index 10526bca88ae..9d7704fa43d0 100644
> --- a/formal/ppcmem.tex
> +++ b/formal/ppcmem.tex
> @@ -99,7 +99,7 @@ exists @lnlbl[assert:b]
>
> \begin{fcvref}[ln:formal:PPCMEM Litmus Test]
> In the example, \clnref{type} identifies the type of system (\qco{ARM} or
> -\co{PPC}) and contains the title for the model.
> +\qco{PPC}) and contains the title for the model.
> \Clnref{altname} provides a place for an
> alternative name for the test, which you will usually want to leave
> blank as shown in the above example.
> --
> 2.25.1
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH -perfbook 2/7] formal/ppcmem: Use \qco{} as intended
2023-04-29 23:41 ` SeongJae Park
@ 2023-04-30 0:26 ` Paul E. McKenney
0 siblings, 0 replies; 12+ messages in thread
From: Paul E. McKenney @ 2023-04-30 0:26 UTC (permalink / raw)
To: SeongJae Park; +Cc: Akira Yokosawa, perfbook
On Sat, Apr 29, 2023 at 04:41:37PM -0700, SeongJae Park wrote:
> On Sun, 30 Apr 2023 08:07:18 +0900 Akira Yokosawa <akiyks@gmail.com> wrote:
>
> > Commit f87fadc4c8ea ("formal/ppcmem: Use \qco{} instead of ``\co{}''")
> > did not use \qco{} in one of the hunks.
> >
> > Use \qco{} as intended.
>
> Nice catch! Thank you for this fix!
>
> >
> > Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> > Cc: SeongJae Park <sj38.park@gmail.com>
>
> Reviewed-by: SeongJae Park <sj38.park@gmail.com>
I pulled in these along with SeongJae's patches, thank you both!
Thanx, Paul
> Thanks,
> SJ
>
> > ---
> > formal/ppcmem.tex | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/formal/ppcmem.tex b/formal/ppcmem.tex
> > index 10526bca88ae..9d7704fa43d0 100644
> > --- a/formal/ppcmem.tex
> > +++ b/formal/ppcmem.tex
> > @@ -99,7 +99,7 @@ exists @lnlbl[assert:b]
> >
> > \begin{fcvref}[ln:formal:PPCMEM Litmus Test]
> > In the example, \clnref{type} identifies the type of system (\qco{ARM} or
> > -\co{PPC}) and contains the title for the model.
> > +\qco{PPC}) and contains the title for the model.
> > \Clnref{altname} provides a place for an
> > alternative name for the test, which you will usually want to leave
> > blank as shown in the above example.
> > --
> > 2.25.1
> >
> >
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH -perfbook 3/7] Add acronyms of LKMM and KCSAN
2023-04-29 23:01 [PATCH -perfbook 0/7] Collection of minor fixes and updates Akira Yokosawa
2023-04-29 23:05 ` [PATCH -perfbook 1/7] formal/spinhint: Don't use \qco{} for long message Akira Yokosawa
2023-04-29 23:07 ` [PATCH -perfbook 2/7] formal/ppcmem: Use \qco{} as intended Akira Yokosawa
@ 2023-04-29 23:08 ` Akira Yokosawa
2023-04-29 23:13 ` [PATCH -perfbook 4/7] CodeSamples/count: Adjust coding style Akira Yokosawa
` (3 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Akira Yokosawa @ 2023-04-29 23:08 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
LKMM and KCSAN deserve entries in the list of Acronyms
Add them.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
debugging/debugging.tex | 2 +-
formal/axiomatic.tex | 4 ++--
glsdict.tex | 2 ++
memorder/memorder.tex | 9 ++++-----
4 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/debugging/debugging.tex b/debugging/debugging.tex
index 191967baa810..42d69a9337fa 100644
--- a/debugging/debugging.tex
+++ b/debugging/debugging.tex
@@ -764,7 +764,7 @@ helpful in production.
An especially bad parallel-code something is unexpected concurrent
access to data.
-The Kernel Concurrency Sanitizer (KCSAN)~\cite{JonathanCorbet2019KCSAN}
+The \IXBacrfst{kcsan}~\cite{JonathanCorbet2019KCSAN}
uses existing markings such as \co{READ_ONCE()} and \co{WRITE_ONCE()}
to determine which concurrent accesses deserve warning messages.
KCSAN has a significant false-positive rate, especially from the
diff --git a/formal/axiomatic.tex b/formal/axiomatic.tex
index c970d3bb8382..04adec21c010 100644
--- a/formal/axiomatic.tex
+++ b/formal/axiomatic.tex
@@ -142,8 +142,8 @@ Axiomatic approaches may also be applied to higher-level
languages and also to higher-level synchronization primitives, as
exemplified by the lock-based litmus test shown in
\cref{lst:formal:Locking Example} (\path{C-Lock1.litmus}).
-This litmus test can be modeled by the Linux kernel memory model
-(LKMM)~\cite{Alglave:2018:FSC:3173162.3177156,LucMaranget2018lock.cat}.
+This litmus test can be modeled by
+the \IXacrf{lkmm}~\cite{Alglave:2018:FSC:3173162.3177156,LucMaranget2018lock.cat}.
As expected, the \co{herd} tool's output features the string \co{Never},
correctly indicating that \co{P1()} cannot see \co{x} having a value
of one.\footnote{
diff --git a/glsdict.tex b/glsdict.tex
index d14688590bbb..ce48154acf5f 100644
--- a/glsdict.tex
+++ b/glsdict.tex
@@ -230,6 +230,8 @@
\newacronym{gpgpu}{GPGPU}{general\-/purpose graphical processing unit}
\newacronym{irq}{IRQ}{interrupt request}
\newacronym{ipi}{IPI}{inter\-/processor interrupt}
+\newacronym{kcsan}{KCSAN}{kernel concurrency sanitizer}
+\newacronym{lkmm}{LKMM}{Linux kernel memory consistency model}
\newacronym{mpi}{MPI}{Message Passing Interface}
\newacronym{nbs}{NBS}{non-blocking synchronization}
\newacronym{nmi}{NMI}{non-maskable interrupt}
diff --git a/memorder/memorder.tex b/memorder/memorder.tex
index f116ab81aceb..47bde79b5abd 100644
--- a/memorder/memorder.tex
+++ b/memorder/memorder.tex
@@ -60,11 +60,10 @@ provides some reliable intuitions and useful rules of thumb.
along with a paper describing differences between the C11 and
Linux memory models~\cite{PaulEMcKenney2016P0124R6-LKMM}.
- The kernel concurrency sanitizer
- (KCSAN)~\cite{MarcoElver2020FearDataRaceDetector1,MarcoElver2020FearDataRaceDetector2},
+ The \IXacrf{kcsan}~\cite{MarcoElver2020FearDataRaceDetector1,MarcoElver2020FearDataRaceDetector2},
based in part on
RacerD~\cite{SamBlackshear2018RacerD}
- and implementing LKMM, has also been added to the Linux kernel
+ and implementing \IXacr{lkmm}, has also been added to the Linux kernel
and is now heavily used.
Finally, there are now better ways of describing LKMM.
@@ -3749,7 +3748,7 @@ For their part, weakly ordered systems might well choose to execute
the memory-barrier instructions required to guarantee both orderings,
possibly simplifying code making advanced use of combinations of locked
and lockless accesses.
-However, as noted earlier, LKMM chooses not to provide these additional
+However, as noted earlier, \IXacr{lkmm} chooses not to provide these additional
orderings, in part to avoid imposing performance penalties on the simpler
and more prevalent locking use cases.
Instead, the \co{smp_mb__after_spinlock()} and \co{smp_mb__after_unlock_lock()}
@@ -4997,7 +4996,7 @@ None of these instructions exactly match the semantics of Linux's
The \co{DMB} and \co{DSB} instructions have a recursive definition
of accesses ordered before and after the barrier, which has an effect
similar to that of \Power{}'s cumulativity, both of which are
-stronger than LKMM's cumulativity described in
+stronger than \IXacr{lkmm}'s cumulativity described in
\cref{sec:memorder:Cumulativity}.
\ARM\ also implements control dependencies, so that if a conditional
--
2.25.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH -perfbook 4/7] CodeSamples/count: Adjust coding style
2023-04-29 23:01 [PATCH -perfbook 0/7] Collection of minor fixes and updates Akira Yokosawa
` (2 preceding siblings ...)
2023-04-29 23:08 ` [PATCH -perfbook 3/7] Add acronyms of LKMM and KCSAN Akira Yokosawa
@ 2023-04-29 23:13 ` Akira Yokosawa
2023-04-29 23:16 ` [PATCH -perfbook 5/7] count: Adjust scaling factor of Listing 5.18 Akira Yokosawa
` (2 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Akira Yokosawa @ 2023-04-29 23:13 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Alan Huang, Akira Yokosawa
Recent removal of smp_mb() in count_lim.c made a couple of if blocks
one liner. Remove unneeded braces as per the Linux coding style.
While at it, make similar style fixes under CodeSamples/count as well
as align line-label tail comments.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Cc: Alan Huang <mmpgouride@gmail.com>
---
CodeSamples/count/count_lim.c | 5 +++--
CodeSamples/count/count_lim_atomic.c | 5 +++--
CodeSamples/count/count_lim_sig.c | 23 +++++++++++------------
CodeSamples/count/count_stat_eventual.c | 3 +--
CodeSamples/count/count_tstat.c | 3 ++-
count/count.tex | 5 ++---
6 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/CodeSamples/count/count_lim.c b/CodeSamples/count/count_lim.c
index db78445f2395..7e379d582342 100644
--- a/CodeSamples/count/count_lim.c
+++ b/CodeSamples/count/count_lim.c
@@ -79,9 +79,10 @@ static __inline__ unsigned long read_count(void) //\lnlbl{read:b}
spin_lock(&gblcnt_mutex); //\lnlbl{read:acquire}
sum = globalcount; //\lnlbl{read:initsum}
- for_each_thread(t) //\lnlbl{read:loop:b}
+ for_each_thread(t) { //\lnlbl{read:loop:b}
if (counterp[t] != NULL)
- sum += READ_ONCE(*counterp[t]); //\lnlbl{read:loop:e}
+ sum += READ_ONCE(*counterp[t]);
+ } //\lnlbl{read:loop:e}
spin_unlock(&gblcnt_mutex); //\lnlbl{read:release}
return sum; //\lnlbl{read:return}
} //\lnlbl{read:e}
diff --git a/CodeSamples/count/count_lim_atomic.c b/CodeSamples/count/count_lim_atomic.c
index 20d9612d6992..8c4dcc75989e 100644
--- a/CodeSamples/count/count_lim_atomic.c
+++ b/CodeSamples/count/count_lim_atomic.c
@@ -171,11 +171,12 @@ unsigned long read_count(void) //\lnlbl{b}
spin_lock(&gblcnt_mutex); //\lnlbl{acquire}
sum = globalcount; //\lnlbl{initsum}
- for_each_thread(t) //\lnlbl{loop:b}
+ for_each_thread(t) { //\lnlbl{loop:b}
if (counterp[t] != NULL) {
split_counterandmax(counterp[t], &old, &c, &cm);//\lnlbl{split}
sum += c;
- } //\lnlbl{loop:e}
+ }
+ } //\lnlbl{loop:e}
spin_unlock(&gblcnt_mutex); //\lnlbl{release}
return sum; //\lnlbl{return}
} //\lnlbl{e}
diff --git a/CodeSamples/count/count_lim_sig.c b/CodeSamples/count/count_lim_sig.c
index c2f611976466..8d6c3ca3def5 100644
--- a/CodeSamples/count/count_lim_sig.c
+++ b/CodeSamples/count/count_lim_sig.c
@@ -57,9 +57,8 @@ static void flush_local_count_sig(int unused) //\lnlbl{flush_sig:b}
if (READ_ONCE(theft) != THEFT_REQ) //\lnlbl{flush_sig:check:REQ}
return; //\lnlbl{flush_sig:return:n}
WRITE_ONCE(theft, THEFT_ACK); //\lnlbl{flush_sig:set:ACK}
- if (!counting) { //\lnlbl{flush_sig:check:fast}
+ if (!counting) //\lnlbl{flush_sig:check:fast}
smp_store_release(&theft, THEFT_READY); //\lnlbl{flush_sig:set:READY}
- }
} //\lnlbl{flush_sig:e}
static void flush_local_count(void) //\lnlbl{flush:b}
@@ -67,7 +66,7 @@ static void flush_local_count(void) //\lnlbl{flush:b}
int t;
thread_id_t tid;
- for_each_tid(t, tid) //\lnlbl{flush:loop:b}
+ for_each_tid(t, tid) { //\lnlbl{flush:loop:b}
if (theftp[t] != NULL) { //\lnlbl{flush:skip}
if (*countermaxp[t] == 0) { //\lnlbl{flush:checkmax}
WRITE_ONCE(*theftp[t], THEFT_READY);//\lnlbl{flush:READY}
@@ -75,7 +74,8 @@ static void flush_local_count(void) //\lnlbl{flush:b}
}
WRITE_ONCE(*theftp[t], THEFT_REQ);//\lnlbl{flush:REQ}
pthread_kill(tid, SIGUSR1); //\lnlbl{flush:signal}
- } //\lnlbl{flush:loop:e}
+ }
+ } //\lnlbl{flush:loop:e}
for_each_tid(t, tid) { //\lnlbl{flush:loop2:b}
if (theftp[t] == NULL) //\lnlbl{flush:skip:nonexist}
continue; //\lnlbl{flush:next2}
@@ -88,7 +88,7 @@ static void flush_local_count(void) //\lnlbl{flush:b}
*counterp[t] = 0;
globalreserve -= *countermaxp[t];
*countermaxp[t] = 0; //\lnlbl{flush:thiev:e}
- smp_store_release(theftp[t], THEFT_IDLE); //\lnlbl{flush:IDLE}
+ smp_store_release(theftp[t], THEFT_IDLE);//\lnlbl{flush:IDLE}
} //\lnlbl{flush:loop2:e}
} //\lnlbl{flush:e}
@@ -114,7 +114,7 @@ int add_count(unsigned long delta) //\lnlbl{b}
WRITE_ONCE(counting, 1); //\lnlbl{fast:b}
barrier(); //\lnlbl{barrier:1}
- if (smp_load_acquire(&theft) <= THEFT_REQ && //\lnlbl{check:b}
+ if (smp_load_acquire(&theft) <= THEFT_REQ && //\lnlbl{check:b}
countermax - counter >= delta) { //\lnlbl{check:e}
WRITE_ONCE(counter, counter + delta); //\lnlbl{add:f}
fastpath = 1; //\lnlbl{fasttaken}
@@ -122,9 +122,8 @@ int add_count(unsigned long delta) //\lnlbl{b}
barrier(); //\lnlbl{barrier:2}
WRITE_ONCE(counting, 0); //\lnlbl{clearcnt}
barrier(); //\lnlbl{barrier:3}
- if (READ_ONCE(theft) == THEFT_ACK) { //\lnlbl{check:ACK}
- smp_store_release(&theft, THEFT_READY); //\lnlbl{READY}
- }
+ if (READ_ONCE(theft) == THEFT_ACK) //\lnlbl{check:ACK}
+ smp_store_release(&theft, THEFT_READY); //\lnlbl{READY}
if (fastpath)
return 1; //\lnlbl{return:fs}
spin_lock(&gblcnt_mutex); //\lnlbl{acquire}
@@ -160,9 +159,8 @@ int sub_count(unsigned long delta)
barrier();
WRITE_ONCE(counting, 0);
barrier();
- if (READ_ONCE(theft) == THEFT_ACK) {
+ if (READ_ONCE(theft) == THEFT_ACK)
smp_store_release(&theft, THEFT_READY);
- }
if (fastpath)
return 1;
spin_lock(&gblcnt_mutex);
@@ -189,9 +187,10 @@ unsigned long read_count(void)
spin_lock(&gblcnt_mutex);
sum = globalcount;
- for_each_thread(t)
+ for_each_thread(t) {
if (counterp[t] != NULL)
sum += READ_ONCE(*counterp[t]);
+ }
spin_unlock(&gblcnt_mutex);
return sum;
}
diff --git a/CodeSamples/count/count_stat_eventual.c b/CodeSamples/count/count_stat_eventual.c
index 7157ee0ed9fd..ed081e9102cd 100644
--- a/CodeSamples/count/count_stat_eventual.c
+++ b/CodeSamples/count/count_stat_eventual.c
@@ -50,9 +50,8 @@ void *eventual(void *arg) //\lnlbl{eventual:b}
sum += READ_ONCE(per_thread(counter, t));
WRITE_ONCE(global_count, sum);
poll(NULL, 0, 1);
- if (READ_ONCE(stopflag)) {
+ if (READ_ONCE(stopflag))
smp_store_release(&stopflag, stopflag + 1);
- }
}
return NULL;
} //\lnlbl{eventual:e}
diff --git a/CodeSamples/count/count_tstat.c b/CodeSamples/count/count_tstat.c
index 127946f32196..d7b4e335f07b 100644
--- a/CodeSamples/count/count_tstat.c
+++ b/CodeSamples/count/count_tstat.c
@@ -40,9 +40,10 @@ static __inline__ unsigned long read_count(void)
int t;
unsigned long sum = 0;
- for_each_thread(t)
+ for_each_thread(t) {
if (READ_ONCE(counterp[t]) != NULL)
sum += READ_ONCE(*counterp[t]);
+ }
return sum;
}
diff --git a/count/count.tex b/count/count.tex
index 7b2fde109490..3b8b1c113486 100644
--- a/count/count.tex
+++ b/count/count.tex
@@ -2763,9 +2763,8 @@ write_lock(&mylock); \lnlbl[acq]
removing = 1; \lnlbl[note]
sub_count(mybias);
write_unlock(&mylock); \lnlbl[rel]
-while (read_count() != 0) { \lnlbl[loop:b]
- poll(NULL, 0, 1);
-} \lnlbl[loop:e]
+while (read_count() != 0) \lnlbl[loop:b]
+ poll(NULL, 0, 1); \lnlbl[loop:e]
remove_device(); \lnlbl[remove]
\end{VerbatimN}
\end{fcvlabel}
--
2.25.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH -perfbook 5/7] count: Adjust scaling factor of Listing 5.18
2023-04-29 23:01 [PATCH -perfbook 0/7] Collection of minor fixes and updates Akira Yokosawa
` (3 preceding siblings ...)
2023-04-29 23:13 ` [PATCH -perfbook 4/7] CodeSamples/count: Adjust coding style Akira Yokosawa
@ 2023-04-29 23:16 ` Akira Yokosawa
2023-04-29 23:22 ` [PATCH -perfbook 6/7] Tweak TOC width params Akira Yokosawa
2023-04-29 23:23 ` [PATCH -perfbook 7/7] precheck.sh: Export LC_TIME Akira Yokosawa
6 siblings, 0 replies; 12+ messages in thread
From: Akira Yokosawa @ 2023-04-29 23:16 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Alan Huang, Akira Yokosawa
Recent code updates reduce the line count of this snippet.
Use a scaling factor closer to 1.0 for E-Book size builds.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Cc: Alan Huang <mmpgouride@gmail.com>
---
count/count.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/count/count.tex b/count/count.tex
index 3b8b1c113486..48e3f03d4ce2 100644
--- a/count/count.tex
+++ b/count/count.tex
@@ -2434,7 +2434,7 @@ the fastpath happens before this change of \co{theft} to READY\@.
\end{fcvref}
\begin{listing}
-\ebresizeverb{.81}{\input{CodeSamples/count/count_lim_sig@migration.fcv}}
+\ebresizeverb{.839}{\input{CodeSamples/count/count_lim_sig@migration.fcv}}
\caption{Signal-Theft Limit Counter Value-Migration Functions}
\label{lst:count:Signal-Theft Limit Counter Value-Migration Functions}
\end{listing}
--
2.25.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH -perfbook 6/7] Tweak TOC width params
2023-04-29 23:01 [PATCH -perfbook 0/7] Collection of minor fixes and updates Akira Yokosawa
` (4 preceding siblings ...)
2023-04-29 23:16 ` [PATCH -perfbook 5/7] count: Adjust scaling factor of Listing 5.18 Akira Yokosawa
@ 2023-04-29 23:22 ` Akira Yokosawa
2023-04-30 0:30 ` Paul E. McKenney
2023-04-29 23:23 ` [PATCH -perfbook 7/7] precheck.sh: Export LC_TIME Akira Yokosawa
6 siblings, 1 reply; 12+ messages in thread
From: Akira Yokosawa @ 2023-04-29 23:22 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
We now have Section 15.5.10, (five digits + two periods).
Default of the book class can not afford that much digits in
subsection count.
Increase width parameters to accomodate it.
Also, as for -sf builds, the Helvetica clone font needs slightly
wider spaces in the "em" unit. Add settings for -sf builds.
Mention default widths in the comment block for future reference.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
perfbook-lt.tex | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/perfbook-lt.tex b/perfbook-lt.tex
index cdac9d495a3a..af5e0bf30032 100644
--- a/perfbook-lt.tex
+++ b/perfbook-lt.tex
@@ -158,11 +158,28 @@
\setboolean{indexhier}{true}
\newcommand{\IfIndexHier}[2]{\ifthenelse{\boolean{indexhier}}{#1}{#2}}
-% Widen pnumwidth in TOC for ebook size build (more than 1000 pages)
+% Tweak width params of TOC
\makeatletter
-\IfEbookSize{
+\IfEbookSize{ % for ebook size build (more than 1000 pages)
\renewcommand*\@pnumwidth{2.2em}
}{}
+% default params defined in book.sty:
+% width of chapter (two digits): 1.5em
+% indent of section: 1.5em
+% width of section (three digits + one periods): 2.3em
+% indent of subsection: 3.8em
+% width of subsection (four digits + two periods): 3.2em
+\IfSansSerif{ % sans serif (Helvetica clone)
+ % to cover section "E.10" and subsection "15.5.10",
+ % width of section: 2.4em
+ % width of subsection: 3.7em
+\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.4em}}
+\renewcommand*\l@subsection{\@dottedtocline{2}{3.9em}{3.7em}}
+}{ % serif (Times Roman clone)
+ % to cover subsection "15.5.10",
+ % width of subsection: 3.4em
+\renewcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.4em}}
+}
\makeatother
\IfEbookSize{
--
2.25.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH -perfbook 6/7] Tweak TOC width params
2023-04-29 23:22 ` [PATCH -perfbook 6/7] Tweak TOC width params Akira Yokosawa
@ 2023-04-30 0:30 ` Paul E. McKenney
0 siblings, 0 replies; 12+ messages in thread
From: Paul E. McKenney @ 2023-04-30 0:30 UTC (permalink / raw)
To: Akira Yokosawa; +Cc: perfbook
On Sun, Apr 30, 2023 at 08:22:29AM +0900, Akira Yokosawa wrote:
> We now have Section 15.5.10, (five digits + two periods).
> Default of the book class can not afford that much digits in
> subsection count.
> Increase width parameters to accomodate it.
>
> Also, as for -sf builds, the Helvetica clone font needs slightly
> wider spaces in the "em" unit. Add settings for -sf builds.
>
> Mention default widths in the comment block for future reference.
>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
And I also pulled in the rest of these patches, thank you!
Huh. Maybe this is a hint that I should drop one of the CPU families.
Alpha and Itanium would be good candidates except for their historical
significance. ARM7 and PowerPC are significant in being non-multicopy
atomic. z Systems is significant in being fully multicopy atomic (as
opposed to merely other-multicopy atomic). Armv8 and x86 are heavily
used. MIPS appears to feed directly into LoongArch, which may prove to
be a candidate for addition, as might RISC-V. That leaves SPARC.
But that means I would be removing one and adding two, so this patch
would still be required.
So it goes! ;-)
Thanx, Paul
> ---
> perfbook-lt.tex | 21 +++++++++++++++++++--
> 1 file changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/perfbook-lt.tex b/perfbook-lt.tex
> index cdac9d495a3a..af5e0bf30032 100644
> --- a/perfbook-lt.tex
> +++ b/perfbook-lt.tex
> @@ -158,11 +158,28 @@
> \setboolean{indexhier}{true}
> \newcommand{\IfIndexHier}[2]{\ifthenelse{\boolean{indexhier}}{#1}{#2}}
>
> -% Widen pnumwidth in TOC for ebook size build (more than 1000 pages)
> +% Tweak width params of TOC
> \makeatletter
> -\IfEbookSize{
> +\IfEbookSize{ % for ebook size build (more than 1000 pages)
> \renewcommand*\@pnumwidth{2.2em}
> }{}
> +% default params defined in book.sty:
> +% width of chapter (two digits): 1.5em
> +% indent of section: 1.5em
> +% width of section (three digits + one periods): 2.3em
> +% indent of subsection: 3.8em
> +% width of subsection (four digits + two periods): 3.2em
> +\IfSansSerif{ % sans serif (Helvetica clone)
> + % to cover section "E.10" and subsection "15.5.10",
> + % width of section: 2.4em
> + % width of subsection: 3.7em
> +\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.4em}}
> +\renewcommand*\l@subsection{\@dottedtocline{2}{3.9em}{3.7em}}
> +}{ % serif (Times Roman clone)
> + % to cover subsection "15.5.10",
> + % width of subsection: 3.4em
> +\renewcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.4em}}
> +}
> \makeatother
>
> \IfEbookSize{
> --
> 2.25.1
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH -perfbook 7/7] precheck.sh: Export LC_TIME
2023-04-29 23:01 [PATCH -perfbook 0/7] Collection of minor fixes and updates Akira Yokosawa
` (5 preceding siblings ...)
2023-04-29 23:22 ` [PATCH -perfbook 6/7] Tweak TOC width params Akira Yokosawa
@ 2023-04-29 23:23 ` Akira Yokosawa
6 siblings, 0 replies; 12+ messages in thread
From: Akira Yokosawa @ 2023-04-29 23:23 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
The check script doesn't work properly under non-English locale
settings due to missing "export".
Fix it.
Fixes: 0c852f175f8e ("Add precheck.sh")
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
utilities/precheck.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utilities/precheck.sh b/utilities/precheck.sh
index 7de0e9fba328..d98bb0de90ce 100755
--- a/utilities/precheck.sh
+++ b/utilities/precheck.sh
@@ -6,7 +6,7 @@
#
# Copyright (C) Akira Yokosawa, 2023
-LC_TIME=C
+export LC_TIME=C
: ${SED:=sed}
: ${DATE:=date}
--
2.25.1
^ permalink raw reply related [flat|nested] 12+ messages in thread