Re: [PATCH 2/2] huge-memory: Use fast mm counters for transparenthuge pages

From: KAMEZAWA Hiroyuki
Date: Mon Apr 09 2012 - 03:55:11 EST


(2012/03/31 23:09), Andi Kleen wrote:

> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> We found that the mm struct anon page counter cache line is much hotter
> with transparent huge pages compared to small pages.
>
> Small pages use a special fast counter mechanism in task_struct, but huge pages
> didn't. The huge pages are larger than the normal 64 entry threshold for the
> fast counter, so it cannot be directly used. Use a new special counter for huge
> pages to handle them efficiently.
>
> Any users just calculate the correct total.
>
> The only special case is transferring the large page count to small pages
> when splitting. I put it somewhat arbitarily into the tricky split
> sequence. Some review on this part is appreciated.
>
> [An alternative would be to not do that, but that could lead to
> negative counters. These should still give the correct result]
>
> Contains a fix for a problem found by Andrea in review.
>
> Cc: aarcange@xxxxxxxxxx
> Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>


Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/