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

Dave Hansen
2025-09-05T19:26:24Z

On 9/5/25 11:43, Jason Gunthorpe wrote:
> 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()?

Fine with me.

>> + 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.
Ahh, yes, agreed. The list_head is on the stack and going away. The
global list is now empty after the list splice.