All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Balbir Singh <bsingharora@gmail.com>
Cc: perfbook@vger.kernel.org
Subject: Re: Memory barrier -- fix sample code
Date: Mon, 1 Aug 2016 21:02:04 -0700	[thread overview]
Message-ID: <20160802040204.GY3482@linux.vnet.ibm.com> (raw)
In-Reply-To: <1470097946.3000.3.camel@gmail.com>

On Tue, Aug 02, 2016 at 10:32:26AM +1000, Balbir Singh wrote:
> 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>

Good catch, applied, thank you!

However, I had to apply this by hand due to some recent mass changes to
figures containing code.  Could you please move to current perfbook.git
for future submissions?

							Thanx, Paul

> ---
>  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
> 


  reply	other threads:[~2016-08-02  4:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02  0:32 Memory barrier -- fix sample code Balbir Singh
2016-08-02  4:02 ` Paul E. McKenney [this message]
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=20160802040204.GY3482@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=bsingharora@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.