lkml.org 
[lkml]   [2010]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] hugetlb, rmap: always use anon_vma root pointer
On 09/10/2010 05:50 PM, Andi Kleen wrote:
> On Fri, 10 Sep 2010 10:19:24 -0700
> Linus Torvalds<torvalds@linux-foundation.org> wrote:
>
>> On Thu, Sep 9, 2010 at 9:23 PM, Naoya Horiguchi
>> <n-horiguchi@ah.jp.nec.com> wrote:
>>> This patch applies Andrea's fix given by the following patch into
>>> hugepage rmapping code:
>>>
>>> commit 288468c334e98aacbb7e2fb8bde6bc1adcd55e05
>>> Author: Andrea Arcangeli<aarcange@redhat.com>
>>> Date: Mon Aug 9 17:19:09 2010 -0700
>>>
>>> This patch uses anon_vma->root and avoids unnecessary overwriting
>>> when anon_vma is already set up.
>>
>> Btw, why isn't the code in __page_set_anon_rmap() also doing this
>> cleaner version (ie a single "if (PageAnon(page)) return;" up front)?
>
> Perhaps I misunderstand the question, but __page_set_anon_rmap
> should handle Anon pages, shouldn't it?

__page_set_anon_rmap sets the page->mapping to be
a pointer to the anon_vma & PAGE_MAPPING_ANON.

PageAnon tests for page->mapping & PAGE_MAPPING_ANON,
ie. whether page->mapping is already pointing to an
anon_vma.

If it is, __page_set_anon_rmap should leave the page
mapping pointer alone.

--
All rights reversed


\
 
 \ /
  Last update: 2010-09-11 04:13    [W:0.080 / U:0.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site