Skip to contentSkip to conversation

SMPdesign: fix typos

PATCH In review Junchang Wang 3 participants 4 messages Nov 16, 2018 – Nov 17, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SMPdesign: fix typos

---
Hi list,

There are a few typos in Section Partitioning. Please take a look.

Thanks,
--Junchang

--

 SMPdesign/SMPdesign.tex | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
SMPdesign/SMPdesign.tex +2 -2
index 7b4f6eb..562c057 100644
@@ -936,7 +936,7 @@ We could simply assign each CPU one gigabyte of memory, and allow
 each CPU to access its own private chunk of memory, without the
 need for locking and its complexities and overheads.
 Unfortunately, this simple scheme breaks down if an algorithm happens
-to have CPU~0 allocate all of the memory and CPU~1 the free it, as
+to have CPU~0 allocate all of the memory and CPU~1 free it, as
 would happen in a simple producer-consumer workload.
 
 The other extreme, code locking, suffers from excessive lock contention
@@ -1017,7 +1017,7 @@ smaller than the number of non-\co{NULL} pointers.
 The allocation function \co{memblock_alloc()} may be seen in
 Listing~\ref{lst:SMPdesign:Allocator-Cache Allocator Function}.
 Line~\lnref{pick} picks up the current thread's per-thread pool,
-and line~8 check to see if it is empty.
+and line~\lnref{chk:empty} checks to see if it is empty.
 
 If so, lines~\lnref{ack}-\lnref{rel} attempt to refill it
 from the global pool
Signature · 1 line
2.7.4
#1 lore raw

