[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <604F6BEB-7CCD-4C39-A770-E5C5341AE40A@nvidia.com>
Date: Fri, 30 May 2025 13:10:49 -0400
From: Zi Yan <ziy@...dia.com>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: David Hildenbrand <david@...hat.com>,
Johannes Weiner <hannes@...xchg.org>, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>,
Oscar Salvador <osalvador@...e.de>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Mel Gorman <mgorman@...hsingularity.net>,
Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
Brendan Jackman <jackmanb@...gle.com>, Richard Chang <richardycc@...gle.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 3/6] mm/page_alloc: add support for initializing
pageblock as isolated.
On 30 May 2025, at 13:06, Vlastimil Babka wrote:
> On 5/30/25 18:22, Zi Yan wrote:
>> MIGRATE_ISOLATE is a standalone bit, so a pageblock cannot be initialized
>> to just MIGRATE_ISOLATE. Add init_pageblock_migratetype() to enable
>> initialize a pageblock with a migratetype and isolated.
>>
>> Signed-off-by: Zi Yan <ziy@...dia.com>
>> Reviewed-by: Vlastimil Babka <vbabka@...e.cz>
>
>> +void __meminit init_pageblock_migratetype(struct page *page,
>> + enum migratetype migratetype,
>> + bool isolate)
>> +{
>> + unsigned long mask = MIGRATETYPE_MASK;
>> + unsigned long flags = migratetype;
>> +
>> + if (unlikely(page_group_by_mobility_disabled &&
>> + migratetype < MIGRATE_PCPTYPES))
>> + migratetype = MIGRATE_UNMOVABLE;
>> +
>> +#ifdef CONFIG_MEMORY_ISOLATION
>> + if (migratetype == MIGRATE_ISOLATE) {
>> + VM_WARN_ONCE(
>> + 1,
>> + "Set isolate=true to isolate pageblock with a migratetype");
>> + return;
>> + }
>> + if (isolate) {
>> + mask = MIGRATETYPE_AND_ISO_MASK;
>> + flags |= BIT(PB_migrate_isolate);
>> + }
>> +#endif
>> + __set_pfnblock_flags_mask(page, page_to_pfn(page), flags, mask);
>
> Nit: I think this could have also used MIGRATETYPE_AND_ISO_MASK unconditionally?
Yes, let me send a fixup patch. Thanks for spotting it.
>> +}
>> +
>> #ifdef CONFIG_DEBUG_VM
>> static int page_outside_zone_boundaries(struct zone *zone, struct page *page)
>> {
Best Regards,
Yan, Zi
Powered by blists - more mailing lists