[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <328386e6-7cb5-4571-97ae-23a6d266c1e5@oracle.com>
Date: Wed, 29 May 2024 11:21:12 -0700
From: Sidhartha Kumar <sidhartha.kumar@...cle.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
akpm@...ux-foundation.org, vishal.moola@...cle.com,
muchun.song@...ux.dev, david@...hat.com, osalvador@...e.de
Subject: Re: [PATCH] mm/hugetlb: mm/memory_hotplug: use a folio in
scan_movable_pages()
On 5/28/24 3:47 PM, Matthew Wilcox wrote:
> On Tue, May 28, 2024 at 03:03:21PM -0700, Sidhartha Kumar wrote:
>> @@ -1761,9 +1762,9 @@ static int scan_movable_pages(unsigned long start, unsigned long end,
>> * cases false positives and negatives are possible. Calling
>> * code must deal with these scenarios.
>> */
>> - if (HPageMigratable(head))
>> + if (folio_test_hugetlb_migratable(folio))
>> goto found;
>> - skip = compound_nr(head) - (pfn - page_to_pfn(head));
>> + skip = folio_nr_pages(folio) - folio_page_idx(folio, page);
>> pfn += skip - 1;
>
> Isn't this an unnecessarily complicated way of writing:
>
> pfn |= folio_nr_pages(folio) - 1;
> ?
Because folio_nr_pages() is a power of 2, I agree this is simpler. I'll make
this change in a v2.
Thanks,
Sid
Powered by blists - more mailing lists