All of lore.kernel.org
 help / color / mirror / Atom feed
* Memory barrier -- fix sample code
@ 2016-08-02  0:32 Balbir Singh
  2016-08-02  4:02 ` Paul E. McKenney
  0 siblings, 1 reply; 5+ messages in thread
From: Balbir Singh @ 2016-08-02  0:32 UTC (permalink / raw)
  To: perfbook; +Cc: paulmck

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: Memory barrier -- fix sample code
  2016-08-02  0:32 Memory barrier -- fix sample code Balbir Singh
@ 2016-08-02  4:02 ` Paul E. McKenney
  2016-08-02  8:05   ` Balbir Singh
  0 siblings, 1 reply; 5+ messages in thread
From: Paul E. McKenney @ 2016-08-02  4:02 UTC (permalink / raw)
  To: Balbir Singh; +Cc: perfbook

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
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Memory barrier -- fix sample code
  2016-08-02  4:02 ` Paul E. McKenney
@ 2016-08-02  8:05   ` Balbir Singh
  2016-08-02 12:09     ` Akira Yokosawa
  0 siblings, 1 reply; 5+ messages in thread
From: Balbir Singh @ 2016-08-02  8:05 UTC (permalink / raw)
  To: paulmck; +Cc: perfbook

On Mon, 2016-08-01 at 21:02 -0700, Paul E. McKenney wrote:
> 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

I thought I did a git pull before patching.

My git-head pointed to 413b7bc1cf6d65368300e96016ac15ac728b66fd

I'll double check. Thanks for applying it by hand

Balbir Singh.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Memory barrier -- fix sample code
  2016-08-02  8:05   ` Balbir Singh
@ 2016-08-02 12:09     ` Akira Yokosawa
  2016-08-08  4:58       ` Balbir Singh
  0 siblings, 1 reply; 5+ messages in thread
From: Akira Yokosawa @ 2016-08-02 12:09 UTC (permalink / raw)
  To: Balbir Singh; +Cc: paulmck, perfbook

On 2016/08/02 18:05:14 +1000, Balbir Singh wrote:
> On Mon, 2016-08-01 at 21:02 -0700, Paul E. McKenney wrote:
>> 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
> 
> I thought I did a git pull before patching.
> 
> My git-head pointed to 413b7bc1cf6d65368300e96016ac15ac728b66fd
> 
> I'll double check. Thanks for applying it by hand
> 

Hi,

Seems like a problem of character encoding.

I see you are using Evolution.
Here is an excerpt from Linux's Documentation/email-clients.txt.

----
Evolution (GUI)

Some people use this successfully for patches.

When composing mail select: Preformat
  from Format->Paragraph Style->Preformatted (Ctrl-7)
  or the toolbar

Then use:
  Insert->Text File... (Alt-n x)
to insert the patch.

You can also "diff -Nru old.c new.c | xclip", select Preformat, then
paste with the middle button.

----

I hope this helps.

                                   Thanks, Akira

> Balbir Singh.
> --
> To unsubscribe from this list: send the line "unsubscribe perfbook" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Memory barrier -- fix sample code
  2016-08-02 12:09     ` Akira Yokosawa
@ 2016-08-08  4:58       ` Balbir Singh
  0 siblings, 0 replies; 5+ messages in thread
From: Balbir Singh @ 2016-08-08  4:58 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: paulmck, perfbook



On 02/08/16 22:09, Akira Yokosawa wrote:
> On 2016/08/02 18:05:14 +1000, Balbir Singh wrote:
>> On Mon, 2016-08-01 at 21:02 -0700, Paul E. McKenney wrote:
>>> 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
>>
>> I thought I did a git pull before patching.
>>
>> My git-head pointed to 413b7bc1cf6d65368300e96016ac15ac728b66fd
>>
>> I'll double check. Thanks for applying it by hand
>>
> 
> Hi,
> 
> Seems like a problem of character encoding.
> 
> I see you are using Evolution.
> Here is an excerpt from Linux's Documentation/email-clients.txt.
> 


Yes, I do have flow-off and I use an external editor to prevent white
space damage. Thanks, I'll double check my editor settings

Balbir


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-08  4:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-02  0:32 Memory barrier -- fix sample code Balbir Singh
2016-08-02  4:02 ` Paul E. McKenney
2016-08-02  8:05   ` Balbir Singh
2016-08-02 12:09     ` Akira Yokosawa
2016-08-08  4:58       ` Balbir Singh

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.