From: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Darren Hart <dvhltc@us.ibm.com>
Subject: Re: [GIT pull] futex fixes for 2.6.31
Date: Thu, 25 Jun 2009 10:43:46 +0800 [thread overview]
Message-ID: <1245897826.2560.421.camel@ymzhang> (raw)
In-Reply-To: <alpine.LFD.2.00.0906242146500.2767@localhost.localdomain>
On Wed, 2009-06-24 at 21:48 +0200, Thomas Gleixner wrote:
> Linus,
>
> Please pull the latest futexes-for-linus git tree from:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git futexes-for-linus
>
> Thanks,
>
> tglx
>
> ------------------>
> Thomas Gleixner (1):
> futex: Fix the write access fault problem for real
>
>
> kernel/futex.c | 45 ++++++++++++++++++++++++---------------------
> 1 files changed, 24 insertions(+), 21 deletions(-)
>
> diff --git a/kernel/futex.c b/kernel/futex.c
> index 80b5ce7..1c33711 100644
> --- a/kernel/futex.c
> +++ b/kernel/futex.c
> @@ -284,6 +284,25 @@ void put_futex_key(int fshared, union futex_key *key)
> drop_futex_key_refs(key);
> }
>
> +/*
> + * fault_in_user_writeable - fault in user address and verify RW access
> + * @uaddr: pointer to faulting user space address
> + *
> + * Slow path to fixup the fault we just took in the atomic write
> + * access to @uaddr.
> + *
> + * We have no generic implementation of a non destructive write to the
> + * user address. We know that we faulted in the atomic pagefault
> + * disabled section so we can as well avoid the #PF overhead by
> + * calling get_user_pages() right away.
> + */
> +static int fault_in_user_writeable(u32 __user *uaddr)
> +{
> + int ret = get_user_pages(current, current->mm, (unsigned long)uaddr,
> + sizeof(*uaddr), 1, 0, NULL, NULL);
The 4th parameter of get_user_pages means page number. sizeof(*uaddr) is equal to
4, so you want 4 pages?
Yanmin
next prev parent reply other threads:[~2009-06-25 2:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-24 14:36 [PATCH V2] futex: Fix the write access fault problem for real Thomas Gleixner
2009-06-24 16:46 ` Linus Torvalds
2009-06-24 19:48 ` [GIT pull] futex fixes for 2.6.31 Thomas Gleixner
2009-06-25 2:43 ` Zhang, Yanmin [this message]
2009-06-25 9:56 ` Thomas Gleixner
2009-06-25 10:04 ` Ingo Molnar
2009-06-25 18:15 ` [GIT pull] final " Thomas Gleixner
2009-06-25 18:26 ` Linus Torvalds
2009-06-25 9:58 ` [PATCH] clarify get_user_pages() prototype Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1245897826.2560.421.camel@ymzhang \
--to=yanmin_zhang@linux.intel.com \
--cc=dvhltc@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox