Skip to contentSkip to conversation

memorder: fix a line number reference error

PATCH In review Zhouyi Zhou 3 participants 5 messages Oct 14, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memorder: fix a line number reference error

In section 15.2.3, "Listing 15.10 shows how to make this work reliably on pre-v4.15 Linux kernels running on DEC Alpha, by replacing line 19' READ_ONCE() with lockless_dereference()"

line 19 should be line 18.

---
Hi Paul
I like Chapter 15 very much as well as other chapters, I used to read one paragraph a day when I am travelling ;-)

I think there is a small line number reference error in chapter 15.2.3, ignore me if it is not a error.

Many Thanks
Zhouyi
--

 memorder/memorder.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
memorder/memorder.tex +1 -1
index c350758d..1839e276 100644
@@ -1279,7 +1279,7 @@ exists (1:r2=x0 /\ 1:r3=1)
 % \path{C-MP+o-wmb-o+ld-addr-o.litmus} available at commit bc4b1c3f3b35
 % ("styleguide: Loosen restriction on comment in litmus test")
 shows how to make this work reliably on pre-v4.15 Linux kernels running on
-DEC Alpha, by replacing \clnref{read}'s \co{READ_ONCE()} with
+DEC Alpha, by replacing \clnref{deref}'s \co{READ_ONCE()} with
 \apikh{lockless_dereference()},\footnote{
 	Note that \co{lockless_dereference()} is not needed on v4.15 and
 	later, and therefore is not available in these later Linux kernels.
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/1 memorder: fix a line number reference error

Section 15.2.3 says,

"Listing 15.10 shows how to make this work reliably on pre-v4.15
Linux kernels running on DEC Alpha, by replacing line 19's READ_ONCE() with lockless_dereference()."

However, the READ_ONCE() is actually on line 18 of Listing 15.9.

Fix the reference and clarify the READ_ONCE() is in Listing 15.9.

---
v1 (from Zhouyi) -> v2

- Reference line 18 of Listing 15.9.
- Adjust wording around the fixed reference.
- Zhouyi's Reported-by.

Zhouyi, how does this look to you?

Thanks, Akira
--

 memorder/memorder.tex | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
memorder/memorder.tex +4 -3
index c350758d61cb..28319bfba16b 100644
@@ -1274,13 +1274,14 @@ exists (1:r2=x0 /\ 1:r3=1)
 \label{lst:memorder:Enforced Ordering of Message-Passing Address-Dependency Litmus Test (Before v4.15)}
 \end{listing}
 
-\begin{fcvref}[ln:memorder:Enforced Ordering of Message-Passing Address-Dependency Litmus Test (Before v4.15)]
+\begin{fcvref}[ln:formal:C-MP+o-wmb-o+o-addr-o:whole]
 \Cref{lst:memorder:Enforced Ordering of Message-Passing Address-Dependency Litmus Test (Before v4.15)}
 % \path{C-MP+o-wmb-o+ld-addr-o.litmus} available at commit bc4b1c3f3b35
 % ("styleguide: Loosen restriction on comment in litmus test")
 shows how to make this work reliably on pre-v4.15 Linux kernels running on
-DEC Alpha, by replacing \clnref{read}'s \co{READ_ONCE()} with
-\apikh{lockless_dereference()},\footnote{
+DEC Alpha, by replacing \co{READ_ONCE()} on \clnref{P1:x1} of
+\cref{lst:memorder:Message-Passing Address-Dependency Litmus Test (No Ordering Before v4.15)}
+with \apikh{lockless_dereference()},\footnote{
 	Note that \co{lockless_dereference()} is not needed on v4.15 and
 	later, and therefore is not available in these later Linux kernels.
 	Nor is it needed in versions of this book containing this sentence.}

base-commit: c2b75b99a151008c6b59bddcabb9e44e744f3678

Signature · 1 line
2.25.1
#2 lore raw

Thank Akira for your fantastic work!

Quoted 10 lines · Akira Yokosawa

Section 15.2.3 says,

"Listing 15.10 shows how to make this work reliably on pre-v4.15
Linux kernels running on DEC Alpha, by replacing line 19's READ_ONCE() with lockless_dereference()."

However, the READ_ONCE() is actually on line 18 of Listing 15.9.

Fix the reference and clarify the READ_ONCE() is in Listing 15.9.

Yes lockless_dereference() is replacing READ_ONCE() in List 15.9

Quoted 11 lines

---
v1 (from Zhouyi) -> v2

- Reference line 18 of Listing 15.9.
- Adjust wording around the fixed reference.
- Zhouyi's Reported-by.

Zhouyi, how does this look to you?

Thank Akira for your advice and guidance! I downloaded you patch and
1) patch -p 1 < "[PATCH -perfbook v2] memorder_ fix a line number reference error.eml"
2) make -j 16
then read perfbook.pdf

It is much more perfect than I can expect!

and from your example, I know how to add reference to code next time I am creating a patch!

Thank both of you for your enthusiasm and patience!

Thanks
Zhouyi

Quoted 34 lines

Thanks, Akira
--

 memorder/memorder.tex | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
memorder/memorder.tex +4 -3
index c350758d61cb..28319bfba16b 100644
@@ -1274,13 +1274,14 @@ exists (1:r2=x0 /\ 1:r3=1)
 \label{lst:memorder:Enforced Ordering of Message-Passing Address-Dependency Litmus Test (Before v4.15)}
 \end{listing}
 
-\begin{fcvref}[ln:memorder:Enforced Ordering of Message-Passing Address-Dependency Litmus Test (Before v4.15)]
+\begin{fcvref}[ln:formal:C-MP+o-wmb-o+o-addr-o:whole]
 \Cref{lst:memorder:Enforced Ordering of Message-Passing Address-Dependency Litmus Test (Before v4.15)}
 % \path{C-MP+o-wmb-o+ld-addr-o.litmus} available at commit bc4b1c3f3b35
 % ("styleguide: Loosen restriction on comment in litmus test")
 shows how to make this work reliably on pre-v4.15 Linux kernels running on
-DEC Alpha, by replacing \clnref{read}'s \co{READ_ONCE()} with
-\apikh{lockless_dereference()},\footnote{
+DEC Alpha, by replacing \co{READ_ONCE()} on \clnref{P1:x1} of
+\cref{lst:memorder:Message-Passing Address-Dependency Litmus Test (No Ordering Before v4.15)}
+with \apikh{lockless_dereference()},\footnote{
        Note that \co{lockless_dereference()} is not needed on v4.15 and
        later, and therefore is not available in these later Linux kernels.
        Nor is it needed in versions of this book containing this sentence.}

base-commit: c2b75b99a151008c6b59bddcabb9e44e744f3678 --
2.25.1

#3 lore raw
In reply to Akira Yokosawa
Quoted 15 lines · Akira Yokosawa

Section 15.2.3 says,

"Listing 15.10 shows how to make this work reliably on pre-v4.15
Linux kernels running on DEC Alpha, by replacing line 19's READ_ONCE() with lockless_dereference()."

However, the READ_ONCE() is actually on line 18 of Listing 15.9.

Fix the reference and clarify the READ_ONCE() is in Listing 15.9.

---
v1 (from Zhouyi) -> v2

Quoted 7 lines

- Reference line 18 of Listing 15.9.
- Adjust wording around the fixed reference.
- Zhouyi's Reported-by.

Zhouyi, how does this look to you?

Thanks, Akira

Queued and pushed, thank you both!

Thanx, Paul

Quoted 32 lines

--

 memorder/memorder.tex | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
memorder/memorder.tex +4 -3
index c350758d61cb..28319bfba16b 100644
@@ -1274,13 +1274,14 @@ exists (1:r2=x0 /\ 1:r3=1)
 \label{lst:memorder:Enforced Ordering of Message-Passing Address-Dependency Litmus Test (Before v4.15)}
 \end{listing}
 
-\begin{fcvref}[ln:memorder:Enforced Ordering of Message-Passing Address-Dependency Litmus Test (Before v4.15)]
+\begin{fcvref}[ln:formal:C-MP+o-wmb-o+o-addr-o:whole]
 \Cref{lst:memorder:Enforced Ordering of Message-Passing Address-Dependency Litmus Test (Before v4.15)}
 % \path{C-MP+o-wmb-o+ld-addr-o.litmus} available at commit bc4b1c3f3b35
 % ("styleguide: Loosen restriction on comment in litmus test")
 shows how to make this work reliably on pre-v4.15 Linux kernels running on
-DEC Alpha, by replacing \clnref{read}'s \co{READ_ONCE()} with
-\apikh{lockless_dereference()},\footnote{
+DEC Alpha, by replacing \co{READ_ONCE()} on \clnref{P1:x1} of
+\cref{lst:memorder:Message-Passing Address-Dependency Litmus Test (No Ordering Before v4.15)}
+with \apikh{lockless_dereference()},\footnote{
 	Note that \co{lockless_dereference()} is not needed on v4.15 and
 	later, and therefore is not available in these later Linux kernels.
 	Nor is it needed in versions of this book containing this sentence.}

base-commit: c2b75b99a151008c6b59bddcabb9e44e744f3678

Signature · 1 line
2.25.1
#4 lore raw
In reply to Zhouyi Zhou

Hi,

Quoted 5 lines · Zhouyi Zhou

In section 15.2.3, "Listing 15.10 shows how to make this work reliably on pre-v4.15 Linux kernels running on DEC Alpha, by replacing line 19' READ_ONCE() with lockless_dereference()"

line 19 should be line 18.

Close!

The reference should be to line 18 of Listing 15.9, where the to-be- replaced READ_ONCE() resides.

I'll submit a patch soon with your Reported-by.

Thanks, Akira

Quoted 29 lines

---
Hi Paul
I like Chapter 15 very much as well as other chapters, I used to read one paragraph a day when I am travelling ;-)

I think there is a small line number reference error in chapter 15.2.3, ignore me if it is not a error.

Many Thanks
Zhouyi
--

 memorder/memorder.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
memorder/memorder.tex +1 -1
index c350758d..1839e276 100644
@@ -1279,7 +1279,7 @@ exists (1:r2=x0 /\ 1:r3=1)
 % \path{C-MP+o-wmb-o+ld-addr-o.litmus} available at commit bc4b1c3f3b35
 % ("styleguide: Loosen restriction on comment in litmus test")
 shows how to make this work reliably on pre-v4.15 Linux kernels running on
-DEC Alpha, by replacing \clnref{read}'s \co{READ_ONCE()} with
+DEC Alpha, by replacing \clnref{deref}'s \co{READ_ONCE()} with
 \apikh{lockless_dereference()},\footnote{
 	Note that \co{lockless_dereference()} is not needed on v4.15 and
 	later, and therefore is not available in these later Linux kernels.