Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Arnd Bergmann
On Thursday 16 May 2013, Michael S. Tsirkin wrote: This improves the might_fault annotations used by uaccess routines: 1. The only reason uaccess routines might sleep is if they fault. Make this explicit for all architectures. 2. Accesses (e.g through socket ops) to kernel memory

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: On Thursday 16 May 2013, Michael S. Tsirkin wrote: This improves the might_fault annotations used by uaccess routines: 1. The only reason uaccess routines might sleep is if they fault. Make this explicit for all

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Peter Zijlstra
On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: Calling might_fault() for every __get_user/__put_user is rather expensive because it turns what should be a single instruction (plus fixup) into an external function call. We could hide it all behind CONFIG_DEBUG_ATOMIC_SLEEP just

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2013 at 12:19:16PM +0200, Peter Zijlstra wrote: On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: Calling might_fault() for every __get_user/__put_user is rather expensive because it turns what should be a single instruction (plus fixup) into an external

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Peter Zijlstra
On Wed, May 22, 2013 at 02:07:29PM +0300, Michael S. Tsirkin wrote: On Wed, May 22, 2013 at 12:19:16PM +0200, Peter Zijlstra wrote: On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: Calling might_fault() for every __get_user/__put_user is rather expensive because it turns

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Russell King - ARM Linux
On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: Given the most commonly used functions and a couple of architectures I'm familiar with, these are the ones that currently call might_fault() x86-32 x86-64 arm arm64 powerpc s390generic

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Arnd Bergmann
On Wednesday 22 May 2013, Russell King - ARM Linux wrote: On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: Given the most commonly used functions and a couple of architectures I'm familiar with, these are the ones that currently call might_fault()

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2013 at 04:04:48PM +0200, Arnd Bergmann wrote: On Wednesday 22 May 2013, Russell King - ARM Linux wrote: On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: Given the most commonly used functions and a couple of architectures I'm familiar with, these are the

[PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-16 Thread Michael S. Tsirkin
This improves the might_fault annotations used by uaccess routines: 1. The only reason uaccess routines might sleep is if they fault. Make this explicit for all architectures. 2. Accesses (e.g through socket ops) to kernel memory with KERNEL_DS like net/sunrpc does will never sleep.