From: Hitoshi Mitake <mitake.hitoshi@gmail.com>
To: perfbook@vger.kernel.org
Cc: mitake.hitoshi@gmail.com
Subject: [PATCH 2/2] Let a writer thread go back to the original CPU in the toy RCU pseudocode
Date: Sat, 20 Feb 2016 17:52:02 +0900 [thread overview]
Message-ID: <1455958322-25225-2-git-send-email-mitake.hitoshi@gmail.com> (raw)
In-Reply-To: <1455958322-25225-1-git-send-email-mitake.hitoshi@gmail.com>
This commit a little bit improves the logic of a writer thread. The
new logic lets the writer go back to the original CPU after run_on()
the final CPU.
Of course it is a trivial improvement and the original two lines
pseudocode is beautiful. If it isn't worth to apply, please ignore it.
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@gmail.com>
---
defer/rcuintro.tex | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/defer/rcuintro.tex b/defer/rcuintro.tex
index 03d6e12..135922c 100644
--- a/defer/rcuintro.tex
+++ b/defer/rcuintro.tex
@@ -166,8 +166,11 @@ quite complex, a toy implementation is exceedingly simple:
\begin{minipage}[t]{\columnwidth}
\scriptsize
\begin{verbatim}
- 1 for_each_online_cpu(cpu)
- 2 run_on(cpu);
+ 1 int orig_cpu = smp_processor_id();
+ 2 for_each_online_cpu(cpu)
+ 3 run_on(cpu);
+ 4 if (orig_cpu != smp_processor_id())
+ 5 run_on(orig_cpu);
\end{verbatim}
\end{minipage}
\vspace{5pt}
--
1.9.1
next prev parent reply other threads:[~2016-02-20 8:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-20 8:52 [PATCH 1/2] Improve the figure of QSBR Hitoshi Mitake
2016-02-20 8:52 ` Hitoshi Mitake [this message]
2016-02-21 5:30 ` [PATCH 2/2] Let a writer thread go back to the original CPU in the toy RCU pseudocode Paul E. McKenney
2016-02-21 7:52 ` Hitoshi Mitake
2016-02-20 13:27 ` [PATCH 1/2] Improve the figure of QSBR Hitoshi Mitake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455958322-25225-2-git-send-email-mitake.hitoshi@gmail.com \
--to=mitake.hitoshi@gmail.com \
--cc=perfbook@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.