[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170706085503.GA15053@arm.com>
Date: Thu, 6 Jul 2017 09:55:03 +0100
From: Will Deacon <will.deacon@....com>
To: Christoph Hellwig <hch@...radead.org>
Cc: Palmer Dabbelt <palmer@...belt.com>, peterz@...radead.org,
mingo@...hat.com, mcgrof@...nel.org, viro@...iv.linux.org.uk,
sfr@...b.auug.org.au, nicolas.dichtel@...nd.com,
rmk+kernel@...linux.org.uk, msalter@...hat.com,
tklauser@...tanz.ch, james.hogan@...tec.com,
paul.gortmaker@...driver.com, linux@...ck-us.net,
linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
albert@...ive.com, patches@...ups.riscv.org,
mathieu.desnoyers@...icios.com
Subject: Re: [PATCH 8/9] RISC-V: User-facing API
On Wed, Jul 05, 2017 at 07:01:41PM -0700, Christoph Hellwig wrote:
> I'm a bit concerned about these cmpxchg syscalls, and I'd like to
> understand if my concerns are justified.
>
> For a new instruction set that starts out in the 201x years we really
> should have cmpxchg as a mandatory instruction - if not in the CPU
> it should be in the Linux ABI so that we don't have to deal with a mess
> where programs will either need an indirection for CPUs that have
> cmpxchg capabilities vs those that don't, and we don't need to worry
> if given binaries work on all CPUs.
Agreed on the indirection; it feels like this is something that should be in
the vDSO, which could use the cmpxchg instruction if it's available, or
otherwise just uses plain loads and stores. In the latter case, the kernel
can then detect if you're preempted in the vdso critical region and restart
the cmpxchg (we do something similar for arch/arm/, but it's slightly
simpler with the vectors page (see entry-armv.S).
Alternatively, we could revisit the restartable sequences work from Mathieu,
but I think that's stalled pending real-world performance data.
> What keeps from from declaring that the RISV-A extension is mandatory
> for Linux?
Or that!
Will
Powered by blists - more mailing lists