lkml.org 
[lkml]   [2014]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] [PATCH] Pre-emption control for userspace
    On Thu, 6 Mar 2014, Rasmus Villemoes wrote:

    > Peter Zijlstra <peterz@infradead.org> writes:
    >
    > > On Thu, Mar 06, 2014 at 02:24:43PM +0100, Rasmus Villemoes wrote:
    > >> Is it possible to implement non-sleeping versions of {get,put}_user()?
    > >
    > > __{get,put}_user()
    >
    > Huh?
    >
    > arch/x86/include/asm/uaccess.h:
    >
    > /**
    > * __get_user: - Get a simple variable from user space, with less checking.
    > * @x: Variable to store result.
    > * @ptr: Source address, in user space.
    > *
    > * Context: User context only. This function may sleep.
    >
    > What am I missing?

    All these variants can sleep, as they might trip a page fault.....

    If you want to access user space from a context which cant sleep you
    need to use the __copy_to/from_user_inatomic variants. If the access
    fails then they return -EFAULT and you need to deal with that
    yourself.

    Thanks,

    tglx





    \
     
     \ /
      Last update: 2014-03-06 15:41    [W:2.883 / U:0.116 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site