All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] qqz.sty: Add page number to the QQZ heading for 'nq' build
@ 2020-07-30 21:40 Akira Yokosawa
  2020-07-30 21:45 ` [PATCH 2/2] toyrcu: Minor fixes Akira Yokosawa
  2020-07-30 23:48 ` [PATCH 1/2] qqz.sty: Add page number to the QQZ heading for 'nq' build Paul E. McKenney
  0 siblings, 2 replies; 3+ messages in thread
From: Akira Yokosawa @ 2020-07-30 21:40 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 7b56ddf382f836201b9e88e2f7b185fae422314e Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Fri, 31 Jul 2020 00:18:58 +0900
Subject: [PATCH 1/2] qqz.sty: Add page number to the QQZ heading for 'nq' build

Excerpt of Paul's message:

    For a printed book, would it make sense to put the page number of the
    quick-quiz source (the location of the little box containing "QQ" and
    the quick-quiz number) into each answer?  Or after each question?

This commit adds the page number at the right-hand side of quiz heading
in framed box.  It is also a hyperlink to the little box in the text.

Suggested-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 qqz.sty | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/qqz.sty b/qqz.sty
index 6d87e192..897d1ab6 100644
--- a/qqz.sty
+++ b/qqz.sty
@@ -59,6 +59,8 @@
 \newcommand{\QuickQuizAnswerChapter}{\textbf{Unknown QuickQAC!!!}}
 
 \newcommand{\QuickQHeading}[3]{\hyperref[#2.#3]{\textbf{Quick Quiz #3:}}\label{#1.#3}}
+\newcommand{\QuickQHeadingPage}[3]{\hyperref[#2.#3]{\textbf{Quick Quiz #3:}}\label{#1.#3}%
+	\hfill\raisebox{0.5ex}{\footnotesize\fbox{p.\pageref{#2.#3}}}}
 \newcommand{\QuickQHeadingLight}[3]{\scriptsize QQ~\hyperref[#2.#3]{#3}\label{#1.#3}}
 \newcommand{\QuickQHeadingBegin}[3]{\scriptsize QQ~\hyperref[#2.#3]{#3}\label{#1.#3},}
 \newcommand{\QuickQHeadingMiddle}[3]{\scriptsize\hyperref[#2.#3]{{ #3}}\label{#1.#3},}
@@ -219,7 +221,7 @@
 \newcommand{\QuickQ}[1]{
 	\begin{tcolorbox}[breakable]
 	\refstepcounter{quickquizctrC}
-	\QuickQHeading{QQA}{QQ}{\QuickQuizAnswerChapter.\thequickquizctrC} \\
+	\QuickQHeadingPage{QQA}{QQ}{\QuickQuizAnswerChapter.\thequickquizctrC}\\
 }
 
 \newcommand{\QuickA}[1]{%
-- 
2.17.1


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

* [PATCH 2/2] toyrcu: Minor fixes
  2020-07-30 21:40 [PATCH 1/2] qqz.sty: Add page number to the QQZ heading for 'nq' build Akira Yokosawa
@ 2020-07-30 21:45 ` Akira Yokosawa
  2020-07-30 23:48 ` [PATCH 1/2] qqz.sty: Add page number to the QQZ heading for 'nq' build Paul E. McKenney
  1 sibling, 0 replies; 3+ messages in thread
From: Akira Yokosawa @ 2020-07-30 21:45 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From da7b054019f8377b87a050a8b2544f2e5ace607d Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Fri, 31 Jul 2020 00:28:42 +0900
Subject: [PATCH 2/2] toyrcu: Minor fixes

The floating snippet at the beginning of QQZ answer caused small skip
at the start of the answer part.
It might also cause an orphaned "Answer" heading.
Fix this by moving the snippet a few sentences down.

Note: I made a paragraph break in the middle of the long paragraph.

The other change is to use \O{} macro in the same way as the other
places.
I missed this one in commit 5e9a9c723a0b ("toyrcu: Use mathcal O for
'orders of'")

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 appendix/toyrcu/toyrcu.tex | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/appendix/toyrcu/toyrcu.tex b/appendix/toyrcu/toyrcu.tex
index 6feff768..72211e39 100644
--- a/appendix/toyrcu/toyrcu.tex
+++ b/appendix/toyrcu/toyrcu.tex
@@ -78,7 +78,15 @@ preventing grace-period sharing.
 	\cref{lst:app:toyrcu:Lock-Based RCU Implementation}
 	also be a deadlock in any other RCU implementation?
 }\QuickQuizAnswerB{
-%
+	\begin{fcvref}[ln:app:toyrcu:Deadlock in Lock-Based RCU Implementation]
+	Suppose the functions \co{foo()} and \co{bar()} in
+	\cref{lst:app:toyrcu:Deadlock in Lock-Based RCU Implementation}
+	are invoked concurrently from different CPUs.
+	Then \co{foo()} will acquire \co{my_lock()} on \clnref{foo:acq},
+	while \co{bar()} will acquire \co{rcu_gp_lock} on
+	\clnref{bar:rrl}.
+	\end{fcvref}
+
 \begin{listing}[tbp]
 \begin{fcvlabel}[ln:app:toyrcu:Deadlock in Lock-Based RCU Implementation]
 \begin{VerbatimL}[commandchars=\\\[\]]
@@ -106,14 +114,8 @@ void bar(void)
 \caption{Deadlock in Lock-Based RCU Implementation}
 \label{lst:app:toyrcu:Deadlock in Lock-Based RCU Implementation}
 \end{listing}
-%
+
 	\begin{fcvref}[ln:app:toyrcu:Deadlock in Lock-Based RCU Implementation]
-	Suppose the functions \co{foo()} and \co{bar()} in
-	\cref{lst:app:toyrcu:Deadlock in Lock-Based RCU Implementation}
-	are invoked concurrently from different CPUs.
-	Then \co{foo()} will acquire \co{my_lock()} on \clnref{foo:acq},
-	while \co{bar()} will acquire \co{rcu_gp_lock} on
-	\clnref{bar:rrl}.
 	When \co{foo()} advances to \clnref{foo:rrl}, it will attempt to
 	acquire \co{rcu_gp_lock}, which is held by \co{bar()}.
 	Then when \co{bar()} advances to \clnref{bar:acq}, it will attempt
@@ -930,7 +932,7 @@ RCU implementation being used in production in real-life applications.
 	overhead that increases linearly with the number of threads.
 	Under what circumstances could an RCU implementation enjoy
 	lightweight implementations for all three of these primitives,
-	all having deterministic ($O\left(1\right)$) overheads and latencies?
+	all having deterministic ($\O{1}$) overheads and latencies?
 }\QuickQuizAnswer{
 	Special-purpose uniprocessor implementations of RCU can attain
 	this ideal~\cite{PaulEMcKenney2009BloatwatchRCU}.
-- 
2.17.1



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

* Re: [PATCH 1/2] qqz.sty: Add page number to the QQZ heading for 'nq' build
  2020-07-30 21:40 [PATCH 1/2] qqz.sty: Add page number to the QQZ heading for 'nq' build Akira Yokosawa
  2020-07-30 21:45 ` [PATCH 2/2] toyrcu: Minor fixes Akira Yokosawa
@ 2020-07-30 23:48 ` Paul E. McKenney
  1 sibling, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2020-07-30 23:48 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Fri, Jul 31, 2020 at 06:40:15AM +0900, Akira Yokosawa wrote:
> >From 7b56ddf382f836201b9e88e2f7b185fae422314e Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Fri, 31 Jul 2020 00:18:58 +0900
> Subject: [PATCH 1/2] qqz.sty: Add page number to the QQZ heading for 'nq' build
> 
> Excerpt of Paul's message:
> 
>     For a printed book, would it make sense to put the page number of the
>     quick-quiz source (the location of the little box containing "QQ" and
>     the quick-quiz number) into each answer?  Or after each question?
> 
> This commit adds the page number at the right-hand side of quiz heading
> in framed box.  It is also a hyperlink to the little box in the text.

Looks great, thank you!!!  Queued and pushed.

							Thanx, Paul

> Suggested-by: Paul E. McKenney <paulmck@kernel.org>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> ---
>  qqz.sty | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/qqz.sty b/qqz.sty
> index 6d87e192..897d1ab6 100644
> --- a/qqz.sty
> +++ b/qqz.sty
> @@ -59,6 +59,8 @@
>  \newcommand{\QuickQuizAnswerChapter}{\textbf{Unknown QuickQAC!!!}}
>  
>  \newcommand{\QuickQHeading}[3]{\hyperref[#2.#3]{\textbf{Quick Quiz #3:}}\label{#1.#3}}
> +\newcommand{\QuickQHeadingPage}[3]{\hyperref[#2.#3]{\textbf{Quick Quiz #3:}}\label{#1.#3}%
> +	\hfill\raisebox{0.5ex}{\footnotesize\fbox{p.\pageref{#2.#3}}}}
>  \newcommand{\QuickQHeadingLight}[3]{\scriptsize QQ~\hyperref[#2.#3]{#3}\label{#1.#3}}
>  \newcommand{\QuickQHeadingBegin}[3]{\scriptsize QQ~\hyperref[#2.#3]{#3}\label{#1.#3},}
>  \newcommand{\QuickQHeadingMiddle}[3]{\scriptsize\hyperref[#2.#3]{{ #3}}\label{#1.#3},}
> @@ -219,7 +221,7 @@
>  \newcommand{\QuickQ}[1]{
>  	\begin{tcolorbox}[breakable]
>  	\refstepcounter{quickquizctrC}
> -	\QuickQHeading{QQA}{QQ}{\QuickQuizAnswerChapter.\thequickquizctrC} \\
> +	\QuickQHeadingPage{QQA}{QQ}{\QuickQuizAnswerChapter.\thequickquizctrC}\\
>  }
>  
>  \newcommand{\QuickA}[1]{%
> -- 
> 2.17.1
> 

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

end of thread, other threads:[~2020-07-30 23:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30 21:40 [PATCH 1/2] qqz.sty: Add page number to the QQZ heading for 'nq' build Akira Yokosawa
2020-07-30 21:45 ` [PATCH 2/2] toyrcu: Minor fixes Akira Yokosawa
2020-07-30 23:48 ` [PATCH 1/2] qqz.sty: Add page number to the QQZ heading for 'nq' build Paul E. McKenney

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.