Andrea Arcangeli
unread,Jun 11, 2012, 3:44:57 AM6/11/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Kamezawa Hiroyuki, Minchan Kim, Andrew Morton, linux-...@vger.kernel.org, linu...@kvack.org, Mel Gorman, Michal Hocko
Hi,
Agreed!
> Other than the comment fix already pointed out..
> Hmm...BTW, it seems this __count_xxx doesn't have any code for THP/Hugepage..
> so, we need more fixes for better code, I think.
> Hmm, Don't we need !PageTail() check and 'skip thp' code ?
So the page->_count for tail pages is guaranteed zero at all times
(tail page refcounting is done on _mapcount).
We could add a comment that "this check already skips compound tails
of THP because their page->_count is zero at all times".
Instead of a comment we could consider defining an inline function
with a special name that does atomic_read(&page->_count) and use it
when we intend to the regular or compound head count and return 0 on
tails. It would make it easier to identify these places later if we
ever want to change the refcounting mechanism, but it may be overkill,
it's up to you.
Tail pages also can't be PageLRU.
The code after the patch should already skip thp tails fine (it won't
skip heads but I believe that's intentional, but one problem that
remains is that the heads should increase found by more than 1...).
Thanks,
Andrea