Re: [PATCH v4 6/8] mm: Introduce deferred freeing for kernel page tables

Jason Gunthorpe
2025-09-05T18:43:59Z

On Fri, Sep 05, 2025 at 01:51:01PM +0800, Lu Baolu wrote:

> +#ifdef CONFIG_ASYNC_PGTABLE_FREE
> +void pagetable_free_async(struct ptdesc *pt);
> +#else
> +static inline void pagetable_free_async(struct ptdesc *pt)
> +{
> + __pagetable_free(pt);
> +}
> +#endif

I'd probably call this function pagetable_free_kernel() ? Weird to
call it async when it isn't async..

ptdesc_clear_kernel()?

> + list_for_each_entry_safe(pt, next, &page_list, pt_list) {
> + list_del(&pt->pt_list);

The list_del isn't necessary, it doesn't zero the list, just _safe
iteration is fine.

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason