On Mon, May 29, 2023 at 8:23 AM Hugh Dickins <hughd@xxxxxxxxxx> wrote: > Add the generic pte_free_defer(), to call pte_free() via call_rcu(). > pte_free_defer() will be called inside khugepaged's retract_page_tables() > loop, where allocating extra memory cannot be relied upon. This version > suits all those architectures which use an unfragmented page for one page > table (none of whose pte_free()s use the mm arg which was passed to it). Pages that have been scheduled for deferred freeing can still be locked, right? So struct page's members "ptl" and "rcu_head" can now be in use at the same time? If that's intended, it would probably be a good idea to add comments in the "/* Page table pages */" part of struct page to point out that the first two members can be used by the rcu_head while the page is still used as a page table in some contexts, including use of the ptl.