public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Xose Vazquez Perez <xose.vazquez@gmail.com>
Cc: linux-arch@vger.kernel.org, linux-mips@linux-mips.org,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: HAVE_CMPXCHG_LOCAL arch support.
Date: Wed, 10 Jun 2015 17:57:09 +0200	[thread overview]
Message-ID: <20150610155709.GH2753@linux-mips.org> (raw)
In-Reply-To: <20150610145804.GG2753@linux-mips.org>

On Wed, Jun 10, 2015 at 04:58:04PM +0200, Ralf Baechle wrote:

> On Mon, Jun 08, 2015 at 03:14:43PM +0200, Xose Vazquez Perez wrote:
> 
> > If there is anything wrong, please report it in this thread:
> > https://marc.info/?t=143332955700003
> 
> 
> >    locking/ cmpxchg-local        : TODO |                  HAVE_CMPXCHG_LOCAL #  arch supports the this_cpu_cmpxchg() API
> 
> This one was easy - we have the functions in the code just no "select
> HAVE_CMPXCHG_LOCAL" Kconfig.

Something's wrong there.  The new file
Documentation/features/locking/cmpxchg-local/arch-support.txt in linux-next
claims correctly that only s390 and x86 define HAVE_CMPXCHG_LOCAL.  And a
git grep -w cmpxchg_local finds that in addition to these alpha, arm, arm64,
avr32, blackfin, c6x, frv, ia64, m32r, m68k, mips, parisc, powerpc, sparc,
unicore32 and xtensa define cmpxchg_local.

These architectures seem to not define cmpxchg_local in their arch/ dir:

  arc cris hexagon metag microblaze mn10300 nios2 openrisc score sh tile um

Microblaze and nios2 include <asm-generic/cmpxchg.h> into their arch
cmpxchg.h so they get a definition of these functions but don't define
HAVE_CMPXCHG_LOCAL.  Peter Zijlstra said it the local versions are ~ 20
cycles faster on x86 than the "global" version.  But I've found one user
of cmpxchg_local, mm/vmstat.c and one user of cmpxchg64_local,
drivers/iommu/intel-iommu.c.  Sure, fixing the issue was trivial for me
on MIPS but is having cmpxchg{,64}_local actually worth it?  

Cheers,

  Ralf

       reply	other threads:[~2015-06-10 15:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <55759543.1010408@gmail.com>
     [not found] ` <20150610145804.GG2753@linux-mips.org>
2015-06-10 15:57   ` Ralf Baechle [this message]
2015-06-10 15:57     ` HAVE_CMPXCHG_LOCAL arch support Ralf Baechle
2015-06-10 16:00     ` Peter Zijlstra
2015-06-10 16:36   ` Generic kernel features that need architecture(mips) support Xose Vazquez Perez
2015-06-11  6:24     ` Ingo Molnar
2015-06-11 13:20       ` Jonathan Corbet

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=20150610155709.GH2753@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=xose.vazquez@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