[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <B31AAF03-1997-4449-AAB4-66F4CABEFE57@nvidia.com>
Date: Mon, 16 Jun 2025 21:38:52 -0400
From: Zi Yan <ziy@...dia.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, David Hildenbrand <david@...hat.com>,
Johannes Weiner <hannes@...xchg.org>, Vlastimil Babka <vbabka@...e.cz>,
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 v9 0/6] Make MIGRATE_ISOLATE a standalone bit
On 16 Jun 2025, at 21:37, Andrew Morton wrote:
> On Mon, 16 Jun 2025 08:10:13 -0400 Zi Yan <ziy@...dia.com> wrote:
>
>> Hi all,
>>
>> This patchset moves MIGRATE_ISOLATE to a standalone bit to avoid
>> being overwritten during pageblock isolation process. Currently,
>> MIGRATE_ISOLATE is part of enum migratetype (in include/linux/mmzone.h),
>> thus, setting a pageblock to MIGRATE_ISOLATE overwrites its original
>> migratetype. This causes pageblock migratetype loss during
>> alloc_contig_range() and memory offline, especially when the process
>> fails due to a failed pageblock isolation and the code tries to undo the
>> finished pageblock isolations.
>>
>> It is on top of mm-everything-2025-06-15-23-48.
>
> mm-new would be a better target. mm-new is not (yet) included in
> linux-next, hence it is not in mm-everything.
>
> I hit a few issues (x86_64 allmodconfig):
>
> In file included from ./include/linux/slab.h:16,
> from ./include/linux/irq.h:21,
> from ./include/linux/of_irq.h:7,
> from drivers/gpu/drm/msm/hdmi/hdmi.c:9:
> ./include/linux/gfp.h:428:25: error: expected identifier before '(' token
> 428 | #define ACR_NONE ((__force acr_flags_t)0) // ordinary allocation request
> | ^
> drivers/gpu/drm/msm/generated/hdmi.xml.h:71:9: note: in expansion of macro 'ACR_NONE'
> 71 | ACR_NONE = 0,
> | ^~~~~~~~
>
>
>
> And this was needed:
>
> kernel/kexec_handover.c uses set_pageblock_migratetype()
>
> --- a/include/linux/page-isolation.h~mm-page_isolation-remove-migratetype-from-move_freepages_block_isolate-fix
> +++ a/include/linux/page-isolation.h
> @@ -45,6 +45,8 @@ void __meminit init_pageblock_migratetyp
> enum migratetype migratetype,
> bool isolate);
>
> +void set_pageblock_migratetype(struct page *page, enum migratetype migratetype);
> +
> bool pageblock_isolate_and_move_free_pages(struct zone *zone, struct page *page);
> bool pageblock_unisolate_and_move_free_pages(struct zone *zone, struct page *page);
>
> --- a/mm/page_alloc.c~mm-page_isolation-remove-migratetype-from-move_freepages_block_isolate-fix
> +++ a/mm/page_alloc.c
> @@ -525,8 +525,7 @@ void clear_pfnblock_bit(const struct pag
> * @page: The page within the block of interest
> * @migratetype: migratetype to set
> */
> -static void set_pageblock_migratetype(struct page *page,
> - enum migratetype migratetype)
> +void set_pageblock_migratetype(struct page *page, enum migratetype migratetype)
> {
> if (unlikely(page_group_by_mobility_disabled &&
> migratetype < MIGRATE_PCPTYPES))
> _
Got it. Let me rebase and resend it.
Best Regards,
Yan, Zi
Powered by blists - more mailing lists