linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Christoph Lameter <cl@linux-foundation.org>
Cc: "Luck, Tony" <tony.luck@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"rusty@rustcorp.com.au" <rusty@rustcorp.com.au>,
	"mingo@redhat.com" <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"cebbert@redhat.com" <cebbert@redhat.com>
Subject: Re: [PATCH 13/16] percpu: remove per_cpu__ prefix.
Date: Thu, 15 Oct 2009 17:51:39 +0900	[thread overview]
Message-ID: <4AD6E29B.8000506@kernel.org> (raw)
In-Reply-To: <alpine.DEB.1.10.0910141445110.30078@gentwo.org>

Hello, Christoph, Tony.

Christoph Lameter wrote:
> On Wed, 14 Oct 2009, Luck, Tony wrote:
> 
>>> we would still have to use per cpu operations to get to the contents of
>>> these variables.
>> That's good.
>>
>>> Hope that addresses your concerns.
>> But then I don't understand the original patch that was going to do:
>>
>>> -#define __ia64_per_cpu_var(var)	per_cpu__##var
>>> +#define __ia64_per_cpu_var(var)	var
>> Presumably all actual use of __ia64_per_cpu_var is being replaced
>> by some other "per cpu operations"?

Yeah, I wasn't so sure what to do about these, so just left them as
no-op for the moment.

> Hmmm... Right. IA64 is a special case because the access of the per cpu
> variable at a specific address causes per cpu TLBs to do the relocation.
> 
> Other platforms have to add a per cpu specific offset to a variable to get
> the right per cpu variable.
> 
> As a result IA64 strictly does not need this_cpu_read() and
> this_cpu_write(). However, not using the operations is going to cause
> the sparse annotation by Tejun to trigger errors. this_cpu_read() is
> likely a noop for IA64 that just changes the annotations so that sparse
> warnings do not trigger. Tejun?

__ia64_per_cpu_var() is slightly different from this_cpu_read() in
that the former only works for percpu variables which fall on the
first percpu page - ie. static percpu vars in the kernel image.  So,
__ia64_per_cpu_var() is a bit more efficient than this_cpu_read() as
it doesn't have to compute the address.

So, what we can do is to leave the macro alone for now and then add
sparse annotation to it later in the patch as it's basically another
specialized accessor.  How does that sound?

Thanks.

-- 
tejun

  reply	other threads:[~2009-10-15  8:53 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 [this message]
2009-10-16 16:23               ` Christoph Lameter
2009-10-15  9:24     ` Tejun Heo
2009-10-16  6:04       ` Michal Simek
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=4AD6E29B.8000506@kernel.org \
    --to=tj@kernel.org \
    --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=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;
as well as URLs for NNTP newsgroup(s).