lkml.org 
[lkml]   [2014]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic
Date
Simple prototype to enable might_sleep() checks in might_fault(), avoiding false
positives for scenarios involving explicit pagefault_disable().

So this should work:
spin_lock(&lock); /* also if left away */
pagefault_disable()
rc = copy_to_user(...)
pagefault_enable();
spin_unlock(&lock); /*

And this should report a warning again:
spin_lock(&lock);
rc = copy_to_user(...);
spin_unlock(&lock);

Still missing:
- Split of preempt documentation update + preempt_active define reshuffle
- Debug version to test for over/underflows
- Change documentation of user access methods to reflect the real behavior
- Don't touch the preempt counter, only the pagefault disable counter (future
work)

David Hildenbrand (2):
preempt: track pagefault_disable() calls in the preempt counter
mm, sched: trigger might_sleep() in might_fault() when pagefaults are
disabled

include/linux/kernel.h | 9 +++++++--
include/linux/preempt_mask.h | 24 +++++++++++++++++++-----
include/linux/uaccess.h | 21 ++++++++++++++-------
mm/memory.c | 15 ++++-----------
4 files changed, 44 insertions(+), 25 deletions(-)

--
1.8.5.5



\
 
 \ /
  Last update: 2014-11-27 18:41    [W:0.238 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site