Re: [External] Re: [PATCH v3 05/21] mm/hugetlb: Introduce pgtable allocation/freeing helpers

From: Oscar Salvador
Date: Tue Nov 10 2020 - 01:33:34 EST


On Tue, Nov 10, 2020 at 02:08:46PM +0800, Muchun Song wrote:
> The check should be added here.
>
> if (!pgtable)
> return NULL;
>
> Just like my previous v2 patch does. In this case, we can drop those
> checks. What do you think?

It is too early for me, so bear with me.

page_huge_pte will only return NULL in case we did not get to preallocate
any pgtable right?

What I was talimg about is that
>
> > page_huge_pte(page) = list_first_entry_or_null(&pgtable->lru,
> > struct page, lru);

here we will get the either a pgtable entry or NULL in case we already consumed
all entries from the list.
If that is the case, we can return NULL and let the caller known that we
are done.

Am I missing anything?


--
Oscar Salvador
SUSE L3