lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdX2ZCEd=J_Gpf-W+Zyqg27r4C6ULZgO=pg2houR-FXLvg@mail.gmail.com>
Date:	Tue, 5 Aug 2014 15:04:38 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Davidlohr Bueso <davidlohr@...com>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...nel.org>,
	Aswin Chandramouleeswaran <aswin@...com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] arch,locking: Ciao arch_mutex_cpu_relax()

Hi David,

On Mon, Jun 30, 2014 at 12:09 AM, Davidlohr Bueso <davidlohr@...com> wrote:
> From: Davidlohr Bueso <davidlohr@...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@...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@...ux-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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