All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Davidlohr Bueso <davidlohr@hp.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Aswin Chandramouleeswaran <aswin@hp.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] arch,locking: Ciao arch_mutex_cpu_relax()
Date: Tue, 5 Aug 2014 15:04:38 +0200	[thread overview]
Message-ID: <CAMuHMdX2ZCEd=J_Gpf-W+Zyqg27r4C6ULZgO=pg2houR-FXLvg@mail.gmail.com> (raw)
In-Reply-To: <1404079773.2619.4.camel@buesod1.americas.hpqcorp.net>

Hi David,

On Mon, Jun 30, 2014 at 12:09 AM, Davidlohr Bueso <davidlohr@hp.com> wrote:
> From: Davidlohr Bueso <davidlohr@hp.com>
>
> The arch_mutex_cpu_relax() function, introduced by 34b133f, is
> hacky and ugly. It was added a few years ago to address the fact
> that common cpu_relax() calls include yielding on s390, and thus
> impact the optimistic spinning functionality of mutexes. Nowadays
> we use this function well beyond mutexes: rwsem, qrwlock, mcs and
> lockref. Since the macro that defines the call is in the mutex header,
> any users must include mutex.h and the naming is misleading as well.
>
> This patch (i) renames the call to cpu_relax_lowlatency  ("relax, but
> only if you can do it with very low latency") and (ii) defines it in
> each arch's asm/processor.h local header, just like for regular cpu_relax
> functions. On all archs, except s390, cpu_relax_lowlatency is simply cpu_relax,
> and thus we can take it out of mutex.h. While this can seem redundant,
> I believe it is a good choice as it allows us to move out arch specific
> logic from generic locking primitives and enables future(?) archs to
> transparently define it, similarly to System Z.
>
> Please note that these changes are only tested on x86-64.
>
> Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>
> ---
> Changes from v1: Rename arch_cpu_relax to cpu_relax_lowlatency,
> based on the purpose of the function, as suggested by Linus.
>
>  arch/alpha/include/asm/processor.h     | 1 +
>  arch/arc/include/asm/processor.h       | 2 ++
>  arch/arm/include/asm/processor.h       | 2 ++
>  arch/arm64/include/asm/processor.h     | 1 +
>  arch/avr32/include/asm/processor.h     | 1 +
>  arch/blackfin/include/asm/processor.h  | 2 +-
>  arch/c6x/include/asm/processor.h       | 1 +
>  arch/cris/include/asm/processor.h      | 1 +
>  arch/hexagon/include/asm/processor.h   | 1 +
>  arch/ia64/include/asm/processor.h      | 1 +
>  arch/m32r/include/asm/processor.h      | 1 +
>  arch/m68k/include/asm/processor.h      | 1 +
>  arch/metag/include/asm/processor.h     | 1 +
>  arch/mips/include/asm/processor.h      | 1 +
>  arch/mn10300/include/asm/processor.h   | 2 ++
>  arch/openrisc/include/asm/processor.h  | 1 +
>  arch/parisc/include/asm/processor.h    | 1 +
>  arch/powerpc/include/asm/processor.h   | 2 ++
>  arch/s390/include/asm/processor.h      | 2 +-
>  arch/score/include/asm/processor.h     | 1 +
>  arch/sh/include/asm/processor.h        | 1 +
>  arch/sparc/include/asm/processor_32.h  | 2 ++
>  arch/sparc/include/asm/processor_64.h  | 1 +
>  arch/tile/include/asm/processor.h      | 2 ++
>  arch/unicore32/include/asm/processor.h | 1 +
>  arch/x86/include/asm/processor.h       | 2 ++
>  arch/xtensa/include/asm/processor.h    | 1 +
>  include/linux/mutex.h                  | 4 ----
>  kernel/locking/mcs_spinlock.c          | 8 +++-----
>  kernel/locking/mcs_spinlock.h          | 4 ++--
>  kernel/locking/mutex.c                 | 4 ++--
>  kernel/locking/qrwlock.c               | 9 ++++-----
>  kernel/locking/rwsem-xadd.c            | 4 ++--
>  lib/lockref.c                          | 3 +--
>  34 files changed, 48 insertions(+), 24 deletions(-)

It looks like you forgot to update frv?  It's been failing on -next since a
few days:

kernel/locking/mcs_spinlock.h:87:2: error: implicit declaration of
function 'cpu_relax_lowlatency'
[-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
kernel/locking/mcs_spinlock.h:87:2: error: implicit declaration of
function 'cpu_relax_lowlatency'
[-Werror=implicit-function-declaration]
make[3]: *** [kernel/locking/mcs_spinlock.o] Error 1
cc1: some warnings being treated as errors
make[3]: *** [kernel/locking/mutex.o] Error 1

http://kisskb.ellerman.id.au/kisskb/buildresult/11616307/

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2014-08-05 13:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 18:21 [PATCH] arch,locking: Ciao arch_mutex_cpu_relax() Davidlohr Bueso
2014-06-23  6:54 ` Peter Zijlstra
2014-06-23  7:13   ` Vineet Gupta
2014-06-23 11:34     ` Peter Zijlstra
2014-06-23  6:58 ` Peter Zijlstra
2014-06-24 15:06   ` Davidlohr Bueso
2014-06-25  6:25     ` Heiko Carstens
2014-06-25 11:57       ` Linus Torvalds
2014-06-29 22:09         ` [PATCH v2] " Davidlohr Bueso
2014-08-05 13:04           ` Geert Uytterhoeven [this message]
2014-08-05 17:42             ` Davidlohr Bueso
2014-08-08  1:18               ` Davidlohr Bueso
2014-08-08 10:45                 ` Guenter Roeck
2014-08-15 19:34                 ` Guenter Roeck

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='CAMuHMdX2ZCEd=J_Gpf-W+Zyqg27r4C6ULZgO=pg2houR-FXLvg@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=aswin@hp.com \
    --cc=davidlohr@hp.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.