mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/5] mm: unbloat get_futex_key
Date: Mon, 21 Nov 2005 20:33:29 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0511212032450.19274@goblin.wat.veritas.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0511212025220.19274@goblin.wat.veritas.com>

The follow_page changes in get_futex_key have left it with two almost
identical blocks, when handling the rare case of a futex in a nonlinear
vma.  get_user_pages will itself do that follow_page, and its additional
find_extend_vma is hardly any overhead since the vma is already cached.
Let's just delete the follow_page block and let get_user_pages do it.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---

 kernel/futex.c |   15 ---------------
 1 files changed, 15 deletions(-)

--- 2.6.15-rc2/kernel/futex.c	2005-11-20 19:44:23.000000000 +0000
+++ linux/kernel/futex.c	2005-11-21 18:50:20.000000000 +0000
@@ -201,21 +201,6 @@ static int get_futex_key(unsigned long u
 	 * from swap.  But that's a lot of code to duplicate here
 	 * for a rare case, so we simply fetch the page.
 	 */
-
-	/*
-	 * Do a quick atomic lookup first - this is the fastpath.
-	 */
-	page = follow_page(mm, uaddr, FOLL_TOUCH|FOLL_GET);
-	if (likely(page != NULL)) {
-		key->shared.pgoff =
-			page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
-		put_page(page);
-		return 0;
-	}
-
-	/*
-	 * Do it the general way.
-	 */
 	err = get_user_pages(current, mm, uaddr, 1, 0, 0, &page, NULL);
 	if (err >= 0) {
 		key->shared.pgoff =

  parent reply	other threads:[~2005-11-21 22:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-21 20:31 [PATCH 0/5] mm: flotsam Hugh Dickins
2005-11-21 20:32 ` [PATCH 1/5] mm: update split ptlock Kconfig Hugh Dickins
2005-11-21 20:33 ` Hugh Dickins [this message]
2005-11-21 20:35 ` [PATCH 3/5] mm: powerpc ptlock comments Hugh Dickins
2005-11-21 23:09   ` Paul Mackerras
2005-11-22  7:12     ` Hugh Dickins
2005-11-22  7:57       ` Benjamin Herrenschmidt
2005-11-21 20:36 ` [PATCH 4/5] mm: powerpc init_mm without ptlock Hugh Dickins
2005-11-21 20:38 ` [PATCH 5/5] mm: fill arch atomic64 gaps Hugh Dickins

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=Pine.LNX.4.61.0511212032450.19274@goblin.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®