Re: [PATCH v2 03/20] mm, hugetlb: fix subpool accounting handling

From: Joonsoo Kim
Date: Thu Aug 22 2013 - 02:50:37 EST


Hello, Aneesh.

First of all, thank you for review!

On Wed, Aug 21, 2013 at 02:58:20PM +0530, Aneesh Kumar K.V wrote:
> Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> writes:
>
> > If we alloc hugepage with avoid_reserve, we don't dequeue reserved one.
> > So, we should check subpool counter when avoid_reserve.
> > This patch implement it.
>
> Can you explain this better ? ie, if we don't have a reservation in the
> area chg != 0. So why look at avoid_reserve.

We don't consider avoid_reserve when chg != 0.
Look at following code.

+ if (chg || avoid_reserve)
+ if (hugepage_subpool_get_pages(spool, 1))

It means that if chg != 0, we skip to check avoid_reserve.

>
> Also the code will become if you did
>
> if (!chg && avoid_reserve)
> chg = 1;
>
> and then rest of the code will be able to handle the case.


We still pass avoid_reserve to dequeue_huge_page_vma() and check avoid_reserve
there, so maintaining avoid_reserve and checking it separately is better
to understand a logic. And it doesn't matter at all since I eventually unify
these in patch 13.

Thanks.
--
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/