[lkml]   [2010]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/4] hugetlb, rmap: always use anon_vma root pointer
On Fri, Sep 10, 2010 at 2:50 PM, Andi Kleen <> wrote:
>> 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?

I'm talking about this:

if (!exclusive) {
if (PageAnon(page))
anon_vma = anon_vma->root;
} else {
.. big bad comment ...
if (PageAnon(page))

where both sides of the if-statement start off doing the same thing.

It would be much cleaner to just do

... big _comprehensible_ comment ...
if (PageAnon(page))

if (!exclusive)
anon_vma = anon_vma->root;

which avoids that silly else that just does something that we always do.

The reason I reacted is that Naoya-san's patch did that cleaner
version for the hugetlb case. So when I compared it to the non-hugetlb
case I just went "Ewww..."


 \ /
  Last update: 2010-09-11 00:09    [W:0.061 / U:0.776 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site