public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Brian Gerst <brgerst@gmail.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] x86, percpu: Optimize this_cpu_ptr
Date: Sun, 05 Sep 2010 11:20:45 +0200	[thread overview]
Message-ID: <4C8360ED.8070700@kernel.org> (raw)
In-Reply-To: <1283620871-818-2-git-send-email-brgerst@gmail.com>

Hello,

On 09/04/2010 07:21 PM, Brian Gerst wrote:
> diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
> index cd28f9a..d854438 100644
> --- a/arch/x86/include/asm/percpu.h
> +++ b/arch/x86/include/asm/percpu.h
> @@ -47,6 +47,15 @@
>  #ifdef CONFIG_SMP
>  #define __percpu_arg(x)		"%%"__stringify(__percpu_seg)":%P" #x
>  #define __my_cpu_offset		percpu_read(this_cpu_off)
> +#define __this_cpu_ptr(ptr)				\
> +({							\
> +	typeof(ptr) __ptr = (ptr);			\
> +	__verify_pcpu_ptr(ptr);				\
> +	asm volatile("add " __percpu_arg(1) ", %0"	\
> +		     : "+r" (__ptr)			\
> +		     : "m" (this_cpu_off));		\
> +	__ptr;						\
> +}) 

Great, thanks for doing this, but can you please comment on what
__this_cpu_ptr() optimizes above?  Something similar to the patch
description but shorter.

Thanks.

-- 
tejun

  reply	other threads:[~2010-09-05  9:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-04 17:21 PATCH [0/2] percpu: Local cpu pointer optimizations Brian Gerst
2010-09-04 17:21 ` [PATCH 1/2] x86, percpu: Optimize this_cpu_ptr Brian Gerst
2010-09-05  9:20   ` Tejun Heo [this message]
2010-09-04 17:21 ` [PATCH 2/2] percpu: Optimize __get_cpu_var() Brian Gerst
  -- strict thread matches above, loose matches on Subject: below --
2010-09-07 11:41 PATCH [0/2] percpu: Local cpu pointer optimizations Brian Gerst
2010-09-07 11:41 ` [PATCH 1/2] x86, percpu: Optimize this_cpu_ptr Brian Gerst

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=4C8360ED.8070700@kernel.org \
    --to=tj@kernel.org \
    --cc=brgerst@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox