From: Tejun Heo <tj@kernel.org>
To: Nicholas Piggin <npiggin@gmail.com>
Cc: Christoph Lameter <cl@linux.com>,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] percpu: improve generic percpu modify-return implementation
Date: Wed, 21 Sep 2016 10:23:43 -0400 [thread overview]
Message-ID: <20160921142343.GA10734@htj.duckdns.org> (raw)
In-Reply-To: <20160921205711.4e804777@roar.ozlabs.ibm.com>
Hello, Nick.
How have you been? :)
On Wed, Sep 21, 2016 at 08:57:11PM +1000, Nicholas Piggin wrote:
> On Wed, 21 Sep 2016 18:51:37 +1000
> Nicholas Piggin <npiggin@gmail.com> wrote:
>
> > Some architectures require an additional load to find the address of
> > percpu pointers. In some implemenatations, the C aliasing rules do not
> > allow the result of that load to be kept over the store that modifies
> > the percpu variable, which causes additional loads.
>
> Sorry I picked up an old patch here. This one should be better.
>
> From d0cb9052d6f4c31d24f999b7b0cecb34681eee9b Mon Sep 17 00:00:00 2001
> From: Nicholas Piggin <npiggin@gmail.com>
> Date: Wed, 21 Sep 2016 18:23:43 +1000
> Subject: [PATCH] percpu: improve generic percpu modify-return implementations
>
> Some architectures require an additional load to find the address of
> percpu pointers. In some implemenatations, the C aliasing rules do not
> allow the result of that load to be kept over the store that modifies
> the percpu variable, which causes additional loads.
>
> Work around this by finding the pointer first, then operating on that.
>
> It's also possible to mark things as restrict and those kind of games,
> but that can require larger and arch specific changes.
>
> On powerpc, __this_cpu_inc_return compiles to:
>
> ld 10,48(13)
> ldx 9,3,10
> addi 9,9,1
> stdx 9,3,10
> ld 9,48(13)
> ldx 3,9,3
>
> With this patch it compiles to:
>
> ld 10,48(13)
> ldx 9,3,10
> addi 9,9,1
> stdx 9,3,10
>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Patch looks good to me but seems QP encoded. Can you please resend?
Thanks and it's great to see you again!
--
tejun
next prev parent reply other threads:[~2016-09-21 14:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-21 8:51 [PATCH] percpu: improve generic percpu modify-return implementation Nicholas Piggin
2016-09-21 10:25 ` kbuild test robot
2016-09-21 10:30 ` kbuild test robot
2016-09-21 10:30 ` kbuild test robot
2016-09-21 10:57 ` Nicholas Piggin
2016-09-21 14:23 ` Tejun Heo [this message]
2016-09-21 20:16 ` Christoph Lameter
2016-09-22 4:42 ` Nicholas Piggin
2016-09-22 4:35 ` Nicholas Piggin
2016-09-22 16:07 ` Tejun Heo
2016-09-23 7:33 ` Nicholas Piggin
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=20160921142343.GA10734@htj.duckdns.org \
--to=tj@kernel.org \
--cc=cl@linux.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.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).