public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] percpu: fix generic definition of __this_cpu_add_and_return()
@ 2012-02-19 14:29 Konstantin Khlebnikov
  2012-02-21 15:53 ` Christoph Lameter
  2012-02-24 15:33 ` Torsten Kaiser
  0 siblings, 2 replies; 6+ messages in thread
From: Konstantin Khlebnikov @ 2012-02-19 14:29 UTC (permalink / raw)
  To: Tejun Heo, Christoph Lameter; +Cc: linux-kernel

This patch adds missed "__" into function prefix.
Otherwise on all archectures (except x86) it expands to irq/preemtion-safe
variant: _this_cpu_generic_add_return(), which do extra irq-save/irq-restore.
Optimal generic implementation is __this_cpu_generic_add_return().

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
 include/linux/percpu.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 32cd1f6..3b609eb 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -718,7 +718,8 @@ do {									\
 # ifndef __this_cpu_add_return_8
 #  define __this_cpu_add_return_8(pcp, val)	__this_cpu_generic_add_return(pcp, val)
 # endif
-# define __this_cpu_add_return(pcp, val)	__pcpu_size_call_return2(this_cpu_add_return_, pcp, val)
+# define __this_cpu_add_return(pcp, val)	\
+	__pcpu_size_call_return2(__this_cpu_add_return_, pcp, val)
 #endif
 
 #define __this_cpu_sub_return(pcp, val)	this_cpu_add_return(pcp, -(val))


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

* Re: [PATCH] percpu: fix generic definition of __this_cpu_add_and_return()
  2012-02-19 14:29 [PATCH] percpu: fix generic definition of __this_cpu_add_and_return() Konstantin Khlebnikov
@ 2012-02-21 15:53 ` Christoph Lameter
  2012-02-21 16:58   ` Tejun Heo
  2012-02-24 15:33 ` Torsten Kaiser
  1 sibling, 1 reply; 6+ messages in thread
From: Christoph Lameter @ 2012-02-21 15:53 UTC (permalink / raw)
  To: Konstantin Khlebnikov; +Cc: Tejun Heo, linux-kernel

On Sun, 19 Feb 2012, Konstantin Khlebnikov wrote:

> This patch adds missed "__" into function prefix.
> Otherwise on all archectures (except x86) it expands to irq/preemtion-safe
> variant: _this_cpu_generic_add_return(), which do extra irq-save/irq-restore.
> Optimal generic implementation is __this_cpu_generic_add_return().

Acked-by: Christoph Lameter <cl@linux.com>

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

* Re: [PATCH] percpu: fix generic definition of __this_cpu_add_and_return()
  2012-02-21 15:53 ` Christoph Lameter
@ 2012-02-21 16:58   ` Tejun Heo
  0 siblings, 0 replies; 6+ messages in thread
From: Tejun Heo @ 2012-02-21 16:58 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: Konstantin Khlebnikov, linux-kernel

On Tue, Feb 21, 2012 at 09:53:08AM -0600, Christoph Lameter wrote:
> On Sun, 19 Feb 2012, Konstantin Khlebnikov wrote:
> 
> > This patch adds missed "__" into function prefix.
> > Otherwise on all archectures (except x86) it expands to irq/preemtion-safe
> > variant: _this_cpu_generic_add_return(), which do extra irq-save/irq-restore.
> > Optimal generic implementation is __this_cpu_generic_add_return().
> 
> Acked-by: Christoph Lameter <cl@linux.com>

Applied to 3.3-fixes.  Thanks.

-- 
tejun

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

* Re: [PATCH] percpu: fix generic definition of __this_cpu_add_and_return()
  2012-02-19 14:29 [PATCH] percpu: fix generic definition of __this_cpu_add_and_return() Konstantin Khlebnikov
  2012-02-21 15:53 ` Christoph Lameter
@ 2012-02-24 15:33 ` Torsten Kaiser
  2012-02-24 15:43   ` Christoph Lameter
  1 sibling, 1 reply; 6+ messages in thread
From: Torsten Kaiser @ 2012-02-24 15:33 UTC (permalink / raw)
  To: Konstantin Khlebnikov; +Cc: Tejun Heo, Christoph Lameter, linux-kernel

On Sun, Feb 19, 2012 at 3:29 PM, Konstantin Khlebnikov
<khlebnikov@openvz.org> wrote:
> This patch adds missed "__" into function prefix.
> Otherwise on all archectures (except x86) it expands to irq/preemtion-safe
> variant: _this_cpu_generic_add_return(), which do extra irq-save/irq-restore.
> Optimal generic implementation is __this_cpu_generic_add_return().
>
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
> ---
>  include/linux/percpu.h |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/percpu.h b/include/linux/percpu.h
> index 32cd1f6..3b609eb 100644
> --- a/include/linux/percpu.h
> +++ b/include/linux/percpu.h
> @@ -718,7 +718,8 @@ do {                                                                        \
>  # ifndef __this_cpu_add_return_8
>  #  define __this_cpu_add_return_8(pcp, val)    __this_cpu_generic_add_return(pcp, val)
>  # endif
> -# define __this_cpu_add_return(pcp, val)       __pcpu_size_call_return2(this_cpu_add_return_, pcp, val)
> +# define __this_cpu_add_return(pcp, val)       \
> +       __pcpu_size_call_return2(__this_cpu_add_return_, pcp, val)
>  #endif
>
>  #define __this_cpu_sub_return(pcp, val)        this_cpu_add_return(pcp, -(val))

I think, the same fix should be applied to the lines following this patch:
#define __this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(val))
#define __this_cpu_inc_return(pcp)      this_cpu_add_return(pcp, 1)
#define __this_cpu_dec_return(pcp)      this_cpu_add_return(pcp, -1)

Shouldn't these other operations also only give the __ relaxed guarantees?

HTH

Torsten

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

* Re: [PATCH] percpu: fix generic definition of __this_cpu_add_and_return()
  2012-02-24 15:33 ` Torsten Kaiser
@ 2012-02-24 15:43   ` Christoph Lameter
  2012-02-28 20:10     ` Tejun Heo
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Lameter @ 2012-02-24 15:43 UTC (permalink / raw)
  To: Torsten Kaiser; +Cc: Konstantin Khlebnikov, Tejun Heo, linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 550 bytes --]

On Fri, 24 Feb 2012, Torsten Kaiser wrote:

> >  #define __this_cpu_sub_return(pcp, val)        this_cpu_add_return(pcp, -(val))
>
> I think, the same fix should be applied to the lines following this patch:
> #define __this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(val))
> #define __this_cpu_inc_return(pcp)      this_cpu_add_return(pcp, 1)
> #define __this_cpu_dec_return(pcp)      this_cpu_add_return(pcp, -1)
>
> Shouldn't these other operations also only give the __ relaxed guarantees?
Yes indeed that should also be fixed.

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

* Re: [PATCH] percpu: fix generic definition of __this_cpu_add_and_return()
  2012-02-24 15:43   ` Christoph Lameter
@ 2012-02-28 20:10     ` Tejun Heo
  0 siblings, 0 replies; 6+ messages in thread
From: Tejun Heo @ 2012-02-28 20:10 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: Torsten Kaiser, Konstantin Khlebnikov, linux-kernel

On Fri, Feb 24, 2012 at 09:43:15AM -0600, Christoph Lameter wrote:
> On Fri, 24 Feb 2012, Torsten Kaiser wrote:
> 
> > >  #define __this_cpu_sub_return(pcp, val)        this_cpu_add_return(pcp, -(val))
> >
> > I think, the same fix should be applied to the lines following this patch:
> > #define __this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(val))
> > #define __this_cpu_inc_return(pcp)      this_cpu_add_return(pcp, 1)
> > #define __this_cpu_dec_return(pcp)      this_cpu_add_return(pcp, -1)
> >
> > Shouldn't these other operations also only give the __ relaxed guarantees?
> Yes indeed that should also be fixed.

Can someone please send a patch for this? :)

Thanks.

-- 
tejun

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

end of thread, other threads:[~2012-02-28 20:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-19 14:29 [PATCH] percpu: fix generic definition of __this_cpu_add_and_return() Konstantin Khlebnikov
2012-02-21 15:53 ` Christoph Lameter
2012-02-21 16:58   ` Tejun Heo
2012-02-24 15:33 ` Torsten Kaiser
2012-02-24 15:43   ` Christoph Lameter
2012-02-28 20:10     ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox