whymb: Prevent line breaks of memory-barrier instruction
cover whymb: Prevent line breaks of memory-barrier instruction
From 343ea80f45c224bf2ecb4bcb84bdc924e8b9cb80 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 24 Apr 2017 07:23:27 +0900
Subject: [PATCH 0/4] whymb: Prevent line breaks of memory-barrier instruction
Hi Paul,
I wanted to prevent line breaks of memory-barrier instructions of SPARC and zSeries.
However, simply using \nbco{} for them ended up in build error. It turned out \detokenize{} command used in \nbco{} can't hold "#" character.
Patch #1 modifies the definition of \nbco{}.
Also, those instructions are easier to recognize with quotation marks. Instead of writing quotation marks around each instruction, patch #1 also adds a macro named \qco{}.
Patches 2 and 3 use \qco{} for memory-barrier instructions of SPARC and zSeries, respectively.
Patch 4 is to prevent hyphenation of "GPGPU".
Note that \tco{} macro still can't hold "#" character.
Thanks, Akira
--
Akira Yokosawa (4):
perfbook.tex: Modify definition of \nbco{}
whymb: Prevent line breaks between 'membar' and '#Sync', etc.
whymb: Prevent line breaks between "bcr" and "15,0" Add 'GPGPU' to non-hyphenation list
Makefile | 1 + appendix/whymb/whymemorybarriers.tex | 26 +++++++++++++------------- perfbook.tex | 3 ++- pfhyphex.tex | 2 ++ 4 files changed, 18 insertions(+), 14 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/4 perfbook.tex: Modify definition of \nbco{}
From c4f162ce5436bf0105d81cd012f11c4a30691683 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 22 Apr 2017 00:10:24 +0900
Subject: [PATCH 1/4] perfbook.tex: Modify definition of \nbco{}
It turns out that \nbco{} can't hold "#" character. Modify its definition to use the combination of a \co{} variant and \hbox{}.
Also add a macro named \qco{} which has quotation marks around \nbco{}.
--- perfbook.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
perfbook.tex +2 -1
@@ -111,7 +111,8 @@ \makeatother % --- End of workaround for Fedora 23 Texlive bug \newcommand{\co}[1]{\lstinline[breaklines=true,breakatwhitespace=true]{#1}} -\newcommand{\nbco}[1]{\hbox{\texttt{\detokenize{#1}}}} % no break lines for short snippet +\newcommand{\nbco}[1]{\hbox{\lstinline[breaklines=false,breakatwhitespace=false]{#1}}} % no break lines for short snippet +\newcommand{\qco}[1]{``\nbco{#1}''} % \nbco with quotation marks \newcommand{\tco}[1]{\texttt{\detokenize{#1}}} % for code in tabular environment % \tco{} will break at spaces but not at underscores \newcommand{\nf}[1]{\textnormal{#1}} % to return to normal font
Signature · 1 line
2.7.4
PATCH 2/4 whymb: Prevent line breaks between 'membar' and '#Sync', etc.
In reply to Akira YokosawaFrom 536d7df2df39c0d43bd9e7367b3e4b33c46238a6 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 22 Apr 2017 00:14:40 +0900
Subject: [PATCH 2/4] whymb: Prevent line breaks between 'membar' and '#Sync', etc.
These instruction variants are easier to recognize with quotation marks. Use \qco{} for them.
--- appendix/whymb/whymemorybarriers.tex | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
appendix/whymb/whymemorybarriers.tex +11 -11
@@ -2244,28 +2244,28 @@ as in \co{membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad}, thus fully ordering memory operations. -So, why is \co{membar #MemIssue} needed? -Because a \co{membar #StoreLoad} could permit a subsequent +So, why is \qco{membar #MemIssue} needed? +Because a \qco{membar #StoreLoad} could permit a subsequent load to get its value from a store buffer, which would be disastrous if the write was to an MMIO register that induced side effects on the value to be read. -In contrast, \co{membar #MemIssue} would wait until the store buffers +In contrast, \qco{membar #MemIssue} would wait until the store buffers were flushed before permitting the loads to execute, thereby ensuring that the load actually gets its value from the MMIO register. -Drivers could instead use \co{membar #Sync}, but the lighter-weight -\co{membar #MemIssue} is preferred in cases where the additional function -of the more-expensive \co{membar #Sync} are not required. +Drivers could instead use \qco{membar #Sync}, but the lighter-weight +\qco{membar #MemIssue} is preferred in cases where the additional function +of the more-expensive \qco{membar #Sync} are not required. -The \co{membar #Lookaside} is a lighter-weight version of -\co{membar #MemIssue}, which is useful when writing to a given MMIO register +The \qco{membar #Lookaside} is a lighter-weight version of +\qco{membar #MemIssue}, which is useful when writing to a given MMIO register affects the value that will next be read from that register. -However, the heavier-weight \co{membar #MemIssue} must be used when +However, the heavier-weight \qco{membar #MemIssue} must be used when a write to a given MMIO register affects the value that will next be read from {\em some other} MMIO register. It is not clear why SPARC does not define \co{wmb()} to be -\co{membar #MemIssue} and \co{smp_wmb()} to be -\co{membar #StoreStore}, +\qco{membar #MemIssue} and \co{smp_wmb()} to be +\qco{membar #StoreStore}, as the current definitions seem vulnerable to bugs in some drivers. It is quite possible that all the SPARC CPUs that Linux runs on implement a more conservative memory-ordering model than the architecture
Signature · 1 line
2.7.4
PATCH 3/4 whymb: Prevent line breaks between "bcr" and "15,0"
In reply to Akira YokosawaFrom 9b6444fcf2c6a57c2edb88ed81f0b35231a03d10 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 22 Apr 2017 00:19:54 +0900
Subject: [PATCH 3/4] whymb: Prevent line breaks between "bcr" and "15,0"
--- appendix/whymb/whymemorybarriers.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
appendix/whymb/whymemorybarriers.tex +2 -2
@@ -2345,7 +2345,7 @@ mainframe family, previously known as the 360, 370, and 390~\cite{IBMzSeries04a}. Parallelism came late to zSeries, but given that these mainframes first shipped in the mid 1960s, this is not saying much. -The \co{bcr 15,0} instruction is used for the Linux \co{smp_mb()}, +The \qco{bcr 15,0} instruction is used for the Linux \co{smp_mb()}, \co{smp_rmb()}, and \co{smp_wmb()} primitives. It also has comparatively strong memory-ordering semantics, as shown in Table~\ref{tab:app:whymb:Summary of Memory Ordering}, which should allow the
@@ -2363,7 +2363,7 @@ That said, many actual zSeries machines do in fact accommodate self-modifying code without serializing instructions. The zSeries instruction set provides a large set of serializing instructions, including compare-and-swap, some types of branches (for example, the -aforementioned \co{bcr 15,0} instruction), and test-and-set, +aforementioned \qco{bcr 15,0} instruction), and test-and-set, among others. \section{Are Memory Barriers Forever?}
Signature · 1 line
2.7.4
PATCH 4/4 Add 'GPGPU' to non-hyphenation list
In reply to Akira YokosawaFrom 343ea80f45c224bf2ecb4bcb84bdc924e8b9cb80 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 22 Apr 2017 00:20:41 +0900
Subject: [PATCH 4/4] Add 'GPGPU' to non-hyphenation list
Also add hyphenation list files to LATEXSOURCES in Makefile
--- Makefile | 1 + pfhyphex.tex | 2 ++ 2 files changed, 3 insertions(+)
Makefile +1 -0
@@ -4,6 +4,7 @@ LATEXSOURCES = \ glossary.tex \ qqz.sty origpub.sty \ book.cls \ + ushyphex.tex pfhyphex.tex \ */*.tex \ */*/*.tex
pfhyphex.tex +2 -0
@@ -1,4 +1,6 @@ \hyphenation{ REQACK COPART + GPGPU + GPGPUs }
Signature · 1 line
2.7.4
Paul E. McKenney
AppliedQuoted 20 lines · Akira Yokosawa
Quoted 1 line
From
343ea80f45c224bf2ecb4bcb84bdc924e8b9cb80Mon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Mon, 24 Apr 2017 07:23:27 +0900
Subject: [PATCH 0/4] whymb: Prevent line breaks of memory-barrier instructionHi Paul,
I wanted to prevent line breaks of memory-barrier instructions of SPARC and zSeries.
However, simply using \nbco{} for them ended up in build error. It turned out \detokenize{} command used in \nbco{} can't hold "#" character.
Patch #1 modifies the definition of \nbco{}.
Also, those instructions are easier to recognize with quotation marks. Instead of writing quotation marks around each instruction, patch #1 also adds a macro named \qco{}.
Patches 2 and 3 use \qco{} for memory-barrier instructions of SPARC and zSeries, respectively.
Patch 4 is to prevent hyphenation of "GPGPU".
Quoted 1 line
Note that \tco{} macro still can't hold "#" character.
Queued and pushed, thank you!
Thanx, Paul
Quoted 17 lines
Thanks, Akira
--
Akira Yokosawa (4):
perfbook.tex: Modify definition of \nbco{}
whymb: Prevent line breaks between 'membar' and '#Sync', etc.
whymb: Prevent line breaks between "bcr" and "15,0" Add 'GPGPU' to non-hyphenation listMakefile | 1 + appendix/whymb/whymemorybarriers.tex | 26 +++++++++++++------------- perfbook.tex | 3 ++- pfhyphex.tex | 2 ++ 4 files changed, 18 insertions(+), 14 deletions(-)Signature · 1 line
2.7.4