mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: Tejun Heo <tj@kernel.org>
Cc: Christoph Lameter <cl@linux-foundation.org>,
	linux-kernel@vger.kernel.org, rusty@rustcorp.com.au,
	mingo@redhat.com, Thomas Gleixner <tglx@linutronix.de>,
	akpm@linux-foundation.org, rostedt@goodmis.org, hpa@zytor.com,
	cebbert@redhat.com, tony.luck@intel.com
Subject: Re: [PATCH 13/16] percpu: remove per_cpu__ prefix.
Date: Fri, 16 Oct 2009 08:04:06 +0200	[thread overview]
Message-ID: <4AD80CD6.7030204@monstr.eu> (raw)
In-Reply-To: <4AD6EA57.6020105@kernel.org>

Tejun Heo wrote:
> (microblaze maintainer cc'd, hello)

Hi,

where is git repo with that patches?

Thanks
Michal

> 
> Christoph Lameter wrote:
>> On Wed, 14 Oct 2009, Tejun Heo wrote:
>>
>>> @@ -39,7 +39,7 @@ extern void *per_cpu_init(void);
>>>   * On the positive side, using __ia64_per_cpu_var() instead of __get_cpu_var() is slightly
>>>   * more efficient.
>>>   */
>>> -#define __ia64_per_cpu_var(var)	per_cpu__##var
>>> +#define __ia64_per_cpu_var(var)	var
>> IA64 could completely drop the macro? Tony?
> 
> Being discussed but I think we should just add sparse annotation there
> instead.
> 
>>> diff --git a/arch/microblaze/include/asm/entry.h b/arch/microblaze/include/asm/entry.h
>>> index 61abbd2..ec89f2a 100644
>>> --- a/arch/microblaze/include/asm/entry.h
>>> +++ b/arch/microblaze/include/asm/entry.h
>>> @@ -21,7 +21,7 @@
>>>   * places
>>>   */
>>>
>>> -#define PER_CPU(var) per_cpu__##var
>>> +#define PER_CPU(var) var
>> Microblaze too.
> 
> This macro is used only in assemblies which wouldn't be covered by
> sparse so in this case this patch series actually removes protection,
> so I wasn't too sure about ripping the macro off.  Any ideas what we
> can do here?  Just kill it?
> 
>>> +#define PER_CPU(var, reg)	__percpu_mov_op $var, reg
>>> +#define PER_CPU_VAR(var)	var
>> Drop X86 PER_CPU_VAR
> 
> No can do.  SMP variant isn't null op.
> 
>>> -#define percpu_read(var)	percpu_from_op("mov", per_cpu__##var,	\
>>> -					       "m" (per_cpu__##var))
>>> -#define percpu_read_stable(var)	percpu_from_op("mov", per_cpu__##var,	\
>>> -					       "p" (&per_cpu__##var))
>>> -#define percpu_write(var, val)	percpu_to_op("mov", per_cpu__##var, val)
>>> -#define percpu_add(var, val)	percpu_to_op("add", per_cpu__##var, val)
>>> -#define percpu_sub(var, val)	percpu_to_op("sub", per_cpu__##var, val)
>>> -#define percpu_and(var, val)	percpu_to_op("and", per_cpu__##var, val)
>>> -#define percpu_or(var, val)	percpu_to_op("or", per_cpu__##var, val)
>>> -#define percpu_xor(var, val)	percpu_to_op("xor", per_cpu__##var, val)
>>> +#define percpu_read(var)		percpu_from_op("mov", var, "m" (var))
>>> +#define percpu_read_stable(var)		percpu_from_op("mov", var, "p" (&(var)))
>>> +#define percpu_write(var, val)		percpu_to_op("mov", var, val)
>>> +#define percpu_add(var, val)		percpu_to_op("add", var, val)
>>> +#define percpu_sub(var, val)		percpu_to_op("sub", var, val)
>>> +#define percpu_and(var, val)		percpu_to_op("and", var, val)
>>> +#define percpu_or(var, val)		percpu_to_op("or", var, val)
>>> +#define percpu_xor(var, val)		percpu_to_op("xor", var, val)
>> The percpu_xx definitions are now equal to __this_cpu_xx(). They could be
>> dropped for the core.
> 
> Yeap, will do so with further patches.
> 
>>>  #define __get_cpu_var(var) \
>>> -	(*SHIFT_PERCPU_PTR(&per_cpu_var(var), my_cpu_offset))
>>> +	(*SHIFT_PERCPU_PTR(&(var), my_cpu_offset))
>> == this_cpu_read(var) or this_cpu_write(var, value)
>>
>>>  #define __raw_get_cpu_var(var) \
>>> -	(*SHIFT_PERCPU_PTR(&per_cpu_var(var), __my_cpu_offset))
>>> +	(*SHIFT_PERCPU_PTR(&(var), __my_cpu_offset))
>> == __this_cpu_read() or this_cpu_write(var, value)
>>
>> __raw? Combination of __ and raw? Can we clearly define what each means?
>>
>>> -	typeof(per_cpu_var(var)) __tmp_var__;				\
>>> +	typeof(var) __tmp_var__;					\
>>>  	__tmp_var__ = get_cpu_var(var);					\
>>>  	put_cpu_var(var);						\
>>>  	__tmp_var__;							\
>> == this_cpu_read(var)
> 
> For all of above comments, yeap, we definitely need to clean all these
> up, but let's do that once sparse annotation is working.
> 
>> Great work. There is lots more possible cleanup work that could be done
>> after this patch has merged.
>>
>> Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
> 
> Thanks.
> 


-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian

  reply	other threads:[~2009-10-16  6:05 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-14  6:01 [RFC percpu#for-next] percpu: drop per_cpu__ prefix and add sparse annotations, take#2 Tejun Heo
2009-10-14  6:01 ` [PATCH 01/16] vmalloc: fix use of non-existent percpu variable in put_cpu_var() Tejun Heo
2009-10-14 15:06   ` Christoph Lameter
2009-10-15  9:10     ` Tejun Heo
2009-10-14  6:01 ` [PATCH 02/16] percpu: make alloc_percpu() handle array types Tejun Heo
2009-10-14  6:01 ` [PATCH 03/16] percpu: remove some sparse warnings Tejun Heo
2009-10-14 14:20   ` Christoph Lameter
2009-10-14  6:01 ` [PATCH 04/16] percpu: make percpu symbols under kernel/ and mm/ unique Tejun Heo
2009-10-14  6:01 ` [PATCH 05/16] percpu: make percpu symbols in tracer unique Tejun Heo
2009-10-14  6:01 ` [PATCH 06/16] percpu: make percpu symbols in oprofile unique Tejun Heo
2009-10-14  6:01 ` [PATCH 07/16] percpu: make percpu symbols in cpufreq unique Tejun Heo
2009-10-14  6:01 ` [PATCH 08/16] percpu: make percpu symbols in xen unique Tejun Heo
2009-10-14  6:01 ` [PATCH 09/16] percpu: make percpu symbols in x86 unique Tejun Heo
2009-10-14  6:01 ` [PATCH 10/16] percpu: make percpu symbols in powerpc unique Tejun Heo
2009-10-27  3:19   ` Benjamin Herrenschmidt
2009-10-14  6:02 ` [PATCH 11/16] percpu: make percpu symbols in ia64 unique Tejun Heo
2009-10-14  6:02 ` [PATCH 12/16] percpu: make misc percpu symbols unique Tejun Heo
2009-10-14  6:02 ` [PATCH 13/16] percpu: remove per_cpu__ prefix Tejun Heo
2009-10-14 14:36   ` Christoph Lameter
2009-10-14 16:42     ` Luck, Tony
2009-10-14 17:38       ` H. Peter Anvin
2009-10-14 18:26         ` Christoph Lameter
2009-10-15  8:57         ` Tejun Heo
2009-10-14 18:22       ` Christoph Lameter
2009-10-14 18:36         ` Luck, Tony
2009-10-14 18:51           ` Christoph Lameter
2009-10-15  8:51             ` Tejun Heo
2009-10-16 16:23               ` Christoph Lameter
2009-10-15  9:24     ` Tejun Heo
2009-10-16  6:04       ` Michal Simek [this message]
2009-10-18  2:58         ` Tejun Heo
2009-10-19 13:41           ` Michal Simek
2009-10-29 11:11             ` Tejun Heo
2009-11-02 16:35               ` Michal Simek
2009-10-19 13:40       ` Michal Simek
2009-10-29 12:06         ` Tejun Heo
2009-10-14  6:02 ` [PATCH 14/16] percpu: make access macros universal Tejun Heo
2009-10-14 14:38   ` Christoph Lameter
2009-10-15  9:27     ` Tejun Heo
2009-10-14  6:02 ` [PATCH 15/16] percpu: add __percpu for sparse Tejun Heo
2009-10-14  6:02 ` [PATCH 16/16] percpu: make accessors check for percpu pointer in sparse Tejun Heo
2009-10-14 14:41   ` Christoph Lameter
2009-10-15  9:08     ` Tejun Heo
2009-10-29 13:40 ` [RFC percpu#for-next] percpu: drop per_cpu__ prefix and add sparse annotations, take#2 Tejun Heo

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=4AD80CD6.7030204@monstr.eu \
    --to=monstr@monstr.eu \
    --cc=akpm@linux-foundation.org \
    --cc=cebbert@redhat.com \
    --cc=cl@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=tony.luck@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome