Re: [PATCH v4 02/12] mm/rmap: Add try_to_unmap_hugetlb_one
From: Garg, Shivank
Date: Thu Jul 09 2026 - 03:19:31 EST
On 5/26/2026 12:06 PM, Dev Jain wrote:
> Simplify try_to_unmap_one by separating out the hugetlb parts into
> try_to_unmap_hugetlb_one.
[snip]
> @@ -2393,7 +2431,8 @@ static int folio_not_mapped(struct folio *folio)
> void try_to_unmap(struct folio *folio, enum ttu_flags flags)
> {
> struct rmap_walk_control rwc = {
> - .rmap_one = try_to_unmap_one,
> + .rmap_one = folio_test_hugetlb(folio) ?
> + try_to_unmap_hugetlb_one : try_to_unmap_one,
> .arg = (void *)flags,
> .done = folio_not_mapped,
> .anon_lock = folio_lock_anon_vma_read,
Now that try_to_unmap_hugetlb_one() is split out, should we wrap it in
#ifdef CONFIG_HUGETLB_PAGE and a stub function for !HUGETLB case?
I'm working on similar change for try_to_migrate() and had this thought.
I think either is fine, but wanted to check the preference.
Thanks,
Shivank