Re: [PATCH 4/4] mm/mempolicy: skip zone device folios when queueing folios

From: David Hildenbrand (Arm)

Date: Thu Aug 06 2026 - 10:15:24 EST


On 8/6/26 15:36, Lorenzo Stoakes (ARM) wrote:
> On Thu, Aug 06, 2026 at 03:25:50PM +0200, David Hildenbrand (Arm) wrote:
>> On 7/28/26 21:47, Gregory Price wrote:
>>> mm/mempolicy.c | 4 ++++
>>> @@ -797,6 +799,8 @@ static int queue_folios_hugetlb(pte_t *pte, unsigned long hmask,
>>> folio = pfn_folio(pte_pfn(ptep));
>>> if (!queue_folio_required(folio, qp))
>>> goto unlock;
>>> + if (folio_is_zone_device(folio))
>>> + goto unlock;
>>
>> Leave the hugetlb part alone. hugetlb folios will never be ZONE_DEVICE.
>
> <Insert leave Britney alone meme here> :P
>
> But dear God we have got to find ways to stop hugetlb being this big stupid
> nightmare that every single path of mm has to put an asterix next to itself
> about!

Yeah, possibly unifying the code (possibly, because it's a mess) but not
replicating checks that don't make any sense for hugetlb.

--
Cheers,

David