Style guide updates
cover Style guide updates
From 91874614a21874550a5d9ffa3d0fba5f6d6416f1 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 3 Sep 2017 23:39:54 +0900
Subject: [PATCH 0/2] Style guide updates
Hi Paul,
This patch set adds a section of ellipsis and a couple of experimental tables corresponding to new tables in memorder.
Booktabs' rules and gaps in mid-rules still works in these tables, I suppose.
Let me know what you think.
Thanks, Akira
--
Akira Yokosawa (2):
styleguide: Add 'Ellipsis' section
styleguide: Add more experimental tables
appendix/styleguide/styleguide.tex | 206 ++++++++++++++++++++++++++++++------- 1 file changed, 169 insertions(+), 37 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/2 styleguide: Add 'Ellipsis' section
From 6b98c9422799b125cd80930060b3ce027f6adea5 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 2 Sep 2017 20:52:42 +0900
Subject: [PATCH 1/2] styleguide: Add 'Ellipsis' section
--- appendix/styleguide/styleguide.tex | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)
appendix/styleguide/styleguide.tex +55 -0
@@ -676,6 +676,61 @@ namely \qco{$-$}. For example, $-30$, rather than -30. \end{quote} +\subsection{Punctuation} +\label{sec:app:styleguide:Punctuation} + +\subsubsection{Ellipsis} +\label{sec:app:styleguide:Ellipsis} + +In monospace fonts, ellipses can be expressed by +series of periods. For example: + +\begin{quote} + \verb|Great ... So how do I fix it?| +\end{quote} + +However, in proportional fonts, the series of periods is printed +with tight spaces as follows: + +\begin{quote} + Great ... So how do I fix it? +\end{quote} + +Standard \LaTeX\ defines the \verb|\dots| macro for this purpose. +However, it has a kludge in the evenness of spaces. +The ``ellipsis'' package redefines the \verb|\dots| macro to fix +the issue.\footnote{To be exact, it is the \co{\\textellipsis} macro + that is redefined. The behavior of \co{\\dots} macro in math + mode is not affected. The ``amsmath'' package has another definition + of \co{\\dots}. It is not used in perfbook at the moment.} +By using \verb|\dots|, the above example is typeset as the following: + +\begin{quote} + Great \dots So how do I fix it? +\end{quote} + +Note that the ``xspace'' option specified to the ``ellipsis'' package +adjusts the spaces after ellipses depending on what follows them. + +For example: + +\begin{itemize}[itemsep=.2ex] +\item He said, ``I~\dots really don't remember~\dots'' +\item Sequence A: (one, two, three, \dots) +\item Sequence B: (4, 5, \dots, $n$) +\end{itemize} + +As you can see, extra space is placed before the comma. + +\verb|\dots| macro can also be used in math mode: + +\begin{itemize}[itemsep=.2ex] +\item Sequence C: $(1, 2, 3, 5, 8, \dots)$ +\item Sequence D: $(10, 12, \dots, 20)$ +\end{itemize} + +The \verb|\ldots| macro behaves the same as the \verb|\dots| macro. + \subsection{Improvement Candidates} \label{sec:app:styleguide:Improvement Candidates}
Signature · 1 line
2.7.4
PATCH 2/2 styleguide: Add more experimental tables
In reply to Akira YokosawaFrom 91874614a21874550a5d9ffa3d0fba5f6d6416f1 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 3 Sep 2017 21:24:20 +0900
Subject: [PATCH 2/2] styleguide: Add more experimental tables
These are tweaked version of tables recently added in memorder. Although they have fairly complex headers, they can still be expressed without vertical rules.
In WWC sequence, narrow and wide skips in mid-rules roughly correspond to the single and double vertical rules used in the original table.
Also remove the tweaked version of Table 13.1 without legends. Also use frame boxes for legends in Table D.5 as the same as Table D.12.
--- appendix/styleguide/styleguide.tex | 151 ++++++++++++++++++++++++++++--------- 1 file changed, 114 insertions(+), 37 deletions(-)
appendix/styleguide/styleguide.tex +114 -37
@@ -1022,41 +1022,12 @@ is a tweaked version of Table~\ref{tab:together:Reference Counting and Synchronization Mechanisms}, which has more complex header than the tables experimented so far. -\begin{table}[tb] -\small -\centering -\renewcommand*{\arraystretch}{1.25} -\rowcolors{3}{}{lightgray} -\begin{tabular}{lccc} - \toprule - & \multicolumn{3}{c}{Release Synchronization} \\ - \cmidrule(l){2-4} - \parbox[c]{.8in}{Acquisition\\Synchronization} - & Locking - & \parbox[c]{.5in}{Reference\\Counting} - & RCU \\ - \cmidrule{1-1} \cmidrule(l){2-4} - Locking & $-$ & CAM & CA \\ - \parbox[c][6ex]{.8in}{Reference\\Counting} - & A & AM & A \\ - RCU & CA & MCA & CA \\ - \bottomrule -\end{tabular} -\caption{Reference Counting and Synchronization Mechanisms} -\label{tab:app:styleguide:Reference Counting and Synchronization Mechanisms} -\end{table} - In Table~\ref{tab:app:styleguide:Reference Counting and Synchronization Mechanisms}, the gap in the mid-rule corresponds to the distinction which is represented by double vertical rules in Table~\ref{tab:together:Reference Counting and Synchronization Mechanisms}. - -However, it makes no sense when it is separated from the explanation near~% -Table~\ref{tab:together:Reference Counting and Synchronization Mechanisms} -due to the lack of explanation of abbreviations used in the matrix. -An example with proper legends is shown in -Table~\ref{tab:app:styleguide:Reference Counting and Synchronization Mechanisms (Legends)}. +The legends in the frame box explain the abbreviations used in the matrix. Two types of memory barrier are denoted by subscripts here. \begin{table}[tb]
@@ -1081,17 +1052,17 @@ Two types of memory barrier are denoted by subscripts here. \end{tabular} \vspace{5pt}\hfill -{\footnotesize +\framebox[\width]{\footnotesize\setlength{\tabcolsep}{3pt} \rowcolors{1}{}{} - \begin{tabular}{lp{1.8in}} - A & Atomic counting \\ - C & Check combined with the atomic acquisition operation \\ - M\textsubscript{R} & Memory barriers required only on release \\ - M\textsubscript{A} & Memory barriers required on acquire \\ + \begin{tabular}{lrp{2in}} + Key: & A: & Atomic counting \\ + & C: & Check combined with the atomic acquisition operation \\ + & M\textsubscript{R}: & Memory barriers required only on release \\ + & M\textsubscript{A}: & Memory barriers required on acquire \\ \end{tabular} } \caption{Reference Counting and Synchronization Mechanisms} -\label{tab:app:styleguide:Reference Counting and Synchronization Mechanisms (Legends)} +\label{tab:app:styleguide:Reference Counting and Synchronization Mechanisms} \end{table} Table~\ref{tab:app:whymb:Cache Coherence Example}
@@ -1413,6 +1384,112 @@ IBM~Q & $0.015$ \label{tab:app:styleguide:Refrigeration Power Consumption (arydshln-2)} \end{table} +Tables~\ref{tab:memorder:Linux-Kernel Memory-Ordering Cheat Sheet} +and~\ref{tab:memorder:Memory Ordering: WWC Sequence of Events} +recently added in Chapter~\ref{chp:memorder:Memory Ordering} +can be typeset as +Tables~\ref{tab:app:styleguide:Linux-Kernel Memory-Ordering Cheat Sheet} +and~\ref{tab:app:styleguide:Memory Ordering: WWC Sequence of Events} +using booktabs' ruled lines. + +\begin{table*} +\small +\centering\OneColumnHSpace{-0.7in} +\renewcommand*{\arraystretch}{1.1} +\rowcolors{7}{lightgray}{} +\begin{tabular}{lccccccccccc}\toprule + & & \multicolumn{4}{c}{Prior Ordered Operation} & + \multicolumn{6}{c}{Subsequent Ordered Operation} \\ + \cmidrule(l){3-6} \cmidrule(l){7-12} + Operation Providing Ordering & C & + Self & R & W & RMW & Self & R & W & DR & DW & RMW \\ + \cmidrule(r){1-1} \cmidrule{2-2} \cmidrule(l){3-6} \cmidrule(l){7-12} + \tco{READ_ONCE()} & & + Y & & & & & & & & Y & \\ + \tco{smp_read_barrier_depends()} & & + & Y & & & & & & Y & Y & \\ + Successful \tco{*_acquire()} & & + R & & & & & Y & Y & Y & Y & Y \\ + Successful \tco{*_release()} & C & + & Y & Y & Y & W & & & & & \\ + \tco{smp_rmb()} & & + & Y & & R & & Y & & Y & & R \\ + \tco{smp_wmb()} & & + & & Y & W & & & Y & & Y & W \\ + \tco{smp_mb()} & CP & + & Y & Y & Y & & Y & Y & Y & Y & Y \\ + Successful Non-Relaxed Non-\tco{void} RMW & CP & + Y & Y & Y & Y & Y & Y & Y & Y & Y & Y \\ + \tco{smp_mb__before_atomic()} & CP & + & Y & Y & Y & & a & a & a & a & Y \\ + \tco{smp_mb__after_atomic()} & CP & + & a & a & Y & & Y & Y & Y & Y & \\ + \bottomrule +\end{tabular} + +\vspace{5pt}\hfill +\framebox[\width]{\footnotesize\setlength{\tabcolsep}{3pt} +\rowcolors{1}{}{} +\begin{tabular}{lrl} + Key: & C: & Ordering is cumulative \\ + & P: & Ordering propagates \\ + & R: & Read, or read portion of RMW \\ + & W: & Write, or write portion of RMW \\ + & Y: & Provides the specified ordering \\ + & a: & Provides specified ordering given intervening RMW atomic operation \\ + & DR: & Dependent read (address dependency) \\ + & DW: & Dependent write (address, data, or control dependency) \\ + & RMW: & Atomic read-modify-write operation \\ +\end{tabular} +} +\caption{Linux-Kernel Memory-Ordering Cheat Sheet} +\label{tab:app:styleguide:Linux-Kernel Memory-Ordering Cheat Sheet} +\end{table*} + +\begin{table*} +\small +\centering\OneColumnHSpace{-0.8in} +\renewcommand*{\arraystretch}{1.1} +\rowcolors{13}{lightgray}{} +\begin{tabular}{rlllllll}\toprule + & \multicolumn{1}{c}{\tco{P0()}} & \multicolumn{2}{c}{\tco{P0()} \& \tco{P1()}} & + \multicolumn{1}{c}{\tco{P1()}} & \multicolumn{3}{c}{\tco{P2()}} \\ + \cmidrule(l){2-2} \cmidrule(l){3-4} \cmidrule(lr){5-5} \cmidrule(l){6-8} + & Instruction & Store Buffer & Cache & Instruction & + Instruction & Store Buffer & Cache \\ + \cmidrule{1-1} \cmidrule(l){2-2} \cmidrule(l){3-3} \cmidrule(l){4-4} + \cmidrule(lr){5-5} \cmidrule(l){6-6} \cmidrule(l){7-7} \cmidrule(l){8-8} + 1 & (Initial state) & & \tco{y==&b} & + (Initial state) & + (Initial state) & & \tco{x==&a} \\ + 2 & \tco{x = &x;} & \tco{x==&x} & \tco{y==&b} & + & & & \tco{x==&a} \\ + 3 & (Read-Invalidate \tco{x}) & \tco{x==&x} & \tco{y==&b} & \tco{r1 = x} (\tco{&x}) + & & & \tco{x==&a} \\ + 4 & & \tco{x==&x} \tco{y==&x} & \tco{y==&b} & \tco{y = r1} + & \tco{r2 = y} & & \tco{x==&a} \\ + 5 & & \tco{x==&x} & \tco{y==&x} & (Finish store) + & (Read \tco{y}) & & \tco{x==&a} \\ + 6 & & \tco{x==&x} & \tco{y==&x} & + & (\tco{r2==&x}) & & \tco{x==&a} \tco{y==&x} \\ + 7 & & \tco{x==&x} & \tco{y==&x} & + & \tco{*r2 = &c} & \tco{y==&c} & \tco{x==&a} \tco{y==&x} \\ + 8 & & \tco{x==&x} & \tco{y==&x} & + & (Read Invalidate \tco{y}) & \tco{y==&c} & \tco{x==&a} \tco{y==&x} \\ + 9 & & \tco{x==&x} & & + & & \tco{y==&c} & \tco{x==&a} \tco{y==&x} \\ + 10 & & \tco{x==&x} & & + & (Finish store) & & \tco{x==&a} \tco{y==&c} \\ + 11 & & \tco{x==&x} & \tco{x==&a} & + & (Respond \co{x}) & & \tco{y==&c} \\ + 12 & (Finish store) & & \tco{x==&x} & + & & & \tco{y==&c} \\ + \bottomrule +\end{tabular} +\caption{Memory Ordering: WWC Sequence of Events} +\label{tab:app:styleguide:Memory Ordering: WWC Sequence of Events} +\end{table*} + \floatstyle{plain} \restylefloat{table} \captionsetup[table]{position=bottom,hangindent=0pt}
Signature · 1 line
2.7.4
Quoted 5 lines · Akira Yokosawa
Quoted 1 line
From
91874614a21874550a5d9ffa3d0fba5f6d6416f1Mon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Sun, 3 Sep 2017 23:39:54 +0900
Subject: [PATCH 0/2] Style guide updates
Quoted 8 lines
Hi Paul,
This patch set adds a section of ellipsis and a couple of experimental tables corresponding to new tables in memorder.
Booktabs' rules and gaps in mid-rules still works in these tables, I suppose.Let me know what you think.
Nice! I have applied these.
I played with Table D.13 (WWC) a bit, as the lightgray looked a bit heavy to me. Using lightgray!25 was too light and made me strain a bit to see the grey line, but anywhere between lightgray!35 and lightgray!60 looked fine.
The answer is probably "it depends" because my printer favors slightly darker than does my monitor. Might depend on the table as well, as I would guess that the more empty cells the heavier the color needs to be. Left to myself, I would choose lightgray!50. But what level of shading looks best to you on your equipment?
Either way, it looks way better than the current pervasive use of \hline in the main body of the text for those particular tables.
Thanx, Paul
Quoted 6 lines
Thanks, Akira
--
Akira Yokosawa (2):
styleguide: Add 'Ellipsis' section
styleguide: Add more experimental tables
Quoted 6 lines
appendix/styleguide/styleguide.tex | 206 ++++++++++++++++++++++++++++++------- 1 file changed, 169 insertions(+), 37 deletions(-)Signature · 1 line
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe perfbook" in
the body of a message to [email protected]
More majordomo info at https://urldefense.proofpoint.com/v2/url?u=http-3A__vger.kernel.org_majordomo-2Dinfo.html&d=DwIBAg&c=jf_iaSHvJObTbx-siA1ZOg&r=ux41CW3B5BSVxDMRNRWyLbUmPebZc70Kq4AkfdiRGMI&m=j_ozzr5UQ7iOShlWz8jTnJpIivzQDwzX4hXGV91eHYE&s=-RHivQTkGEHbdiIdPhnAtLS16Xe_FLwxMwZ8co2KLVU&e=
Quoted 13 lines · Paul E. McKenney
Quoted 12 lines · Akira Yokosawa
Quoted 1 line
From
91874614a21874550a5d9ffa3d0fba5f6d6416f1Mon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Sun, 3 Sep 2017 23:39:54 +0900
Subject: [PATCH 0/2] Style guide updatesHi Paul,
This patch set adds a section of ellipsis and a couple of experimental tables corresponding to new tables in memorder.
Booktabs' rules and gaps in mid-rules still works in these tables, I suppose.
Quoted 8 lines
Quoted 1 line
Let me know what you think.
Nice! I have applied these.
I played with Table D.13 (WWC) a bit, as the lightgray looked a bit heavy to me. Using lightgray!25 was too light and made me strain a bit to see the grey line, but anywhere between lightgray!35 and lightgray!60 looked fine.
lightgray is defined on line 930 in styleguide.tex at the moment. Current definition is:
\definecolor{lightgray}{gray}{0.9}You can tweak it as you like. If you need more variation, you can define another color and use it in specific tables.
But I'm against tweaking darkness in each table.
Quoted 6 lines
The answer is probably "it depends" because my printer favors slightly darker than does my monitor. Might depend on the table as well, as I would guess that the more empty cells the heavier the color needs to be. Left to myself, I would choose lightgray!50. But what level of shading looks best to you on your equipment?
It definitely depends on the printer/display to use.
But as the definition of lightgray can be tuned as you like, I'm OK with the default of, for example:
\definecolor{lightgray}{gray}{0.95}Let's see what people think.
The definition will be moved into perfbook.tex when we start conversion of table layout and should be easy to find for people to customize.
Thanks, Akira
Quoted 19 lines
Quoted 1 line
Either way, it looks way better than the current pervasive use of \hline
in the main body of the text for those particular tables.
Thanx, Paul
Quoted 12 lines
Thanks, Akira
--
Akira Yokosawa (2):
styleguide: Add 'Ellipsis' section
styleguide: Add more experimental tablesappendix/styleguide/styleguide.tex | 206 ++++++++++++++++++++++++++++++------- 1 file changed, 169 insertions(+), 37 deletions(-)Signature · 1 line
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe perfbook" in
the body of a message to [email protected]
More majordomo info at https://urldefense.proofpoint.com/v2/url?u=http-3A__vger.kernel.org_majordomo-2Dinfo.html&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=ux41CW3B5BSVxDMRNRWyLbUmPebZc70Kq4AkfdiRGMI&m=uyhL4QLWRXYTZychfv95fU4Rb5i9T45Skiw-rOvTrSY&s=sHKlmz4HbWX3x0yqdKF5SarQcDgJHf8f3R9ZYQk2mm4&e=
Quoted 23 lines · Akira Yokosawa
Quoted 13 lines · Paul E. McKenney
Quoted 12 lines · Akira Yokosawa
Quoted 1 line
From
91874614a21874550a5d9ffa3d0fba5f6d6416f1Mon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Sun, 3 Sep 2017 23:39:54 +0900
Subject: [PATCH 0/2] Style guide updatesHi Paul,
This patch set adds a section of ellipsis and a couple of experimental tables corresponding to new tables in memorder.
Booktabs' rules and gaps in mid-rules still works in these tables, I suppose.Quoted 8 lines
Quoted 1 line
Let me know what you think.
Nice! I have applied these.
I played with Table D.13 (WWC) a bit, as the lightgray looked a bit heavy to me. Using lightgray!25 was too light and made me strain a bit to see the grey line, but anywhere between lightgray!35 and lightgray!60 looked fine.
Quoted 8 lines
lightgray is defined on line 930 in styleguide.tex at the moment. Current definition is:
\definecolor{lightgray}{gray}{0.9}You can tweak it as you like. If you need more variation, you can define another color and use it in specific tables.
But I'm against tweaking darkness in each table.
Ah, I was assuming that lightgray was a builtin. Agreed, per-table tweaks should be avoided.
Quoted 10 lines
Quoted 5 lines
The answer is probably "it depends" because my printer favors slightly darker than does my monitor. Might depend on the table as well, as I would guess that the more empty cells the heavier the color needs to be. Left to myself, I would choose lightgray!50. But what level of shading looks best to you on your equipment?
It definitely depends on the printer/display to use.
But as the definition of lightgray can be tuned as you like, I'm OK with the default of, for example:
Quoted 6 lines
\definecolor{lightgray}{gray}{0.95}Let's see what people think.
The definition will be moved into perfbook.tex when we start conversion of table layout and should be easy to find for people to customize.
The people I showed printouts to prefered your level of grayness, so let's stick with that for the time being. But yes, easy adjustment is good, given the variation in monitors, printers, and eyes. ;-)
Thanx, Paul
Quoted 22 lines
Thanks, Akira
Quoted 19 lines
Quoted 1 line
Either way, it looks way better than the current pervasive use of \hline
in the main body of the text for those particular tables.
Thanx, Paul
Quoted 12 lines
Thanks, Akira
--
Akira Yokosawa (2):
styleguide: Add 'Ellipsis' section
styleguide: Add more experimental tablesappendix/styleguide/styleguide.tex | 206 ++++++++++++++++++++++++++++++------- 1 file changed, 169 insertions(+), 37 deletions(-)Signature · 1 line
2.7.4
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe perfbook" in
the body of a message to [email protected]
More majordomo info at https://urldefense.proofpoint.com/v2/url?u=http-3A__vger.kernel.org_majordomo-2Dinfo.html&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=ux41CW3B5BSVxDMRNRWyLbUmPebZc70Kq4AkfdiRGMI&m=uyhL4QLWRXYTZychfv95fU4Rb5i9T45Skiw-rOvTrSY&s=sHKlmz4HbWX3x0yqdKF5SarQcDgJHf8f3R9ZYQk2mm4&e=
--
To unsubscribe from this list: send the line "unsubscribe perfbook" in
the body of a message to [email protected]
More majordomo info at https://urldefense.proofpoint.com/v2/url?u=http-3A__vger.kernel.org_majordomo-2Dinfo.html&d=DwIBAg&c=jf_iaSHvJObTbx-siA1ZOg&r=ux41CW3B5BSVxDMRNRWyLbUmPebZc70Kq4AkfdiRGMI&m=MS4Ss7GQu0IZzTJ120BmJpvVMyZnQuEAFTFByGvMMx4&s=8Vyd5hRdslQKHP3rZclReXUd4jJP8CzoJqAkc22SLDo&e=