(Cc: Paul's latest address)
Hi Junchang,

Quoted 18 lines · Junchang Wang

---
Hi list,

There are a few typos in Section Partitioning. Please take a look.

Thanks,
--Junchang

--

 SMPdesign/SMPdesign.tex | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
SMPdesign/SMPdesign.tex +0 -0
index 7b4f6eb..562c057 100644

SMPdesign/SMPdesign.tex We could simply assign each CPU one gigabyte of memory, and allow · line 939

Quoted 5 lines
SMPdesign/SMPdesign.tex +1 -1
@@ -936,7 +936,7 @@ We could simply assign each CPU one gigabyte of memory, and allow
 each CPU to access its own private chunk of memory, without the
 need for locking and its complexities and overheads.
 Unfortunately, this simple scheme breaks down if an algorithm happens
-to have CPU~0 allocate all of the memory and CPU~1 the free it, as
+to have CPU~0 allocate all of the memory and CPU~1 free it, as

I guess Paul's intention was:

+to have CPU~0 allocate all of the memory and CPU~1 then free it, as

???

SMPdesign/SMPdesign.tex smaller than the number of non-\co{NULL} pointers. · line 1020

Quoted 9 lines
SMPdesign/SMPdesign.tex +1 -1
 would happen in a simple producer-consumer workload.
 
 The other extreme, code locking, suffers from excessive lock contention
@@ -1017,7 +1017,7 @@ smaller than the number of non-\co{NULL} pointers.
 The allocation function \co{memblock_alloc()} may be seen in
 Listing~\ref{lst:SMPdesign:Allocator-Cache Allocator Function}.
 Line~\lnref{pick} picks up the current thread's per-thread pool,
-and line~8 check to see if it is empty.
+and line~\lnref{chk:empty} checks to see if it is empty.

Nice catch!

Thanks, Akira

Quoted 4 lines
SMPdesign/SMPdesign.tex +0 -0
 If so, lines~\lnref{ack}-\lnref{rel} attempt to refill it
 from the global pool
 
#2 lore raw
Quoted 30 lines · Akira Yokosawa

(Cc: Paul's latest address)
Hi Junchang,

Quoted 18 lines · Junchang Wang

---
Hi list,

There are a few typos in Section Partitioning. Please take a look.

Thanks,
--Junchang

--

 SMPdesign/SMPdesign.tex | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
SMPdesign/SMPdesign.tex +0 -0
index 7b4f6eb..562c057 100644

SMPdesign/SMPdesign.tex We could simply assign each CPU one gigabyte of memory, and allow · line 939

Quoted 5 lines
SMPdesign/SMPdesign.tex +1 -1
@@ -936,7 +936,7 @@ We could simply assign each CPU one gigabyte of memory, and allow
 each CPU to access its own private chunk of memory, without the
 need for locking and its complexities and overheads.
 Unfortunately, this simple scheme breaks down if an algorithm happens
-to have CPU~0 allocate all of the memory and CPU~1 the free it, as
+to have CPU~0 allocate all of the memory and CPU~1 free it, as

I guess Paul's intention was:

Quoted 3 lines

+to have CPU~0 allocate all of the memory and CPU~1 then free it, as

???

You are right, that was my intention, but there significant room for improvement. Please see below for an updated version of Junchang's patch. Thoughts?

Quoted 11 lines

SMPdesign/SMPdesign.tex smaller than the number of non-\co{NULL} pointers. · line 1020

Quoted 9 lines
SMPdesign/SMPdesign.tex +1 -1
 would happen in a simple producer-consumer workload.
 
 The other extreme, code locking, suffers from excessive lock contention
@@ -1017,7 +1017,7 @@ smaller than the number of non-\co{NULL} pointers.
 The allocation function \co{memblock_alloc()} may be seen in
 Listing~\ref{lst:SMPdesign:Allocator-Cache Allocator Function}.
 Line~\lnref{pick} picks up the current thread's per-thread pool,
-and line~8 check to see if it is empty.
+and line~\lnref{chk:empty} checks to see if it is empty.

Nice catch!

Indeed, thank you both!!!

Quoted 5 lines

Thanks, Akira

Quoted 3 lines
SMPdesign/SMPdesign.tex +0 -0
 If so, lines~\lnref{ack}-\lnref{rel} attempt to refill it
 from the global pool

------------------------------------------------------------------------

commit 81c18b03d1aa2d3edc1dc28867e1f84413eb31e3

Author: Junchang Wang <[email protected]>
Date:   Fri Nov 16 16:19:57 2018 +0800

SMPdesign: Fix typos

[ paulmck: Rework to clarify original wording. ]
SMPdesign/SMPdesign.tex +6 -7
index 7b4f6eb2ba71..fe8f445851e3 100644
@@ -932,12 +932,11 @@ data ownership to this problem---simply carve up memory so that
 each CPU owns its share.
 For example, suppose that a system with two CPUs has two gigabytes
 of memory (such as the one that I am typing on right now).
-We could simply assign each CPU one gigabyte of memory, and allow
-each CPU to access its own private chunk of memory, without the
-need for locking and its complexities and overheads.
-Unfortunately, this simple scheme breaks down if an algorithm happens
-to have CPU~0 allocate all of the memory and CPU~1 the free it, as
-would happen in a simple producer-consumer workload.
+We could simply assign each CPU one gigabyte of memory, and allow each
+CPU to allocate from its own gigabyte, without the need for locking and
+its complexities and overheads.
+Unfortunately, this scheme fails when CPU~0 only allocates memory and
+CPU~1 only frees it, as happens in simple producer-consumer workloads.
 
 The other extreme, code locking, suffers from excessive lock contention
 and overhead~\cite{McKenney93}.
@@ -1017,7 +1016,7 @@ smaller than the number of non-\co{NULL} pointers.
 The allocation function \co{memblock_alloc()} may be seen in
 Listing~\ref{lst:SMPdesign:Allocator-Cache Allocator Function}.
 Line~\lnref{pick} picks up the current thread's per-thread pool,
-and line~8 check to see if it is empty.
+and line~\lnref{chk:empty} checks to see if it is empty.
 
 If so, lines~\lnref{ack}-\lnref{rel} attempt to refill it
 from the global pool
#3 lore raw
Quoted 32 lines · Paul E. McKenney
Quoted 30 lines · Akira Yokosawa

(Cc: Paul's latest address)
Hi Junchang,

Quoted 18 lines · Junchang Wang

---
Hi list,

There are a few typos in Section Partitioning. Please take a look.

Thanks,
--Junchang

--

 SMPdesign/SMPdesign.tex | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
SMPdesign/SMPdesign.tex +0 -0
index 7b4f6eb..562c057 100644

SMPdesign/SMPdesign.tex We could simply assign each CPU one gigabyte of memory, and allow · line 939

Quoted 5 lines
SMPdesign/SMPdesign.tex +1 -1
@@ -936,7 +936,7 @@ We could simply assign each CPU one gigabyte of memory, and allow
 each CPU to access its own private chunk of memory, without the
 need for locking and its complexities and overheads.
 Unfortunately, this simple scheme breaks down if an algorithm happens
-to have CPU~0 allocate all of the memory and CPU~1 the free it, as
+to have CPU~0 allocate all of the memory and CPU~1 free it, as

I guess Paul's intention was:

Quoted 8 lines
Quoted 3 lines

+to have CPU~0 allocate all of the memory and CPU~1 then free it, as

???

You are right, that was my intention, but there significant room for improvement. Please see below for an updated version of Junchang's patch. Thoughts?

Hi Paul and Akira,

The new patch looks good to me. Thanks a lot for the help.

Thanks,
--Junchang

Quoted 64 lines
Quoted 11 lines

SMPdesign/SMPdesign.tex smaller than the number of non-\co{NULL} pointers. · line 1020

Quoted 9 lines
SMPdesign/SMPdesign.tex +1 -1
 would happen in a simple producer-consumer workload.
 
 The other extreme, code locking, suffers from excessive lock contention
@@ -1017,7 +1017,7 @@ smaller than the number of non-\co{NULL} pointers.
 The allocation function \co{memblock_alloc()} may be seen in
 Listing~\ref{lst:SMPdesign:Allocator-Cache Allocator Function}.
 Line~\lnref{pick} picks up the current thread's per-thread pool,
-and line~8 check to see if it is empty.
+and line~\lnref{chk:empty} checks to see if it is empty.

Nice catch!

Indeed, thank you both!!!

Quoted 5 lines

Thanks, Akira

Quoted 3 lines
SMPdesign/SMPdesign.tex +0 -0
 If so, lines~\lnref{ack}-\lnref{rel} attempt to refill it
 from the global pool

------------------------------------------------------------------------

commit 81c18b03d1aa2d3edc1dc28867e1f84413eb31e3

Author: Junchang Wang <[email protected]>
Date:   Fri Nov 16 16:19:57 2018 +0800

SMPdesign: Fix typos

[ paulmck: Rework to clarify original wording. ]
SMPdesign/SMPdesign.tex +6 -7
index 7b4f6eb2ba71..fe8f445851e3 100644
@@ -932,12 +932,11 @@ data ownership to this problem---simply carve up memory so that
 each CPU owns its share.
 For example, suppose that a system with two CPUs has two gigabytes
 of memory (such as the one that I am typing on right now).
-We could simply assign each CPU one gigabyte of memory, and allow
-each CPU to access its own private chunk of memory, without the
-need for locking and its complexities and overheads.
-Unfortunately, this simple scheme breaks down if an algorithm happens
-to have CPU~0 allocate all of the memory and CPU~1 the free it, as
-would happen in a simple producer-consumer workload.
+We could simply assign each CPU one gigabyte of memory, and allow each
+CPU to allocate from its own gigabyte, without the need for locking and
+its complexities and overheads.
+Unfortunately, this scheme fails when CPU~0 only allocates memory and
+CPU~1 only frees it, as happens in simple producer-consumer workloads.
 
 The other extreme, code locking, suffers from excessive lock contention
 and overhead~\cite{McKenney93}.
@@ -1017,7 +1016,7 @@ smaller than the number of non-\co{NULL} pointers.
 The allocation function \co{memblock_alloc()} may be seen in
 Listing~\ref{lst:SMPdesign:Allocator-Cache Allocator Function}.
 Line~\lnref{pick} picks up the current thread's per-thread pool,
-and line~8 check to see if it is empty.
+and line~\lnref{chk:empty} checks to see if it is empty.
 
 If so, lines~\lnref{ack}-\lnref{rel} attempt to refill it
 from the global pool