Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1685030
| From | Will Deacon <will.deacon@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 8/9] RISC-V: User-facing API |
| Date | 2017-07-11 15:30 +0200 |
| Message-ID | <u23oJ-2Qv-9@gated-at.bofh.it> (permalink) |
| References | <u0hcu-7dv-23@gated-at.bofh.it> <u1NjX-1cd-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Jul 10, 2017 at 01:00:29PM -0700, Palmer Dabbelt wrote: > On Thu, 06 Jul 2017 08:45:13 PDT (-0700), will.deacon@arm.com wrote: > > On Thu, Jul 06, 2017 at 08:34:27AM -0700, Christoph Hellwig wrote: > >> On Thu, Jul 06, 2017 at 09:55:03AM +0100, Will Deacon wrote: > >> > 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. > > These are already in the vDSO, and use the corresponding atomic instructions on > systems with the A extension. The vDSO routines call the system calls in non-A > systems. As far as I can tell that's necessary to preserve atomicity, which we > currently do by disabling scheduling. If there's a way to do this without > entering the kernel then I'd be happy to support it, but I'm not sure how we > could maintain atomicity using only regular loads and stores. Take a look at the ARM code I mentioned. You can do away with the syscall if you notice that you preempt a thread inside the critical section of the vDSO, and, in that case you resume execution at a known "restart" address. > >> Even that seems like a lot of indirection for something that is in > >> the critical fast path for synchronization. I really can't understand > >> how a new ISA / ABI could even come up with an idea as stupid as making > >> essential synchronization primitives optional. > > > > No disagreement there! > > The default set of multilibs on Linux are: > > * rv32imac: 32-bit; Multiply, Atomic, and Compressed extensions > * rv32imafdc: like above, but with single+double float > * rv64imac: 64-bit, Multiply, Atomic and Compressed > * rv64imafdc: like above, but with single+double float > > all of which support the A extension. We certainly don't plan on building any > systems that support Linux without the A extension at SiFive, so I'm fine > removing the system call -- this was originally added by a user, so there was > at least enough interest for someone to add the system call. > > We've found people are retrofitting other cores to run RISC-V, and I could > certainly imagine an older design that lacks a beefy enough memory system to > support our atomics (which are LR/SC based) being a design that might arise. > There's a lot of systems where people don't seem to care that much about the > performance and just want something to work -- if they're on such a tiny system > they can't implement the A extension then they're probably not going to be > doing a lot of atomics anyway, so maybe it doesn't matter if atomics are slow. > As the cost for supporting these A-less systems seems fairly small, it seemed > like the right thing to do -- one of the points of making RISC-V have many > optional extensions was to let people pick the ones they view as important. > Since I don't know the performance constraints of their systems or the cost of > implementing the A extension in their design, I'm not really qualified to tell > them a cmpxchg syscall is a bad idea. The problem is that by supporting these hypothetical designs that can't do atomics, you hurt sensible designs that *can* do the atomics because you force them to take an additional indirection that could otherwise be avoided. Will
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
RISC-V Linux Port v4 Palmer Dabbelt <palmer@dabbelt.com> - 2017-07-04 22:00 +0200
Re: [patches] Re: [PATCH 1/9] RISC-V: Init and Halt Code Karsten Merker <merker@debian.org> - 2017-07-04 23:20 +0200
Re: [patches] Re: [PATCH 1/9] RISC-V: Init and Halt Code Thomas Gleixner <tglx@linutronix.de> - 2017-07-05 08:50 +0200
Re: [patches] [PATCH 1/9] RISC-V: Init and Halt Code Jonathan Neuschäfer <j.neuschaefer@gmx.net> - 2017-07-05 00:00 +0200
Re: [patches] [PATCH 1/9] RISC-V: Init and Halt Code Palmer Dabbelt <palmer@dabbelt.com> - 2017-07-07 00:40 +0200
Re: [patches] [PATCH 1/9] RISC-V: Init and Halt Code Jonathan Neuschäfer <j.neuschaefer@gmx.net> - 2017-07-07 15:10 +0200
Re: [patches] [PATCH 1/9] RISC-V: Init and Halt Code Palmer Dabbelt <palmer@dabbelt.com> - 2017-07-10 22:50 +0200
Re: [PATCH 2/9] RISC-V: Atomic and Locking Code Peter Zijlstra <peterz@infradead.org> - 2017-07-05 10:50 +0200
Re: [PATCH 2/9] RISC-V: Atomic and Locking Code Boqun Feng <boqun.feng@gmail.com> - 2017-07-06 06:20 +0200
Re: [PATCH 2/9] RISC-V: Atomic and Locking Code Peter Zijlstra <peterz@infradead.org> - 2017-07-06 09:30 +0200
Re: [PATCH 2/9] RISC-V: Atomic and Locking Code Palmer Dabbelt <palmer@dabbelt.com> - 2017-07-07 03:10 +0200
Re: [PATCH 2/9] RISC-V: Atomic and Locking Code Boqun Feng <boqun.feng@gmail.com> - 2017-07-07 04:20 +0200
Re: [PATCH 2/9] RISC-V: Atomic and Locking Code Palmer Dabbelt <palmer@dabbelt.com> - 2017-07-10 22:40 +0200
Re: [PATCH 2/9] RISC-V: Atomic and Locking Code Peter Zijlstra <peterz@infradead.org> - 2017-07-07 10:10 +0200
Re: [PATCH 2/9] RISC-V: Atomic and Locking Code Palmer Dabbelt <palmer@dabbelt.com> - 2017-07-10 22:40 +0200
Re: [PATCH 8/9] RISC-V: User-facing API James Hogan <james.hogan@imgtec.com> - 2017-07-05 12:30 +0200
Re: [PATCH 8/9] RISC-V: User-facing API Christoph Hellwig <hch@infradead.org> - 2017-07-06 04:10 +0200
Re: [PATCH 8/9] RISC-V: User-facing API Will Deacon <will.deacon@arm.com> - 2017-07-06 11:00 +0200
Re: [PATCH 8/9] RISC-V: User-facing API Christoph Hellwig <hch@infradead.org> - 2017-07-06 17:40 +0200
Re: [PATCH 8/9] RISC-V: User-facing API Will Deacon <will.deacon@arm.com> - 2017-07-06 17:50 +0200
Re: [PATCH 8/9] RISC-V: User-facing API Will Deacon <will.deacon@arm.com> - 2017-07-11 15:30 +0200
Re: [PATCH 8/9] RISC-V: User-facing API Christoph Hellwig <hch@infradead.org> - 2017-07-11 16:00 +0200
Re: [PATCH 8/9] RISC-V: User-facing API Palmer Dabbelt <palmer@dabbelt.com> - 2017-07-11 19:30 +0200
Re: [PATCH 8/9] RISC-V: User-facing API Palmer Dabbelt <palmer@dabbelt.com> - 2017-07-11 19:10 +0200
Re: [PATCH 2/9] RISC-V: Atomic and Locking Code Boqun Feng <boqun.feng@gmail.com> - 2017-07-06 05:40 +0200
Re: [PATCH 8/9] RISC-V: User-facing API Dave P Martin <Dave.Martin@arm.com> - 2017-07-06 17:40 +0200
Re: [patches] [PATCH 2/9] RISC-V: Atomic and Locking Code Jonathan Neuschäfer <j.neuschaefer@gmx.net> - 2017-07-07 15:20 +0200
Re: [patches] [PATCH 2/9] RISC-V: Atomic and Locking Code Palmer Dabbelt <palmer@dabbelt.com> - 2017-07-10 22:50 +0200
csiph-web