On Thu, 21 May 2026 12:01:24 +0800, Li Zhe <[email protected]> wrote:
> diff --git a/mm/mm_init.c b/mm/mm_init.c
> index 17a84d4cda01..08feb24795b8 100644
> --- a/mm/mm_init.c
> +++ b/mm/mm_init.c
> @@ -1075,13 +1075,15 @@ static void __ref zone_device_page_init_slow(struct
> page *page,
> [ ... skip 12 lines ... ]
> */
> - return !page_ref_tracepoint_active(page_ref_set) &&
> - IS_ALIGNED(sizeof(struct page), sizeof(u64));
> + return !IS_ENABLED(CONFIG_KASAN) && !IS_ENABLED(CONFIG_KMSAN) &&
> + !page_ref_tracepoint_active(page_ref_set) &&
> + IS_ALIGNED(sizeof(struct page), sizeof(u64));
Oh, can we rewrite it as a sequence of
if (cond)
return false;
...
return true;
I believe the compilers would generate the same code.
> @@ -1104,30 +1106,42 @@ static inline void
> zone_device_template_tail_page_init(struct page *template,
> [ ... skip 10 lines ... ]
> + * copying it into @page.
> */
> -static inline void zone_device_page_init_finish(struct page *page,
> - unsigned long pfn)
> +static inline void zone_device_page_update_template(struct page *template,
> + unsigned long pfn)
Two tabs for indentation here from the first patch this function
appears please.
Why do we need the intermediate step of _init_finish() if we later
change it to _update_template()?
> [ ... skip 30 lines ... ]
> + memcpy(page, template, sizeof(*page));
> + else
> + memcpy_streaming(page, template, sizeof(*page));
>
> - for (i = 0; i < sizeof(struct page) / sizeof(u64); i++)
> - dst[i] = src[i];
If you replace this with memcpy, what's the point for doing the loop in
intermediate patches?
--
Sincerely yours,
Mike.