From: Balbir Singh <bsingharora@gmail.com>
To: perfbook@vger.kernel.org
Cc: paulmck@linux.vnet.ibm.com
Subject: Memory barrier -- fix sample code
Date: Tue, 02 Aug 2016 10:32:26 +1000 [thread overview]
Message-ID: <1470097946.3000.3.camel@gmail.com> (raw)
From: Balbir singh <bsingharora@gmail.com>
Date: Tue, 2 Aug 2016 10:26:34 +1000
Subject: [PATCH] Correct a sample in memorybarriers.tex
We probably don't want to show GFP_KERNEL allocation
under spin_lock, GFP_ATOMIC seems much better.
Signed-off-by: Balbir singh <bsingharora@gmail.com>
---
advsync/memorybarriers.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/advsync/memorybarriers.tex b/advsync/memorybarriers.tex
index 9eaa0ea..efbd4a2 100644
--- a/advsync/memorybarriers.tex
+++ b/advsync/memorybarriers.tex
@@ -936,7 +936,7 @@ Then the following code might leak memory!
\begin{verbatim}
spin_lock(&mylock);
if (p == NULL)
- p = kmalloc(sizeof(*p), GFP_KERNEL);
+ p = kmalloc(sizeof(*p), GFP_ATOMIC);
spin_unlock(&mylock);
\end{verbatim}
\end{minipage}
--
2.7.4
next reply other threads:[~2016-08-02 0:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-02 0:32 Balbir Singh [this message]
2016-08-02 4:02 ` Memory barrier -- fix sample code Paul E. McKenney
2016-08-02 8:05 ` Balbir Singh
2016-08-02 12:09 ` Akira Yokosawa
2016-08-08 4:58 ` Balbir Singh
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=1470097946.3000.3.camel@gmail.com \
--to=bsingharora@gmail.com \
--cc=paulmck@linux.vnet.ibm.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.