Collection of small fixes and updates
cover Collection of small fixes and updates
Hi Paul,
(Cc: Junchang, Elad)
I've got somewhat distracted and couldn't properly compose change logs of patches I collected in a work-in-progress branch. Finally I managed to update the style guide to reflect enhancements in fcvextract.pl and amend the commit logs.
Patch #1 was the one presented to Junchang as an example to combine two code fragments in a code snippet.
Patch #2 applies the new scheme to another fragment in rcu_nest.h, which was updated by Junchang.
Patch #3 fixes type reported by Elad.
Patch #4 updates FAQ-BUILD.txt for F29 and F30 users. Patch #5 removes remnant of quantum computing.
Patch #6 applies the new scheme to another fragment in rcu.h, which was also updated by Junchang.
Patch #7 is the update of style guide
Patches #1, #2, #3, and #6 are CC'd to Junchang or Elad. I don't think their Acks are musts in these cases, but would highly appreciate them.
Thanks, Akira
--
Akira Yokosawa (7):
toyrcu: Convert Listing B.1 to new scheme
toyrcu: Extract Listing B.15 from rcu_nest.h
toolsoftrade: Fix typo
FAQ-BUILD: Update for recent Fedora releases
howto: Stop mentioning quantum computing
toyrcu: Extract Listing B.13 from rcu.h
styleguide: Update description of available options to \begin{snippet}
CodeSamples/defer/rcu.h | 2 + CodeSamples/defer/rcu_lock.c | 2 + CodeSamples/defer/rcu_lock.h | 2 + CodeSamples/defer/rcu_nest.h | 2 + FAQ-BUILD.txt | 9 +-- appendix/styleguide/samplecodesnippet.c | 2 +- appendix/styleguide/styleguide.tex | 76 +++++++++++++++---------- appendix/toyrcu/toyrcu.tex | 50 ++-------------- howto/howto.tex | 2 +- toolsoftrade/toolsoftrade.tex | 2 +- 10 files changed, 66 insertions(+), 83 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/7 toyrcu: Convert Listing B.1 to new scheme
From 245899f43fd007aa344180c0089515cd90f84db2 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 27 Apr 2019 21:04:40 +0900
Subject: [PATCH 1/7] toyrcu: Convert Listing B.1 to new scheme
This commit was originally presented to Junchang as an example where code fragments extracted from two source files under CodeSamples/ are merged into a code snippet.
Junchan employed this scheme in commits 686f3f3b721c ("rcu: Use READ_ONCE() and WRITE_ONCE() for shared variable rcu_gp_ctr"), a26c1625bb0d ("rcu_qs: Use READ_ONCE() AND WRITE_ONCE() for shared variable rcu_gp_ctr"), and b9696a4a456f ("rcu_nest: Update description of rcu_nest.[hc]").
Extra vertical space needs to be canceled by the \vspace*{} command between the two \input{} commands. \fvset{firstnumber=last} is to continue line numbering. \fvset{firstnumber=auto} restores the default setting.
Also tweak positioning option of the listing environment.
--- CodeSamples/defer/rcu_lock.c | 2 ++ CodeSamples/defer/rcu_lock.h | 2 ++ appendix/toyrcu/toyrcu.tex | 26 ++++---------------------- 3 files changed, 8 insertions(+), 22 deletions(-)
CodeSamples/defer/rcu_lock.c +2 -0
@@ -20,12 +20,14 @@#include "../api.h" #include "rcu_lock.h" +//\begin{snippet}[labelbase=ln:defer:rcu_lock:synchronize,commandchars=\\\[\]] void synchronize_rcu (void ) {spin_lock (&rcu_gp_lock);spin_unlock (&rcu_gp_lock); } +//\end{snippet} #ifdef TEST #include "rcutorture.h"
CodeSamples/defer/rcu_lock.h +2 -0
@@ -26,6 +26,7 @@ static void rcu_init(void) { } +//\begin{snippet}[labelbase=ln:defer:rcu_lock:lock_unlock,commandchars=\\\[\]] static void rcu_read_lock (void ) {spin_lock (&rcu_gp_lock);
@@ -35,5 +36,6 @@ static void rcu_read_unlock(void) {spin_unlock (&rcu_gp_lock); } +//\end{snippet} extern void synchronize_rcu (void );
appendix/toyrcu/toyrcu.tex +4 -22
@@ -30,29 +30,11 @@ provides a summary and a list of desirable RCU properties. \section{Lock-Based RCU} \label{sec:app:toyrcu:Lock-Based RCU} +\NoIndentAfterThis -\begin{listing}[bp] -{ \scriptsize -\begin{verbbox} - 1 static void rcu_read_lock(void) - 2 { - 3 spin_lock(&rcu_gp_lock); - 4 } - 5 - 6 static void rcu_read_unlock(void) - 7 { - 8 spin_unlock(&rcu_gp_lock); - 9 } - 10 - 11 void synchronize_rcu(void) - 12 { - 13 spin_lock(&rcu_gp_lock); - 14 spin_unlock(&rcu_gp_lock); - 15 } -\end{verbbox} -} -\centering -\theverbbox +\begin{listing}[htbp] +\input{CodeSamples/defer/rcu_lock@lock_unlock.fcv}\vspace*{-11pt}\fvset{firstnumber=last} +\input{CodeSamples/defer/[email protected]}\fvset{firstnumber=auto} \caption{Lock-Based RCU Implementation} \label{lst:app:toyrcu:Lock-Based RCU Implementation} \end{listing}
Signature · 1 line
2.17.1
Re: [PATCH 1/7] toyrcu: Convert Listing B.1 to new scheme
Hi Akira,
Thanks for the patch. The new scheme worked great as a good example of composing my commits. So,
Thanks,
--Junchang
Quoted 111 lines · Akira Yokosawa
From
245899f43fd007aa344180c0089515cd90f84db2Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 27 Apr 2019 21:04:40 +0900
Subject: [PATCH 1/7] toyrcu: Convert Listing B.1 to new schemeThis commit was originally presented to Junchang as an example where code fragments extracted from two source files under CodeSamples/ are merged into a code snippet.
Junchan employed this scheme in commits
686f3f3b721c("rcu: UseREAD_ONCE()andWRITE_ONCE()for shared variablercu_gp_ctr"),a26c1625bb0d("rcu_qs: UseREAD_ONCE()ANDWRITE_ONCE()for shared variablercu_gp_ctr"), andb9696a4a456f("rcu_nest: Update description of rcu_nest.[hc]").Extra vertical space needs to be canceled by the \vspace*{} command between the two \input{} commands. \fvset{firstnumber=last} is to continue line numbering. \fvset{firstnumber=auto} restores the default setting.
Also tweak positioning option of the listing environment.
Cc Junchang Wang <[email protected]>Signed-off-by Akira Yokosawa <[email protected]>--- CodeSamples/defer/rcu_lock.c | 2 ++ CodeSamples/defer/rcu_lock.h | 2 ++ appendix/toyrcu/toyrcu.tex | 26 ++++---------------------- 3 files changed, 8 insertions(+), 22 deletions(-)CodeSamples/defer/rcu_lock.c +2
-0@@ -20,12 +20,14 @@#include "../api.h" #include "rcu_lock.h" +//\begin{snippet}[labelbase=ln:defer:rcu_lock:synchronize,commandchars=\\\[\]] void synchronize_rcu (void ) {spin_lock (&rcu_gp_lock);spin_unlock (&rcu_gp_lock); } +//\end{snippet} #ifdef TEST #include "rcutorture.h" CodeSamples/defer/rcu_lock.h +2
-0@@ -26,6 +26,7 @@ static void rcu_init(void) { } +//\begin{snippet}[labelbase=ln:defer:rcu_lock:lock_unlock,commandchars=\\\[\]] static void rcu_read_lock (void ) {spin_lock (&rcu_gp_lock);@@ -35,5 +36,6 @@ static void rcu_read_unlock(void) {spin_unlock (&rcu_gp_lock); } +//\end{snippet} extern void synchronize_rcu (void );appendix/toyrcu/toyrcu.tex +4
-23@@ -30,29 +30,11 @@ provides a summary and a list of desirable RCU properties. \section{Lock-Based RCU} \label{sec:app:toyrcu:Lock-Based RCU} +\NoIndentAfterThis -\begin{listing}[bp] -{ \scriptsize -\begin{verbbox} - 1 static void rcu_read_lock(void) - 2 { - 3 spin_lock(&rcu_gp_lock); - 4 } - 5 - 6 static void rcu_read_unlock(void) - 7 { - 8 spin_unlock(&rcu_gp_lock); - 9 } - 10 - 11 void synchronize_rcu(void) - 12 { - 13 spin_lock(&rcu_gp_lock); - 14 spin_unlock(&rcu_gp_lock); - 15 } -\end{verbbox} -} -\centering -\theverbbox +\begin{listing}[htbp] +\input{CodeSamples/defer/rcu_lock@lock_unlock.fcv}\vspace*{-11pt}\fvset{firstnumber=last} +\input{CodeSamples/defer/[email protected]}\fvset{firstnumber=auto} \caption{Lock-Based RCU Implementation} \label{lst:app:toyrcu:Lock-Based RCU Implementation} \end{listing} --2.17.1
Re: [PATCH 1/7] toyrcu: Convert Listing B.1 to new scheme
Quoted 6 lines · Junchang Wang
Hi Akira,
Thanks for the patch. The new scheme worked great as a good example of composing my commits. So,
Acked-by Junchang Wang <[email protected]>
Thank you both! I have queued and pushed this series, with Junchang's ack on this patch.
Thanx, Paul
Quoted 116 lines
Thanks,
--JunchangQuoted 111 lines · Akira Yokosawa
From
245899f43fd007aa344180c0089515cd90f84db2Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 27 Apr 2019 21:04:40 +0900
Subject: [PATCH 1/7] toyrcu: Convert Listing B.1 to new schemeThis commit was originally presented to Junchang as an example where code fragments extracted from two source files under CodeSamples/ are merged into a code snippet.
Junchan employed this scheme in commits
686f3f3b721c("rcu: UseREAD_ONCE()andWRITE_ONCE()for shared variablercu_gp_ctr"),a26c1625bb0d("rcu_qs: UseREAD_ONCE()ANDWRITE_ONCE()for shared variablercu_gp_ctr"), andb9696a4a456f("rcu_nest: Update description of rcu_nest.[hc]").Extra vertical space needs to be canceled by the \vspace*{} command between the two \input{} commands. \fvset{firstnumber=last} is to continue line numbering. \fvset{firstnumber=auto} restores the default setting.
Also tweak positioning option of the listing environment.
Cc Junchang Wang <[email protected]>Signed-off-by Akira Yokosawa <[email protected]>--- CodeSamples/defer/rcu_lock.c | 2 ++ CodeSamples/defer/rcu_lock.h | 2 ++ appendix/toyrcu/toyrcu.tex | 26 ++++---------------------- 3 files changed, 8 insertions(+), 22 deletions(-)CodeSamples/defer/rcu_lock.c +2
-0@@ -20,12 +20,14 @@#include "../api.h" #include "rcu_lock.h" +//\begin{snippet}[labelbase=ln:defer:rcu_lock:synchronize,commandchars=\\\[\]] void synchronize_rcu (void ) {spin_lock (&rcu_gp_lock);spin_unlock (&rcu_gp_lock); } +//\end{snippet} #ifdef TEST #include "rcutorture.h" CodeSamples/defer/rcu_lock.h +2
-0@@ -26,6 +26,7 @@ static void rcu_init(void) { } +//\begin{snippet}[labelbase=ln:defer:rcu_lock:lock_unlock,commandchars=\\\[\]] static void rcu_read_lock (void ) {spin_lock (&rcu_gp_lock);@@ -35,5 +36,6 @@ static void rcu_read_unlock(void) {spin_unlock (&rcu_gp_lock); } +//\end{snippet} extern void synchronize_rcu (void );appendix/toyrcu/toyrcu.tex +4
-23@@ -30,29 +30,11 @@ provides a summary and a list of desirable RCU properties. \section{Lock-Based RCU} \label{sec:app:toyrcu:Lock-Based RCU} +\NoIndentAfterThis -\begin{listing}[bp] -{ \scriptsize -\begin{verbbox} - 1 static void rcu_read_lock(void) - 2 { - 3 spin_lock(&rcu_gp_lock); - 4 } - 5 - 6 static void rcu_read_unlock(void) - 7 { - 8 spin_unlock(&rcu_gp_lock); - 9 } - 10 - 11 void synchronize_rcu(void) - 12 { - 13 spin_lock(&rcu_gp_lock); - 14 spin_unlock(&rcu_gp_lock); - 15 } -\end{verbbox} -} -\centering -\theverbbox +\begin{listing}[htbp] +\input{CodeSamples/defer/rcu_lock@lock_unlock.fcv}\vspace*{-11pt}\fvset{firstnumber=last} +\input{CodeSamples/defer/[email protected]}\fvset{firstnumber=auto} \caption{Lock-Based RCU Implementation} \label{lst:app:toyrcu:Lock-Based RCU Implementation} \end{listing} --2.17.1
Re: [PATCH 1/7] toyrcu: Convert Listing B.1 to new scheme
Quoted 10 lines · Paul E. McKenney
Quoted 6 lines · Junchang Wang
Hi Akira,
Thanks for the patch. The new scheme worked great as a good example of composing my commits. So,
Acked-by Junchang Wang <[email protected]>Thank you both! I have queued and pushed this series, with Junchang's ack on this patch.
Paul, could you also pick up Junchang's other acks on patches 2/7 and 6/7 ?
Thanks, Akira
Quoted 120 lines
Thanx, Paul
Quoted 116 lines
Thanks,
--JunchangQuoted 111 lines · Akira Yokosawa
From
245899f43fd007aa344180c0089515cd90f84db2Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 27 Apr 2019 21:04:40 +0900
Subject: [PATCH 1/7] toyrcu: Convert Listing B.1 to new schemeThis commit was originally presented to Junchang as an example where code fragments extracted from two source files under CodeSamples/ are merged into a code snippet.
Junchan employed this scheme in commits
686f3f3b721c("rcu: UseREAD_ONCE()andWRITE_ONCE()for shared variablercu_gp_ctr"),a26c1625bb0d("rcu_qs: UseREAD_ONCE()ANDWRITE_ONCE()for shared variablercu_gp_ctr"), andb9696a4a456f("rcu_nest: Update description of rcu_nest.[hc]").Extra vertical space needs to be canceled by the \vspace*{} command between the two \input{} commands. \fvset{firstnumber=last} is to continue line numbering. \fvset{firstnumber=auto} restores the default setting.
Also tweak positioning option of the listing environment.
Cc Junchang Wang <[email protected]>Signed-off-by Akira Yokosawa <[email protected]>--- CodeSamples/defer/rcu_lock.c | 2 ++ CodeSamples/defer/rcu_lock.h | 2 ++ appendix/toyrcu/toyrcu.tex | 26 ++++---------------------- 3 files changed, 8 insertions(+), 22 deletions(-)CodeSamples/defer/rcu_lock.c +2
-0@@ -20,12 +20,14 @@#include "../api.h" #include "rcu_lock.h" +//\begin{snippet}[labelbase=ln:defer:rcu_lock:synchronize,commandchars=\\\[\]] void synchronize_rcu (void ) {spin_lock (&rcu_gp_lock);spin_unlock (&rcu_gp_lock); } +//\end{snippet} #ifdef TEST #include "rcutorture.h" CodeSamples/defer/rcu_lock.h +2
-0@@ -26,6 +26,7 @@ static void rcu_init(void) { } +//\begin{snippet}[labelbase=ln:defer:rcu_lock:lock_unlock,commandchars=\\\[\]] static void rcu_read_lock (void ) {spin_lock (&rcu_gp_lock);@@ -35,5 +36,6 @@ static void rcu_read_unlock(void) {spin_unlock (&rcu_gp_lock); } +//\end{snippet} extern void synchronize_rcu (void );appendix/toyrcu/toyrcu.tex +4
-23@@ -30,29 +30,11 @@ provides a summary and a list of desirable RCU properties. \section{Lock-Based RCU} \label{sec:app:toyrcu:Lock-Based RCU} +\NoIndentAfterThis -\begin{listing}[bp] -{ \scriptsize -\begin{verbbox} - 1 static void rcu_read_lock(void) - 2 { - 3 spin_lock(&rcu_gp_lock); - 4 } - 5 - 6 static void rcu_read_unlock(void) - 7 { - 8 spin_unlock(&rcu_gp_lock); - 9 } - 10 - 11 void synchronize_rcu(void) - 12 { - 13 spin_lock(&rcu_gp_lock); - 14 spin_unlock(&rcu_gp_lock); - 15 } -\end{verbbox} -} -\centering -\theverbbox +\begin{listing}[htbp] +\input{CodeSamples/defer/rcu_lock@lock_unlock.fcv}\vspace*{-11pt}\fvset{firstnumber=last} +\input{CodeSamples/defer/[email protected]}\fvset{firstnumber=auto} \caption{Lock-Based RCU Implementation} \label{lst:app:toyrcu:Lock-Based RCU Implementation} \end{listing} --2.17.1
Re: [PATCH 1/7] toyrcu: Convert Listing B.1 to new scheme
Quoted 7 lines · Akira Yokosawa
Quoted 6 lines · Paul E. McKenney
Quoted 5 lines · Junchang Wang
Hi Akira,
Thanks for the patch. The new scheme worked great as a good example of composing my commits. So,
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Acked-by Junchang Wang <[email protected]>Thank you both! I have queued and pushed this series, with Junchang's ack on this patch.
Paul, could you also pick up Junchang's other acks on patches 2/7 and 6/7 ?
Ah, I didn't see Acked-by on those two.
Junchang, you are OK with my adding your Acked-by on those as well?
One labor-saving device you can use is something like this:
For 1/7, 2/7, and 6/7: Acked-by: Your Name <[email protected]> Thanx, Paul
Quoted 123 lines
Thanks, Akira
Quoted 120 lines
Thanx, Paul
Quoted 116 lines
Thanks,
--JunchangQuoted 111 lines · Akira Yokosawa
From
245899f43fd007aa344180c0089515cd90f84db2Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 27 Apr 2019 21:04:40 +0900
Subject: [PATCH 1/7] toyrcu: Convert Listing B.1 to new schemeThis commit was originally presented to Junchang as an example where code fragments extracted from two source files under CodeSamples/ are merged into a code snippet.
Junchan employed this scheme in commits
686f3f3b721c("rcu: UseREAD_ONCE()andWRITE_ONCE()for shared variablercu_gp_ctr"),a26c1625bb0d("rcu_qs: UseREAD_ONCE()ANDWRITE_ONCE()for shared variablercu_gp_ctr"), andb9696a4a456f("rcu_nest: Update description of rcu_nest.[hc]").Extra vertical space needs to be canceled by the \vspace*{} command between the two \input{} commands. \fvset{firstnumber=last} is to continue line numbering. \fvset{firstnumber=auto} restores the default setting.
Also tweak positioning option of the listing environment.
Cc Junchang Wang <[email protected]>Signed-off-by Akira Yokosawa <[email protected]>--- CodeSamples/defer/rcu_lock.c | 2 ++ CodeSamples/defer/rcu_lock.h | 2 ++ appendix/toyrcu/toyrcu.tex | 26 ++++---------------------- 3 files changed, 8 insertions(+), 22 deletions(-)CodeSamples/defer/rcu_lock.c +2
-0@@ -20,12 +20,14 @@#include "../api.h" #include "rcu_lock.h" +//\begin{snippet}[labelbase=ln:defer:rcu_lock:synchronize,commandchars=\\\[\]] void synchronize_rcu (void ) {spin_lock (&rcu_gp_lock);spin_unlock (&rcu_gp_lock); } +//\end{snippet} #ifdef TEST #include "rcutorture.h" CodeSamples/defer/rcu_lock.h +2
-0@@ -26,6 +26,7 @@ static void rcu_init(void) { } +//\begin{snippet}[labelbase=ln:defer:rcu_lock:lock_unlock,commandchars=\\\[\]] static void rcu_read_lock (void ) {spin_lock (&rcu_gp_lock);@@ -35,5 +36,6 @@ static void rcu_read_unlock(void) {spin_unlock (&rcu_gp_lock); } +//\end{snippet} extern void synchronize_rcu (void );appendix/toyrcu/toyrcu.tex +4
-23@@ -30,29 +30,11 @@ provides a summary and a list of desirable RCU properties. \section{Lock-Based RCU} \label{sec:app:toyrcu:Lock-Based RCU} +\NoIndentAfterThis -\begin{listing}[bp] -{ \scriptsize -\begin{verbbox} - 1 static void rcu_read_lock(void) - 2 { - 3 spin_lock(&rcu_gp_lock); - 4 } - 5 - 6 static void rcu_read_unlock(void) - 7 { - 8 spin_unlock(&rcu_gp_lock); - 9 } - 10 - 11 void synchronize_rcu(void) - 12 { - 13 spin_lock(&rcu_gp_lock); - 14 spin_unlock(&rcu_gp_lock); - 15 } -\end{verbbox} -} -\centering -\theverbbox +\begin{listing}[htbp] +\input{CodeSamples/defer/rcu_lock@lock_unlock.fcv}\vspace*{-11pt}\fvset{firstnumber=last} +\input{CodeSamples/defer/[email protected]}\fvset{firstnumber=auto} \caption{Lock-Based RCU Implementation} \label{lst:app:toyrcu:Lock-Based RCU Implementation} \end{listing} --2.17.1
Re: [PATCH 1/7] toyrcu: Convert Listing B.1 to new scheme
Quoted 8 lines · Paul E. McKenney
Quoted 7 lines · Akira Yokosawa
Quoted 6 lines · Paul E. McKenney
Quoted 5 lines · Junchang Wang
Hi Akira,
Thanks for the patch. The new scheme worked great as a good example of composing my commits. So,
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Acked-by Junchang Wang <[email protected]>Thank you both! I have queued and pushed this series, with Junchang's ack on this patch.
Paul, could you also pick up Junchang's other acks on patches 2/7 and 6/7 ?
Ah, I didn't see Acked-by on those two.
Umm, I _thought_ I had seen them, but apparently I might have been daydreaming or something :-)
Sorry for the noise.
Thanks, Akira
Quoted 134 lines
Junchang, you are OK with my adding your Acked-by on those as well?
One labor-saving device you can use is something like this:
For 1/7, 2/7, and 6/7: Acked-by: Your Name <[email protected]> Thanx, PaulQuoted 123 lines
Thanks, Akira
Quoted 120 lines
Thanx, Paul
Quoted 116 lines
Thanks,
--JunchangQuoted 111 lines · Akira Yokosawa
From
245899f43fd007aa344180c0089515cd90f84db2Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 27 Apr 2019 21:04:40 +0900
Subject: [PATCH 1/7] toyrcu: Convert Listing B.1 to new schemeThis commit was originally presented to Junchang as an example where code fragments extracted from two source files under CodeSamples/ are merged into a code snippet.
Junchan employed this scheme in commits
686f3f3b721c("rcu: UseREAD_ONCE()andWRITE_ONCE()for shared variablercu_gp_ctr"),a26c1625bb0d("rcu_qs: UseREAD_ONCE()ANDWRITE_ONCE()for shared variablercu_gp_ctr"), andb9696a4a456f("rcu_nest: Update description of rcu_nest.[hc]").Extra vertical space needs to be canceled by the \vspace*{} command between the two \input{} commands. \fvset{firstnumber=last} is to continue line numbering. \fvset{firstnumber=auto} restores the default setting.
Also tweak positioning option of the listing environment.
Cc Junchang Wang <[email protected]>Signed-off-by Akira Yokosawa <[email protected]>--- CodeSamples/defer/rcu_lock.c | 2 ++ CodeSamples/defer/rcu_lock.h | 2 ++ appendix/toyrcu/toyrcu.tex | 26 ++++---------------------- 3 files changed, 8 insertions(+), 22 deletions(-)CodeSamples/defer/rcu_lock.c +2
-0@@ -20,12 +20,14 @@#include "../api.h" #include "rcu_lock.h" +//\begin{snippet}[labelbase=ln:defer:rcu_lock:synchronize,commandchars=\\\[\]] void synchronize_rcu (void ) {spin_lock (&rcu_gp_lock);spin_unlock (&rcu_gp_lock); } +//\end{snippet} #ifdef TEST #include "rcutorture.h" CodeSamples/defer/rcu_lock.h +2
-0@@ -26,6 +26,7 @@ static void rcu_init(void) { } +//\begin{snippet}[labelbase=ln:defer:rcu_lock:lock_unlock,commandchars=\\\[\]] static void rcu_read_lock (void ) {spin_lock (&rcu_gp_lock);@@ -35,5 +36,6 @@ static void rcu_read_unlock(void) {spin_unlock (&rcu_gp_lock); } +//\end{snippet} extern void synchronize_rcu (void );appendix/toyrcu/toyrcu.tex +4
-23@@ -30,29 +30,11 @@ provides a summary and a list of desirable RCU properties. \section{Lock-Based RCU} \label{sec:app:toyrcu:Lock-Based RCU} +\NoIndentAfterThis -\begin{listing}[bp] -{ \scriptsize -\begin{verbbox} - 1 static void rcu_read_lock(void) - 2 { - 3 spin_lock(&rcu_gp_lock); - 4 } - 5 - 6 static void rcu_read_unlock(void) - 7 { - 8 spin_unlock(&rcu_gp_lock); - 9 } - 10 - 11 void synchronize_rcu(void) - 12 { - 13 spin_lock(&rcu_gp_lock); - 14 spin_unlock(&rcu_gp_lock); - 15 } -\end{verbbox} -} -\centering -\theverbbox +\begin{listing}[htbp] +\input{CodeSamples/defer/rcu_lock@lock_unlock.fcv}\vspace*{-11pt}\fvset{firstnumber=last} +\input{CodeSamples/defer/[email protected]}\fvset{firstnumber=auto} \caption{Lock-Based RCU Implementation} \label{lst:app:toyrcu:Lock-Based RCU Implementation} \end{listing} --2.17.1
PATCH 2/7 toyrcu: Extract Listing B.15 from rcu_nest.h
In reply to Akira YokosawaFrom d89573cab1299a8b8dfc731caa24057249c88296 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 2 Jun 2019 23:55:49 +0900
Subject: [PATCH 2/7] toyrcu: Extract Listing B.15 from rcu_nest.h
Commit b9696a4a456f ("rcu_nest: Update description of rcu_nest.[hc]") updated B.16 to reflect the changes in rcu_nest.[hc]. For consistency, extract Listing B.15 from rcu_nest.h.
--- CodeSamples/defer/rcu_nest.h | 2 ++ appendix/toyrcu/toyrcu.tex | 13 +------------ 2 files changed, 3 insertions(+), 12 deletions(-)
CodeSamples/defer/rcu_nest.h +2 -0
@@ -24,6 +24,7 @@#define ULONG_CMP_GE (a, b) (ULONG_MAX / 2 >= (a) - (b))#define ULONG_CMP_LT (a, b) (ULONG_MAX / 2 < (a) - (b)) +//\begin{snippet}[labelbase=ln:defer:rcu_nest:define,commandchars=\%\@\$] DEFINE_SPINLOCK (rcu_gp_lock);#define RCU_GP_CTR_SHIFT 7#define RCU_GP_CTR_BOTTOM_BIT (1 << RCU_GP_CTR_SHIFT)
@@ -31,6 +32,7 @@ DEFINE_SPINLOCK(rcu_gp_lock);#define MAX_GP_ADV_DISTANCE (RCU_GP_CTR_NEST_MASK << 8)unsigned long rcu_gp_ctr =0 ;/* increment by RCU_GP_CTR_BOTTOM_BIT each gp. */ DEFINE_PER_THREAD(unsigned long, rcu_reader_gp); +//\end{snippet} static inline int rcu_gp_ongoing (int cpu) {
appendix/toyrcu/toyrcu.tex +1 -12
@@ -1360,18 +1360,7 @@ variables. \label{sec:app:toyrcu:Nestable RCU Based on Free-Running Counter} \begin{listing}[tb] -{ \scriptsize -\begin{verbbox} - 1 DEFINE_SPINLOCK(rcu_gp_lock); - 2 #define RCU_GP_CTR_SHIFT 7 - 3 #define RCU_GP_CTR_BOTTOM_BIT (1 << RCU_GP_CTR_SHIFT) - 4 #define RCU_GP_CTR_NEST_MASK (RCU_GP_CTR_BOTTOM_BIT - 1) - 5 long rcu_gp_ctr = 0; - 6 DEFINE_PER_THREAD(long, rcu_reader_gp); -\end{verbbox} -} -\centering -\theverbbox +\input{CodeSamples/defer/[email protected]} \caption{Data for Nestable RCU Using a Free-Running Counter} \label{lst:app:toyrcu:Data for Nestable RCU Using a Free-Running Counter} \end{listing}
Signature · 1 line
2.17.1
Re: [PATCH 2/7] toyrcu: Extract Listing B.15 from rcu_nest.h
Hi Akira,
Thanks for helping complete applying the new scheme on rcu_nest. The patch looks good to me.
Thanks,
--Junchang
Quoted 65 lines · Akira Yokosawa
From
d89573cab1299a8b8dfc731caa24057249c88296Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 2 Jun 2019 23:55:49 +0900
Subject: [PATCH 2/7] toyrcu: Extract Listing B.15 fromrcu_nest.hCommit
b9696a4a456f("rcu_nest: Update description of rcu_nest.[hc]") updated B.16 to reflect the changes in rcu_nest.[hc]. For consistency, extract Listing B.15 fromrcu_nest.h.Cc Junchang Wang <[email protected]>Signed-off-by Akira Yokosawa <[email protected]>--- CodeSamples/defer/rcu_nest.h | 2 ++ appendix/toyrcu/toyrcu.tex | 13 +------------ 2 files changed, 3 insertions(+), 12 deletions(-)CodeSamples/defer/rcu_nest.h +2
-0@@ -24,6 +24,7 @@#define ULONG_CMP_GE (a, b) (ULONG_MAX / 2 >= (a) - (b))#define ULONG_CMP_LT (a, b) (ULONG_MAX / 2 < (a) - (b)) +//\begin{snippet}[labelbase=ln:defer:rcu_nest:define,commandchars=\%\@\$] DEFINE_SPINLOCK (rcu_gp_lock);#define RCU_GP_CTR_SHIFT 7#define RCU_GP_CTR_BOTTOM_BIT (1 << RCU_GP_CTR_SHIFT)@@ -31,6 +32,7 @@ DEFINE_SPINLOCK(rcu_gp_lock);#define MAX_GP_ADV_DISTANCE (RCU_GP_CTR_NEST_MASK << 8)unsigned long rcu_gp_ctr =0 ;/* increment by RCU_GP_CTR_BOTTOM_BIT each gp. */ DEFINE_PER_THREAD(unsigned long, rcu_reader_gp); +//\end{snippet} static inline int rcu_gp_ongoing (int cpu) {appendix/toyrcu/toyrcu.tex +1
-13@@ -1360,18 +1360,7 @@ variables. \label{sec:app:toyrcu:Nestable RCU Based on Free-Running Counter} \begin{listing}[tb] -{ \scriptsize -\begin{verbbox} - 1 DEFINE_SPINLOCK(rcu_gp_lock); - 2 #define RCU_GP_CTR_SHIFT 7 - 3 #define RCU_GP_CTR_BOTTOM_BIT (1 << RCU_GP_CTR_SHIFT) - 4 #define RCU_GP_CTR_NEST_MASK (RCU_GP_CTR_BOTTOM_BIT - 1) - 5 long rcu_gp_ctr = 0; - 6 DEFINE_PER_THREAD(long, rcu_reader_gp); -\end{verbbox} -} -\centering -\theverbbox +\input{CodeSamples/defer/[email protected]} \caption{Data for Nestable RCU Using a Free-Running Counter} \label{lst:app:toyrcu:Data for Nestable RCU Using a Free-Running Counter} \end{listing} --2.17.1
PATCH 3/7 toolsoftrade: Fix typo
In reply to Akira YokosawaFrom 66874f5a6cd1b758cdc442084e28289ef12aa082 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 2 Jun 2019 23:21:02 +0900
Subject: [PATCH 3/7] toolsoftrade: Fix typo
Elad reported this typo quite a while ago [1]. Given that it hasn't been taken care of, let's fix it.
[1]: https://www.spinics.net/lists/perfbook/msg02318.html
--- toolsoftrade/toolsoftrade.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
toolsoftrade/toolsoftrade.tex +1 -1
@@ -1550,7 +1550,7 @@ Of course, where practical, the primitives described in Section~\ref{sec:toolsoftrade:Atomic Operations (gcc Classic)} or (especially) Section~\ref{sec:toolsoftrade:Atomic Operations (C11)} -should be instead be used to avoid data races, that is, to ensure +should instead be used to avoid data races, that is, to ensure that if there are multiple concurrent accesses to a given variable, all of those accesses are loads.
Signature · 1 line
2.17.1
PATCH 4/7 FAQ-BUILD: Update for recent Fedora releases
In reply to Akira YokosawaFrom 4ae74b9f60e29298d3d67736db9a2baa19655842 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 5 May 2019 00:22:28 +0900
Subject: [PATCH 4/7] FAQ-BUILD: Update for recent Fedora releases
Also remove info for Ubuntu Trusty.
--- FAQ-BUILD.txt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
FAQ-BUILD.txt +2 -7
@@ -44,9 +44,6 @@ texlive-science texlive-bibtex-extra gnuplot-x11 xfig inkscape graphviz fig2ps - On Ubuntu Trusty, in addition to the above, you need: - texlive-humanities - On Ubuntu Bionic, the following list should cover necessary packages (except for -doc packages): texlive-publishers texlive-pstricks
@@ -57,16 +54,14 @@ compatible with updated Ghostscript (not limited to Ubuntu Bionic). See #7 below. - On Fedora 28 and 27, installing the following set of + On Fedora 30 and 29, installing the following set of packages suffices: + texlive-collection-plaingeneric texlive-collection-binextra texlive-collection-latexextra texlive-collection-fontsextra fig2ps graphviz inkscape - You need to install a version of a2ping compatible - with Ghostscript 9.22 or later. See #7 below. - On other Linux distributions such as RHEL/CentOS and Scientific Linux, where support of TeX Live packages is insufficient, manually installing TeX Live should
Signature · 1 line
2.17.1
PATCH 5/7 howto: Stop mentioning quantum computing
In reply to Akira YokosawaFrom 2aadd71518c8dda2748541618038c495903ee9da Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 6 May 2019 00:02:22 +0900
Subject: [PATCH 5/7] howto: Stop mentioning quantum computing
Paul gave up tracing quantum computing as of commit 972946a5298a ("future/QC: Remove quantum-computing section"). Remove it.
--- howto/howto.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
howto/howto.tex +1 -1
@@ -119,7 +119,7 @@ Chapter~\ref{chp:Ease of Use} follows up with some ease-of-use advice. Finally, Chapter~\ref{chp:Conflicting Visions of the Future} looks at a few possible future directions, including shared-memory parallel system design, software and hardware transactional -memory, functional programming for parallelism, and quantum computing. +memory, and functional programming for parallelism. This chapter is followed by a number of appendices. The most popular of these appears to be
Signature · 1 line
2.17.1
PATCH 6/7 toyrcu: Extract Listing B.13 from rcu.h
In reply to Akira YokosawaFrom f37685cb3821daf0d9ee55a538ec462e5de0a6a8 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Tue, 4 Jun 2019 00:35:02 +0900
Subject: [PATCH 6/7] toyrcu: Extract Listing B.13 from rcu.h
Commit 686f3f3b721c ("rcu: Use READ_ONCE() and WRITE_ONCE() for shared variable rcu_gp_ctr") updated B.14 to reflect the changes in rcu.[hc]. For consistency, extract Listing B.13 from rcu.h.
--- CodeSamples/defer/rcu.h | 2 ++ appendix/toyrcu/toyrcu.tex | 11 +---------- 2 files changed, 3 insertions(+), 10 deletions(-)
CodeSamples/defer/rcu.h +2 -0
@@ -20,10 +20,12 @@#include "rcu_pointer.h" +//\begin{snippet}[labelbase=ln:defer:rcu:define,commandchars=\%\@\$] DEFINE_SPINLOCK (rcu_gp_lock);long rcu_gp_ctr =0 ;/* always even, +=2 at start of each grace period. */ DEFINE_PER_THREAD (long, rcu_reader_gp);DEFINE_PER_THREAD (long, rcu_reader_gp_snap); +//\end{snippet} static inline void rcu_init (void ) {
appendix/toyrcu/toyrcu.tex +1 -10
@@ -1185,16 +1185,7 @@ thread-local accesses to one, as is done in the next section. \label{sec:app:toyrcu:RCU Based on Free-Running Counter} \begin{listing}[tbp] -{ \scriptsize -\begin{verbbox} - 1 DEFINE_SPINLOCK(rcu_gp_lock); - 2 long rcu_gp_ctr = 0; - 3 DEFINE_PER_THREAD(long, rcu_reader_gp); - 4 DEFINE_PER_THREAD(long, rcu_reader_gp_snap); -\end{verbbox} -} -\centering -\theverbbox +\input{CodeSamples/defer/[email protected]} \caption{Data for Free-Running Counter Using RCU} \label{lst:app:toyrcu:Data for Free-Running Counter Using RCU} \end{listing}
Signature · 1 line
2.17.1
Re: [PATCH 6/7] toyrcu: Extract Listing B.13 from rcu.h
This patch also looks good to me. Thanks, Akira!
--Junchang
Quoted 60 lines · Akira Yokosawa
From
f37685cb3821daf0d9ee55a538ec462e5de0a6a8Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Tue, 4 Jun 2019 00:35:02 +0900
Subject: [PATCH 6/7] toyrcu: Extract Listing B.13 fromrcu.hCommit
686f3f3b721c("rcu: UseREAD_ONCE()andWRITE_ONCE()for shared variablercu_gp_ctr") updated B.14 to reflect the changes in rcu.[hc]. For consistency, extract Listing B.13 fromrcu.h.Cc Junchang Wang <[email protected]>Signed-off-by Akira Yokosawa <[email protected]>--- CodeSamples/defer/rcu.h | 2 ++ appendix/toyrcu/toyrcu.tex | 11 +---------- 2 files changed, 3 insertions(+), 10 deletions(-)CodeSamples/defer/rcu.h +2
-0@@ -20,10 +20,12 @@#include "rcu_pointer.h" +//\begin{snippet}[labelbase=ln:defer:rcu:define,commandchars=\%\@\$] DEFINE_SPINLOCK (rcu_gp_lock);long rcu_gp_ctr =0 ;/* always even, +=2 at start of each grace period. */ DEFINE_PER_THREAD (long, rcu_reader_gp);DEFINE_PER_THREAD (long, rcu_reader_gp_snap); +//\end{snippet} static inline void rcu_init (void ) {appendix/toyrcu/toyrcu.tex +1
-11@@ -1185,16 +1185,7 @@ thread-local accesses to one, as is done in the next section. \label{sec:app:toyrcu:RCU Based on Free-Running Counter} \begin{listing}[tbp] -{ \scriptsize -\begin{verbbox} - 1 DEFINE_SPINLOCK(rcu_gp_lock); - 2 long rcu_gp_ctr = 0; - 3 DEFINE_PER_THREAD(long, rcu_reader_gp); - 4 DEFINE_PER_THREAD(long, rcu_reader_gp_snap); -\end{verbbox} -} -\centering -\theverbbox +\input{CodeSamples/defer/[email protected]} \caption{Data for Free-Running Counter Using RCU} \label{lst:app:toyrcu:Data for Free-Running Counter Using RCU} \end{listing} --2.17.1
PATCH 7/7 styleguide: Update description of available options to \begin{snippet}
In reply to Akira YokosawaFrom f781e599d428ed061c34159697d7ebf3c32927c8 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 15 Jul 2019 22:51:33 +0900
Subject: [PATCH 7/7] styleguide: Update description of available options to \begin{snippet}
Update the list of commands and options recognized by fcvextract.pl. Now that the default is to remove comment blocks in code snippets, we need the "keepcomment=yes" option in Listing B.3.
Also use American spelling of "flavor".
--- appendix/styleguide/samplecodesnippet.c | 2 +- appendix/styleguide/styleguide.tex | 76 +++++++++++++++---------- 2 files changed, 48 insertions(+), 30 deletions(-)
appendix/styleguide/samplecodesnippet.c +1 -1
@@ -1,4 +1,4 @@ -//\begin{snippet}[labelbase=ln:base1,commandchars=\$\[\]] +//\begin{snippet}[labelbase=ln:base1,keepcomment=yes,commandchars=\$\[\]] /* * Sample Code Snippet */
appendix/styleguide/styleguide.tex +47 -29
151 lines not on this page · raw message
Signature · 1 line
2.17.1
Quoted 19 lines · Akira Yokosawa
Hi Paul,
(Cc: Junchang, Elad)I've got somewhat distracted and couldn't properly compose change logs of patches I collected in a work-in-progress branch. Finally I managed to update the style guide to reflect enhancements in fcvextract.pl and amend the commit logs.
Patch #1 was the one presented to Junchang as an example to combine two code fragments in a code snippet.
Patch #2 applies the new scheme to another fragment inrcu_nest.h, which was updated by Junchang.
Patch #3 fixes type reported by Elad.
Patch #4 updates FAQ-BUILD.txt for F29 and F30 users. Patch #5 removes remnant of quantum computing.
Patch #6 applies the new scheme to another fragment inrcu.h, which was also updated by Junchang.
Patch #7 is the update of style guide
Quoted 1 line
Patches #1, #2, #3, and #6 are CC'd to Junchang or Elad.
Oops, looks like Patch #4 was CC'd to Junchang and Elad. Junchang, Elad, Please ignore it.
Thanks, Akira
Quoted 26 lines
I don't think their Acks are musts in these cases, but would highly appreciate them.
Thanks, Akira
--
Akira Yokosawa (7):
toyrcu: Convert Listing B.1 to new scheme
toyrcu: Extract Listing B.15 fromrcu_nest.h
toolsoftrade: Fix typo
FAQ-BUILD: Update for recent Fedora releases
howto: Stop mentioning quantum computing
toyrcu: Extract Listing B.13 fromrcu.h
styleguide: Update description of available options to \begin{snippet}CodeSamples/defer/rcu.h | 2 + CodeSamples/defer/rcu_lock.c | 2 + CodeSamples/defer/rcu_lock.h | 2 + CodeSamples/defer/rcu_nest.h | 2 + FAQ-BUILD.txt | 9 +-- appendix/styleguide/samplecodesnippet.c | 2 +- appendix/styleguide/styleguide.tex | 76 +++++++++++++++---------- appendix/toyrcu/toyrcu.tex | 50 ++-------------- howto/howto.tex | 2 +- toolsoftrade/toolsoftrade.tex | 2 +- 10 files changed, 66 insertions(+), 83 deletions(-)
Quoted 5 lines · Akira Yokosawa
Hi Paul,
(Cc: Junchang, Elad)I've got somewhat distracted and couldn't properly compose change logs of patches I collected in a work-in-progress branch.
No need to apologize, you might have noticed that I have been more distracted from this project than I would have liked. Good stuff, thank you!
Thanx, Paul
Quoted 44 lines
Finally I managed to update the style guide to reflect enhancements in fcvextract.pl and amend the commit logs.
Patch #1 was the one presented to Junchang as an example to combine two code fragments in a code snippet.
Patch #2 applies the new scheme to another fragment inrcu_nest.h, which was updated by Junchang.
Patch #3 fixes type reported by Elad.
Patch #4 updates FAQ-BUILD.txt for F29 and F30 users. Patch #5 removes remnant of quantum computing.
Patch #6 applies the new scheme to another fragment inrcu.h, which was also updated by Junchang.
Patch #7 is the update of style guidePatches #1, #2, #3, and #6 are CC'd to Junchang or Elad. I don't think their Acks are musts in these cases, but would highly appreciate them.
Thanks, Akira
--
Akira Yokosawa (7):
toyrcu: Convert Listing B.1 to new scheme
toyrcu: Extract Listing B.15 fromrcu_nest.h
toolsoftrade: Fix typo
FAQ-BUILD: Update for recent Fedora releases
howto: Stop mentioning quantum computing
toyrcu: Extract Listing B.13 fromrcu.h
styleguide: Update description of available options to \begin{snippet}CodeSamples/defer/rcu.h | 2 + CodeSamples/defer/rcu_lock.c | 2 + CodeSamples/defer/rcu_lock.h | 2 + CodeSamples/defer/rcu_nest.h | 2 + FAQ-BUILD.txt | 9 +-- appendix/styleguide/samplecodesnippet.c | 2 +- appendix/styleguide/styleguide.tex | 76 +++++++++++++++---------- appendix/toyrcu/toyrcu.tex | 50 ++-------------- howto/howto.tex | 2 +- toolsoftrade/toolsoftrade.tex | 2 +- 10 files changed, 66 insertions(+), 83 deletions(-)Signature · 1 line
2.17.1