From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail203.messagelabs.com (mail203.messagelabs.com [216.82.254.243]) by kanga.kvack.org (Postfix) with SMTP id 1A8366B009E for ; Tue, 26 Jan 2010 11:12:58 -0500 (EST) Message-ID: <4B5F1460.7030106@redhat.com> Date: Tue, 26 Jan 2010 11:12:16 -0500 From: Rik van Riel MIME-Version: 1.0 Subject: Re: [PATCH 04 of 31] update futex compound knowledge References: <948638099c17d3da3d6f.1264513919@v2.random> In-Reply-To: <948638099c17d3da3d6f.1264513919@v2.random> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: Andrea Arcangeli Cc: linux-mm@kvack.org, Marcelo Tosatti , Adam Litke , Avi Kivity , Izik Eidus , Hugh Dickins , Nick Piggin , Mel Gorman , Andi Kleen , Dave Hansen , Benjamin Herrenschmidt , Ingo Molnar , Mike Travis , KAMEZAWA Hiroyuki , Christoph Lameter , Chris Wright , Andrew Morton , bpicco@redhat.com, Christoph Hellwig , KOSAKI Motohiro List-ID: On 01/26/2010 08:51 AM, Andrea Arcangeli wrote: > From: Andrea Arcangeli > > Futex code is smarter than most other gup_fast O_DIRECT code and knows about > the compound internals. However now doing a put_page(head_page) will not > release the pin on the tail page taken by gup-fast, leading to all sort of > refcounting bugchecks. Getting a stable head_page is a little tricky. > > Signed-off-by: Andrea Arcangeli > --- > > diff --git a/kernel/futex.c b/kernel/futex.c > --- a/kernel/futex.c > +++ b/kernel/futex.c > @@ -218,7 +218,7 @@ get_futex_key(u32 __user *uaddr, int fsh > { > unsigned long address = (unsigned long)uaddr; > struct mm_struct *mm = current->mm; > - struct page *page; > + struct page *page, *page_head; > int err; > > /* > @@ -250,10 +250,32 @@ again: > if (err< 0) > return err; > > - page = compound_head(page); > - lock_page(page); > - if (!page->mapping) { > - unlock_page(page); > + page_head = page; ... > + if (unlikely(page_head != page)) { Should the line above be "page_head = compound_head(page);" or am I missing something? If I am missing something, the changelog message could be a little more verbose :) -- All rights reversed. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org