Re: [RFC PATCH for 4.15 09/14] Provide cpu_opv system call

2017-10-14 Thread Mathieu Desnoyers
- On Oct 13, 2017, at 10:50 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Oct 13, 2017, at 9:57 AM, One Thousand Gnomes > gno...@lxorguk.ukuu.org.uk wrote: > >>> A maximum limit of 16 operations per cpu_opv syscall invocation is >>> enforced, so user-space cannot gen

Re: [RFC PATCH for 4.15 09/14] Provide cpu_opv system call

2017-10-14 Thread Mathieu Desnoyers
- On Oct 13, 2017, at 10:50 PM, Andi Kleen a...@firstfloor.org wrote: >> +pagefault_disable(); >> +switch (len) { >> +case 1: >> +if (__get_user(tmp._u8, (uint8_t __user *)p)) >> +goto end; >> +tmp._u8 += (uint8_t)count; >> +i

Re: [RFC PATCH for 4.15 09/14] Provide cpu_opv system call

2017-10-13 Thread Andi Kleen
> + pagefault_disable(); > + switch (len) { > + case 1: > + if (__get_user(tmp._u8, (uint8_t __user *)p)) > + goto end; > + tmp._u8 += (uint8_t)count; > + if (__put_user(tmp._u8, (uint8_t __user *)p)) > + goto e

Re: [RFC PATCH for 4.15 09/14] Provide cpu_opv system call

2017-10-13 Thread Andy Lutomirski
On Thu, Oct 12, 2017 at 4:03 PM, Mathieu Desnoyers wrote: > This new cpu_opv system call executes a vector of operations on behalf > of user-space on a specific CPU with preemption disabled. It is inspired > from readv() and writev() system calls which take a "struct iovec" array > as argument. >

Re: [RFC PATCH for 4.15 09/14] Provide cpu_opv system call

2017-10-13 Thread Mathieu Desnoyers
- On Oct 13, 2017, at 9:57 AM, One Thousand Gnomes gno...@lxorguk.ukuu.org.uk wrote: >> A maximum limit of 16 operations per cpu_opv syscall invocation is >> enforced, so user-space cannot generate a too long preempt-off critical >> section. > > Except that all the operations could be going

Re: [RFC PATCH for 4.15 09/14] Provide cpu_opv system call

2017-10-13 Thread Alan Cox
> A maximum limit of 16 operations per cpu_opv syscall invocation is > enforced, so user-space cannot generate a too long preempt-off critical > section. Except that all the operations could be going to mmapped I/O space and if I pick the right targets could take quite a long time to complete. It

[RFC PATCH for 4.15 09/14] Provide cpu_opv system call

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