Messages in this thread | | | Date | Tue, 21 May 2013 13:18:18 +0200 | From | Peter Zijlstra <> | Subject | Re: [PATCH v2 10/10] kernel: might_fault does not imply might_sleep |
| |
On Sun, May 19, 2013 at 07:40:09PM +0300, Michael S. Tsirkin wrote: > OK I get it. So let me correct myself. The simple code > that does something like this under a spinlock: > > preempt_disable > > pagefault_disable > > error = copy_to_user > > pagefault_enable > > preempt_enable > > > is not doing anything wrong and should not get a warning, > as long as error is handled correctly later. > Right?
Indeed, but I don't get the point of the preempt_{disable,enable}() here. Why does it have to disable preemption explicitly here? I thought all you wanted was to avoid the pagefault handler and make it do the exception table thing; for that pagefault_disable() is sufficient.
| |