Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751391AbVKJBts (ORCPT ); Wed, 9 Nov 2005 20:49:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751396AbVKJBts (ORCPT ); Wed, 9 Nov 2005 20:49:48 -0500 Received: from gold.veritas.com ([143.127.12.110]:43827 "EHLO gold.veritas.com") by vger.kernel.org with ESMTP id S1751394AbVKJBts (ORCPT ); Wed, 9 Nov 2005 20:49:48 -0500 Date: Thu, 10 Nov 2005 01:48:36 +0000 (GMT) From: Hugh Dickins X-X-Sender: hugh@goblin.wat.veritas.com To: Andrew Morton cc: Jamie Lokier , linux-kernel@vger.kernel.org Subject: [PATCH 05/15] mm: unbloat get_futex_key In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 10 Nov 2005 01:49:47.0826 (UTC) FILETIME=[0814B920:01C5E599] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1443 Lines: 41 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 --- kernel/futex.c | 15 --------------- 1 files changed, 15 deletions(-) --- mm04/kernel/futex.c 2005-11-07 07:39:59.000000000 +0000 +++ mm05/kernel/futex.c 2005-11-09 14:38:47.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 = - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/