Skip to contentSkip to conversation

Misc updates and tweaks

PATCH Applied Akira Yokosawa 2 participants 7 messages Oct 14, 2025

lore
Share & tools
lore
#0 lore raw

cover Misc updates and tweaks

Hi Paul,

This is a random collection of misc updates.

Patch 1/5 improves the look of new snippet added recently. Patch 2/5 avoids build error of ubuntu:questing based container images. Patch 3/5 takes care of pre-v3.0 siunitx (Ubuntu focal). Patch 4/5 prevents page/column break in a short VerbatimN snippet. Patch 5/5 avoids the use of plain "-" as a minus sign.

Thanks, Akira

--
Akira Yokosawa (5):
intro: Use "VerbatimU" env for non-float code snippet
docker: Remove "-A" option from localedef
Provide \qty{} and \unit{} for siunitx < v3.0 cpu/overhead: Add "samepage=true" option to short VerbatimN env
intro: Say \co{-1} for constant -1

 cpu/overview.tex  | 2 +-
 docker/Dockerfile | 2 +-
 intro/intro.tex   | 8 +++-----
 perfbook-lt.tex   | 2 ++
 4 files changed, 7 insertions(+), 7 deletions(-)

base-commit: f8c73ec9c6006b74bc2d9a87b1379c74b7541e37

Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/5 intro: Use "VerbatimU" env for non-float code snippet

Let's use our custom environment for this sort of snippet.

---
 intro/intro.tex | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
intro/intro.tex +2 -4
index 7def3d9b..fc0f97e2 100644
@@ -1200,13 +1200,11 @@ adapting systems to run on multi-core systems.
 For example, consider the following hash-table API that might be used
 in sequential code:
 
-\begin{quote}
-\begin{verbatim}
+\begin{VerbatimU}
 int hash_add(struct htab *htp);
 int hash_del(int key);
 struct htab *hash_lookup(int key);
-\end{verbatim}
-\end{quote}
+\end{VerbatimU}
 
 Here, \co{hash_add()} and \co{hash_del()} both return the exact number
 of elements in the hash table after the operation completes, or -1
Signature · 1 line
2.43.0
#2 lore raw

PATCH 2/5 docker: Remove "-A" option from localedef

In reply to Akira Yokosawa

Ubuntu 25.10 stopped providing /usr/share/locale/locale.alias, which had been declared as "obsolete" for quite a while, as is mentioned in its header:

# Note: This file is obsolete and is kept around for the time being for

  # backward compatibility.  Nobody should rely on the names defined here.

Remove the option who depends on it.

Note: This option is still mentioned at ubuntu's container image description at https://hub.docker.com/_/ubuntu#locales as of this writing.

---
 docker/Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docker/Dockerfile +1 -1
index c3e2a237..ee120e4b 100644
@@ -2,7 +2,7 @@ ARG rel=latest
 FROM ubuntu:$rel
 
 RUN apt-get update && apt-get upgrade -y && apt-get install -y locales && \
-    localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 && \
+    localedef -i en_US -c -f UTF-8 en_US.UTF-8 && \
     rm -rf /var/lib/apt/lists/*
 ENV LANG en_US.utf8
 RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=UTC apt-get install -y tzdata && \
Signature · 1 line
2.43.0
#3 lore raw

PATCH 3/5 Provide \qty{} and \unit{} for siunitx < v3.0

In reply to Akira Yokosawa

Ubuntu focal (in ESM life cycle) carries siunitx v2.7u. Provide fall-back macros for it.

---
 perfbook-lt.tex | 2 ++
 1 file changed, 2 insertions(+)
perfbook-lt.tex +2 -0
index 1c7ea47e..e1dcd03f 100644
@@ -92,6 +92,8 @@
 \usepackage{braket} % for \ket{} macro in QC section
 \usepackage{siunitx} % for \num{} macro and \unit{} (such as \percent)
 \sisetup{group-minimum-digits=4,group-separator={,},group-digits=integer}
+\providecommand{\unit}{\si} % for siunitx < 3.0
+\providecommand{\qty}{\SI} % for siunitx < 3.0
 \usepackage{multirow}
 \usepackage{noindentafter}
 \NoIndentAfterCmd{\epigraph}
Signature · 1 line
2.43.0
#4 lore raw

PATCH 4/5 cpu/overhead: Add "samepage=true" option to short VerbatimN env

In reply to Akira Yokosawa

Page/column break in the middle of this snippet should better be avoided.

---
 cpu/overview.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cpu/overview.tex +1 -1
index eedf8491..8a184f3c 100644
@@ -255,7 +255,7 @@ as described in the next section.
 In the meantime, consider the following simple lock-based \IX{critical
 section}:
 
-\begin{VerbatimN}
+\begin{VerbatimN}[samepage=true]
 spin_lock(&mylock);
 a = a + 1;
 spin_unlock(&mylock);
Signature · 1 line
2.43.0
#5 lore raw

PATCH 5/5 intro: Say \co{-1} for constant -1

In reply to Akira Yokosawa
---
 intro/intro.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
intro/intro.tex +1 -1
index fc0f97e2..4d51a965 100644
@@ -1207,7 +1207,7 @@ struct htab *hash_lookup(int key);
 \end{VerbatimU}
 
 Here, \co{hash_add()} and \co{hash_del()} both return the exact number
-of elements in the hash table after the operation completes, or -1
+of elements in the hash table after the operation completes, or \co{-1}
 if the operation fails due to duplicate key or non-existent key,
 respectively.
 The \co{hash_lookup()} function takes a key and returns a pointer to
Signature · 1 line
2.43.0
#6 lore raw
In reply to Akira Yokosawa
Quoted 9 lines · Akira Yokosawa

Hi Paul,

This is a random collection of misc updates.

Patch 1/5 improves the look of new snippet added recently. Patch 2/5 avoids build error of ubuntu:questing based container images. Patch 3/5 takes care of pre-v3.0 siunitx (Ubuntu focal). Patch 4/5 prevents page/column break in a short VerbatimN snippet. Patch 5/5 avoids the use of plain "-" as a minus sign.

Queued and pushed, thank you!

Thanx, Paul

Quoted 21 lines

Thanks, Akira

--
Akira Yokosawa (5):
intro: Use "VerbatimU" env for non-float code snippet
docker: Remove "-A" option from localedef
Provide \qty{} and \unit{} for siunitx < v3.0 cpu/overhead: Add "samepage=true" option to short VerbatimN env
intro: Say \co{-1} for constant -1

 cpu/overview.tex  | 2 +-
 docker/Dockerfile | 2 +-
 intro/intro.tex   | 8 +++-----
 perfbook-lt.tex   | 2 ++
 4 files changed, 7 insertions(+), 7 deletions(-)

base-commit: f8c73ec9c6006b74bc2d9a87b1379c74b7541e37

Signature · 1 line
2.43.0