* [PATCH] SMPdesign: fix typos
@ 2018-11-16 8:19 Junchang Wang
2018-11-16 15:01 ` Akira Yokosawa
0 siblings, 1 reply; 4+ messages in thread
From: Junchang Wang @ 2018-11-16 8:19 UTC (permalink / raw)
To: paulmck; +Cc: perfbook, Junchang Wang
Signed-off-by: Junchang Wang <junchangwang@gmail.com>
---
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(-)
diff --git a/SMPdesign/SMPdesign.tex b/SMPdesign/SMPdesign.tex
index 7b4f6eb..562c057 100644
--- a/SMPdesign/SMPdesign.tex
+++ b/SMPdesign/SMPdesign.tex
@@ -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
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] SMPdesign: fix typos
2018-11-16 8:19 [PATCH] SMPdesign: fix typos Junchang Wang
@ 2018-11-16 15:01 ` Akira Yokosawa
2018-11-16 20:13 ` Paul E. McKenney
0 siblings, 1 reply; 4+ messages in thread
From: Akira Yokosawa @ 2018-11-16 15:01 UTC (permalink / raw)
To: Junchang Wang; +Cc: Paul E. McKenney, perfbook, Akira Yokosawa
(Cc: Paul's latest address)
Hi Junchang,
On 2018/11/16 16:19:57 +0800, Junchang Wang wrote:
> Signed-off-by: Junchang Wang <junchangwang@gmail.com>
> ---
> 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(-)
>
> diff --git a/SMPdesign/SMPdesign.tex b/SMPdesign/SMPdesign.tex
> index 7b4f6eb..562c057 100644
> --- a/SMPdesign/SMPdesign.tex
> +++ b/SMPdesign/SMPdesign.tex
> @@ -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
???
> 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
>
> If so, lines~\lnref{ack}-\lnref{rel} attempt to refill it
> from the global pool
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] SMPdesign: fix typos
2018-11-16 15:01 ` Akira Yokosawa
@ 2018-11-16 20:13 ` Paul E. McKenney
2018-11-17 8:26 ` Junchang Wang
0 siblings, 1 reply; 4+ messages in thread
From: Paul E. McKenney @ 2018-11-16 20:13 UTC (permalink / raw)
To: Akira Yokosawa; +Cc: Junchang Wang, perfbook
On Sat, Nov 17, 2018 at 12:01:11AM +0900, Akira Yokosawa wrote:
> (Cc: Paul's latest address)
> Hi Junchang,
>
> On 2018/11/16 16:19:57 +0800, Junchang Wang wrote:
> > Signed-off-by: Junchang Wang <junchangwang@gmail.com>
> > ---
> > 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(-)
> >
> > diff --git a/SMPdesign/SMPdesign.tex b/SMPdesign/SMPdesign.tex
> > index 7b4f6eb..562c057 100644
> > --- a/SMPdesign/SMPdesign.tex
> > +++ b/SMPdesign/SMPdesign.tex
> > @@ -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
>
> ???
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?
> > 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!!!
> Thanks, Akira
>
> >
> > If so, lines~\lnref{ack}-\lnref{rel} attempt to refill it
> > from the global pool
------------------------------------------------------------------------
commit 81c18b03d1aa2d3edc1dc28867e1f84413eb31e3
Author: Junchang Wang <junchangwang@gmail.com>
Date: Fri Nov 16 16:19:57 2018 +0800
SMPdesign: Fix typos
Signed-off-by: Junchang Wang <junchangwang@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
[ paulmck: Rework to clarify original wording. ]
diff --git a/SMPdesign/SMPdesign.tex b/SMPdesign/SMPdesign.tex
index 7b4f6eb2ba71..fe8f445851e3 100644
--- a/SMPdesign/SMPdesign.tex
+++ b/SMPdesign/SMPdesign.tex
@@ -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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] SMPdesign: fix typos
2018-11-16 20:13 ` Paul E. McKenney
@ 2018-11-17 8:26 ` Junchang Wang
0 siblings, 0 replies; 4+ messages in thread
From: Junchang Wang @ 2018-11-17 8:26 UTC (permalink / raw)
To: Paul McKenney, Akira Yokosawa; +Cc: perfbook
On Sat, Nov 17, 2018 at 5:46 AM Paul E. McKenney <paulmck@linux.ibm.com> wrote:
>
> On Sat, Nov 17, 2018 at 12:01:11AM +0900, Akira Yokosawa wrote:
> > (Cc: Paul's latest address)
> > Hi Junchang,
> >
> > On 2018/11/16 16:19:57 +0800, Junchang Wang wrote:
> > > Signed-off-by: Junchang Wang <junchangwang@gmail.com>
> > > ---
> > > 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(-)
> > >
> > > diff --git a/SMPdesign/SMPdesign.tex b/SMPdesign/SMPdesign.tex
> > > index 7b4f6eb..562c057 100644
> > > --- a/SMPdesign/SMPdesign.tex
> > > +++ b/SMPdesign/SMPdesign.tex
> > > @@ -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
> >
> > ???
>
> 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
> > > 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!!!
>
> > Thanks, Akira
> >
> > >
> > > If so, lines~\lnref{ack}-\lnref{rel} attempt to refill it
> > > from the global pool
>
> ------------------------------------------------------------------------
>
> commit 81c18b03d1aa2d3edc1dc28867e1f84413eb31e3
> Author: Junchang Wang <junchangwang@gmail.com>
> Date: Fri Nov 16 16:19:57 2018 +0800
>
> SMPdesign: Fix typos
>
> Signed-off-by: Junchang Wang <junchangwang@gmail.com>
> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
> [ paulmck: Rework to clarify original wording. ]
>
> diff --git a/SMPdesign/SMPdesign.tex b/SMPdesign/SMPdesign.tex
> index 7b4f6eb2ba71..fe8f445851e3 100644
> --- a/SMPdesign/SMPdesign.tex
> +++ b/SMPdesign/SMPdesign.tex
> @@ -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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-11-17 8:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-16 8:19 [PATCH] SMPdesign: fix typos Junchang Wang
2018-11-16 15:01 ` Akira Yokosawa
2018-11-16 20:13 ` Paul E. McKenney
2018-11-17 8:26 ` Junchang Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.