Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-05-04 Thread Mathieu Desnoyers
- On Apr 16, 2018, at 4:58 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Apr 16, 2018, at 3:26 PM, Linus Torvalds > torva...@linux-foundation.org > wrote: > >> On Mon, Apr 16, 2018 at 12:21 PM, Mathieu Desnoyers >> wrote: >>> >>>

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-05-04 Thread Mathieu Desnoyers
- On Apr 16, 2018, at 4:58 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Apr 16, 2018, at 3:26 PM, Linus Torvalds > torva...@linux-foundation.org > wrote: > >> On Mon, Apr 16, 2018 at 12:21 PM, Mathieu Desnoyers >> wrote: >>> >>> And I try very hard to avoid being

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-16 Thread Mathieu Desnoyers
- On Apr 16, 2018, at 3:26 PM, Linus Torvalds torva...@linux-foundation.org wrote: > On Mon, Apr 16, 2018 at 12:21 PM, Mathieu Desnoyers > wrote: >> >> And I try very hard to avoid being told I'm the one breaking >> user-space. ;-) > > You *can't* be

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-16 Thread Mathieu Desnoyers
- On Apr 16, 2018, at 3:26 PM, Linus Torvalds torva...@linux-foundation.org wrote: > On Mon, Apr 16, 2018 at 12:21 PM, Mathieu Desnoyers > wrote: >> >> And I try very hard to avoid being told I'm the one breaking >> user-space. ;-) > > You *can't* be breaking user space. User space doesn't

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-16 Thread Linus Torvalds
On Mon, Apr 16, 2018 at 12:21 PM, Mathieu Desnoyers wrote: > > And I try very hard to avoid being told I'm the one breaking > user-space. ;-) You *can't* be breaking user space. User space doesn't use this yet. That's actually why I'd like to start with the

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-16 Thread Linus Torvalds
On Mon, Apr 16, 2018 at 12:21 PM, Mathieu Desnoyers wrote: > > And I try very hard to avoid being told I'm the one breaking > user-space. ;-) You *can't* be breaking user space. User space doesn't use this yet. That's actually why I'd like to start with the minimal set - to make sure we don't

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-16 Thread Mathieu Desnoyers
- On Apr 16, 2018, at 2:39 PM, Linus Torvalds torva...@linux-foundation.org wrote: > On Mon, Apr 16, 2018 at 11:35 AM, Mathieu Desnoyers > wrote: >> Specifically for single-stepping, the __rseq_table section introduced >> at user-level will allow newer

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-16 Thread Mathieu Desnoyers
- On Apr 16, 2018, at 2:39 PM, Linus Torvalds torva...@linux-foundation.org wrote: > On Mon, Apr 16, 2018 at 11:35 AM, Mathieu Desnoyers > wrote: >> Specifically for single-stepping, the __rseq_table section introduced >> at user-level will allow newer debuggers and tools which do line and

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-16 Thread Linus Torvalds
On Mon, Apr 16, 2018 at 11:35 AM, Mathieu Desnoyers wrote: > Specifically for single-stepping, the __rseq_table section introduced > at user-level will allow newer debuggers and tools which do line and > instruction-level single-stepping to skip over rseq critical

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-16 Thread Linus Torvalds
On Mon, Apr 16, 2018 at 11:35 AM, Mathieu Desnoyers wrote: > Specifically for single-stepping, the __rseq_table section introduced > at user-level will allow newer debuggers and tools which do line and > instruction-level single-stepping to skip over rseq critical sections. > However, this breaks

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-16 Thread Mathieu Desnoyers
- On Apr 14, 2018, at 6:44 PM, Andy Lutomirski l...@amacapital.net wrote: > On Thu, Apr 12, 2018 at 12:43 PM, Linus Torvalds > wrote: >> On Thu, Apr 12, 2018 at 12:27 PM, Mathieu Desnoyers >> wrote: >>> The cpu_opv system call

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-16 Thread Mathieu Desnoyers
- On Apr 14, 2018, at 6:44 PM, Andy Lutomirski l...@amacapital.net wrote: > On Thu, Apr 12, 2018 at 12:43 PM, Linus Torvalds > wrote: >> On Thu, Apr 12, 2018 at 12:27 PM, Mathieu Desnoyers >> wrote: >>> The cpu_opv system call executes a vector of operations on behalf of >>> user-space on a

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-16 Thread Andi Kleen
> Single-stepping is only a subset of the rseq limitations addressed > by cpu_opv. Anoher major limitation is algorithms requiring data > migration between per-cpu data structures safely against CPU hotplug, > and without having to change the cpu affinity mask. This is the case And how many

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-16 Thread Andi Kleen
> Single-stepping is only a subset of the rseq limitations addressed > by cpu_opv. Anoher major limitation is algorithms requiring data > migration between per-cpu data structures safely against CPU hotplug, > and without having to change the cpu affinity mask. This is the case And how many

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-16 Thread Mathieu Desnoyers
- On Apr 12, 2018, at 4:23 PM, Andi Kleen a...@firstfloor.org wrote: >> Can we plan on merging just the plain rseq parts *without* this all >> first, and then see the cpu_opv thing as a "maybe future expansion" >> part. > > That would be the right way to go. I doubt anybody really needs

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-16 Thread Mathieu Desnoyers
- On Apr 12, 2018, at 4:23 PM, Andi Kleen a...@firstfloor.org wrote: >> Can we plan on merging just the plain rseq parts *without* this all >> first, and then see the cpu_opv thing as a "maybe future expansion" >> part. > > That would be the right way to go. I doubt anybody really needs

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-14 Thread Andy Lutomirski
On Thu, Apr 12, 2018 at 12:43 PM, Linus Torvalds wrote: > On Thu, Apr 12, 2018 at 12:27 PM, Mathieu Desnoyers > wrote: >> The cpu_opv system call executes a vector of operations on behalf of >> user-space on a specific CPU with

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-14 Thread Andy Lutomirski
On Thu, Apr 12, 2018 at 12:43 PM, Linus Torvalds wrote: > On Thu, Apr 12, 2018 at 12:27 PM, Mathieu Desnoyers > wrote: >> The cpu_opv system call executes a vector of operations on behalf of >> user-space on a specific CPU with preemption disabled. It is inspired >> by readv() and writev()

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-13 Thread Mathieu Desnoyers
- On Apr 13, 2018, at 12:37 PM, Linus Torvalds torva...@linux-foundation.org wrote: > On Fri, Apr 13, 2018 at 5:16 AM, Mathieu Desnoyers > wrote: >> The vmalloc space needed by cpu_opv is bound by the number of pages >> a cpu_opv call can touch. > > No it's

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-13 Thread Mathieu Desnoyers
- On Apr 13, 2018, at 12:37 PM, Linus Torvalds torva...@linux-foundation.org wrote: > On Fri, Apr 13, 2018 at 5:16 AM, Mathieu Desnoyers > wrote: >> The vmalloc space needed by cpu_opv is bound by the number of pages >> a cpu_opv call can touch. > > No it's not. > > You can have a

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-13 Thread Linus Torvalds
On Fri, Apr 13, 2018 at 5:16 AM, Mathieu Desnoyers wrote: > The vmalloc space needed by cpu_opv is bound by the number of pages > a cpu_opv call can touch. No it's not. You can have a thousand different processes doing cpu_opv at the same time. A *single*

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-13 Thread Linus Torvalds
On Fri, Apr 13, 2018 at 5:16 AM, Mathieu Desnoyers wrote: > The vmalloc space needed by cpu_opv is bound by the number of pages > a cpu_opv call can touch. No it's not. You can have a thousand different processes doing cpu_opv at the same time. A *single* cpu_opv may me limited toi "only" a

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-13 Thread Mathieu Desnoyers
- On Apr 12, 2018, at 4:07 PM, Linus Torvalds torva...@linux-foundation.org wrote: > On Thu, Apr 12, 2018 at 12:59 PM, Mathieu Desnoyers > wrote: >> >> What are your concerns about page pinning ? > > Pretty much everything. > > It's the most complex part by

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-13 Thread Mathieu Desnoyers
- On Apr 12, 2018, at 4:07 PM, Linus Torvalds torva...@linux-foundation.org wrote: > On Thu, Apr 12, 2018 at 12:59 PM, Mathieu Desnoyers > wrote: >> >> What are your concerns about page pinning ? > > Pretty much everything. > > It's the most complex part by far, and the vmalloc space is a

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-12 Thread Andi Kleen
> Can we plan on merging just the plain rseq parts *without* this all > first, and then see the cpu_opv thing as a "maybe future expansion" > part. That would be the right way to go. I doubt anybody really needs cpu_opv. We already have other code (e.g. vgettimeofday) which cannot be single

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-12 Thread Andi Kleen
> Can we plan on merging just the plain rseq parts *without* this all > first, and then see the cpu_opv thing as a "maybe future expansion" > part. That would be the right way to go. I doubt anybody really needs cpu_opv. We already have other code (e.g. vgettimeofday) which cannot be single

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-12 Thread Linus Torvalds
On Thu, Apr 12, 2018 at 12:59 PM, Mathieu Desnoyers wrote: > > What are your concerns about page pinning ? Pretty much everything. It's the most complex part by far, and the vmalloc space is a limited resource on 32-bit architectures. > Do you have an

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-12 Thread Linus Torvalds
On Thu, Apr 12, 2018 at 12:59 PM, Mathieu Desnoyers wrote: > > What are your concerns about page pinning ? Pretty much everything. It's the most complex part by far, and the vmalloc space is a limited resource on 32-bit architectures. > Do you have an alternative approach in mind ? Do

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-12 Thread Mathieu Desnoyers
- On Apr 12, 2018, at 3:43 PM, Linus Torvalds torva...@linux-foundation.org wrote: > On Thu, Apr 12, 2018 at 12:27 PM, Mathieu Desnoyers > wrote: >> The cpu_opv system call executes a vector of operations on behalf of >> user-space on a specific CPU with

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-12 Thread Mathieu Desnoyers
- On Apr 12, 2018, at 3:43 PM, Linus Torvalds torva...@linux-foundation.org wrote: > On Thu, Apr 12, 2018 at 12:27 PM, Mathieu Desnoyers > wrote: >> The cpu_opv system call executes a vector of operations on behalf of >> user-space on a specific CPU with preemption disabled. It is inspired

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-12 Thread Linus Torvalds
On Thu, Apr 12, 2018 at 12:27 PM, Mathieu Desnoyers wrote: > The cpu_opv system call executes a vector of operations on behalf of > user-space on a specific CPU with preemption disabled. It is inspired > by readv() and writev() system calls which take a "struct

Re: [RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-12 Thread Linus Torvalds
On Thu, Apr 12, 2018 at 12:27 PM, Mathieu Desnoyers wrote: > The cpu_opv system call executes a vector of operations on behalf of > user-space on a specific CPU with preemption disabled. It is inspired > by readv() and writev() system calls which take a "struct iovec" > array as argument. Do we

[RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-12 Thread Mathieu Desnoyers
The cpu_opv system call executes a vector of operations on behalf of user-space on a specific CPU with preemption disabled. It is inspired by readv() and writev() system calls which take a "struct iovec" array as argument. The operations available are: comparison, memcpy, add, or, and, xor, left

[RFC PATCH for 4.18 12/23] cpu_opv: Provide cpu_opv system call (v7)

2018-04-12 Thread Mathieu Desnoyers
The cpu_opv system call executes a vector of operations on behalf of user-space on a specific CPU with preemption disabled. It is inspired by readv() and writev() system calls which take a "struct iovec" array as argument. The operations available are: comparison, memcpy, add, or, and, xor, left