[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240815163013.2522e3dd83acffe70af9cba6@linux-foundation.org>
Date: Thu, 15 Aug 2024 16:30:13 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Usama Arif <usamaarif642@...il.com>
Cc: Barry Song <21cnbao@...il.com>, baohua@...nel.org,
cerasuolodomenico@...il.com, corbet@....net, david@...hat.com,
hannes@...xchg.org, kernel-team@...a.com, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org, riel@...riel.com,
roman.gushchin@...ux.dev, rppt@...nel.org, ryan.roberts@....com,
shakeel.butt@...ux.dev, willy@...radead.org, yuzhao@...gle.com
Subject: Re: [PATCH v3 4/6] mm: Introduce a pageflag for partially mapped
folios
On Thu, 15 Aug 2024 16:25:09 +0100 Usama Arif <usamaarif642@...il.com> wrote:
>
>
> commit c627655548fa09b59849e942da4decc84fa0b0f2
> Author: Usama Arif <usamaarif642@...il.com>
> Date: Thu Aug 15 16:07:20 2024 +0100
>
> mm: Introduce a pageflag for partially mapped folios fix
>
> Fixes the original commit by not clearing partially mapped bit
> in hugeTLB folios and fixing deferred split THP stats.
>
> ...
>
Life is getting complicated.
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1758,7 +1758,6 @@ static void __update_and_free_hugetlb_folio(struct hstate *h,
> free_gigantic_folio(folio, huge_page_order(h));
> } else {
> INIT_LIST_HEAD(&folio->_deferred_list);
> - folio_clear_partially_mapped(folio);
> folio_put(folio);
> }
> }
Yu Zhao's "mm/hugetlb: use __GFP_COMP for gigantic folios" was
expecting that folio_clear_partially_mapped() to be there.
I resolved this within
mm-hugetlb-use-__gfp_comp-for-gigantic-folios.patch thusly:
@@ -1748,18 +1704,8 @@ static void __update_and_free_hugetlb_fo
folio_ref_unfreeze(folio, 1);
- /*
- * Non-gigantic pages demoted from CMA allocated gigantic pages
- * need to be given back to CMA in free_gigantic_folio.
- */
- if (hstate_is_gigantic(h) ||
- hugetlb_cma_folio(folio, huge_page_order(h))) {
- destroy_compound_gigantic_folio(folio, huge_page_order(h));
- free_gigantic_folio(folio, huge_page_order(h));
- } else {
- INIT_LIST_HEAD(&folio->_deferred_list);
- folio_put(folio);
- }
+ INIT_LIST_HEAD(&folio->_deferred_list);
+ hugetlb_free_folio(folio);
}
/*
Please check.
Powered by blists - more mailing lists