lkml.org 
[lkml]   [2015]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC 00/15] decouple pagefault_disable() from preempt_disable()

* Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> Am 07.05.2015 um 11:48 schrieb Ingo Molnar:
> >
> > * Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> >> On Wed, 6 May 2015 19:50:24 +0200 David Hildenbrand <dahi@linux.vnet.ibm.com> wrote:
> >>
> >>> As Peter asked me to also do the decoupling in one shot, this is
> >>> the new series.
> >>>
> >>> I recently discovered that might_fault() doesn't call might_sleep()
> >>> anymore. Therefore bugs like:
> >>>
> >>> spin_lock(&lock);
> >>> rc = copy_to_user(...);
> >>> spin_unlock(&lock);
> >>>
> >>> would not be detected with CONFIG_DEBUG_ATOMIC_SLEEP. The code was
> >>> changed to disable false positives for code like:
> >>>
> >>> pagefault_disable();
> >>> rc = copy_to_user(...);
> >>> pagefault_enable();
> >>>
> >>> Whereby the caller wants do deal with failures.
> >>
> >> hm, that was a significant screwup. I wonder how many bugs we
> >> subsequently added.
> >
> > So I'm wondering what the motivation was to allow things like:
> >
> > pagefault_disable();
> > rc = copy_to_user(...);
> > pagefault_enable();
> >
> > and to declare it a false positive?
> >
> > AFAICS most uses are indeed atomic:
> >
> > pagefault_disable();
> > ret = futex_atomic_cmpxchg_inatomic(curval, uaddr, uval, newval);
> > pagefault_enable();
> >
> > so why not make it explicitly atomic again?
>
> Hmm, I am probably misreading that, but it sound as you suggest to go back
> to Davids first proposal
> https://lkml.org/lkml/2014/11/25/436
> which makes might_fault to also contain might_sleep. Correct?

Yes, but I'm wondering what I'm missing: is there any deep reason for
making pagefaults-disabled sections non-atomic?

Thanks,

Ingo


\
 
 \ /
  Last update: 2015-05-07 13:21    [W:1.163 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site