[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1403061459190.18573@ionos.tec.linutronix.de>
Date: Thu, 6 Mar 2014 15:04:47 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Rasmus Villemoes <linux@...musvillemoes.dk>
cc: Peter Zijlstra <peterz@...radead.org>,
"H. Peter Anvin" <hpa@...or.com>,
Khalid Aziz <khalid.aziz@...cle.com>,
Ingo Molnar <mingo@...nel.org>, akpm@...ux-foundation.org,
andi.kleen@...el.com, rob@...dley.net, viro@...iv.linux.org.uk,
oleg@...hat.com, venki@...gle.com, linux-kernel@...r.kernel.org
Subject: Re: [RFC] [PATCH] Pre-emption control for userspace
On Thu, 6 Mar 2014, Rasmus Villemoes wrote:
> Peter Zijlstra <peterz@...radead.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists