Re: [PATCH v2 06/17] mm/huge_memory: consolidate irq and locking for folio split
"Zi Yan" <[email protected]>
| Newsgroups | gmane.linux.kernel,gmane.linux.kernel.mm |
|---|---|
| Message-ID | <[email protected]> |
On Wed Aug 12, 2026 at 2:48 PM EDT, Kairui Song via B4 Relay wrote: > From: Kairui Song <[email protected]> > > Let each split helper handle its own locking instead of relying on > the caller, so both helpers manage their own irq and locking state. > This lets __folio_split() drop its local irq handling and fail label, > preparing for further cleanup. > > The file path now uses xas_lock_irq() instead of local_irq_disable() > with xas_lock(). The two are equivalent on non-RT, and > TRANSPARENT_HUGEPAGE cannot be enabled on RT anyway. This conversion > also buys consistency: every other place in mm/ that freezes a folio > while it is still reachable through the page cache already takes the > lock this way. This was actually the last plain xas_lock() on > mapping->i_pages left in mm. If we are going to support RT, spinning > on frozen folio refs could be a problem, but it already exists in > many places and should be fixed generically. > > The anon helper keeps a single local_irq_disable() as before, because > it has to cover several plain spinlocks at once. > > The dropped xas_reset() was a no-op as the xa_state is not walked > before the xas_load() under the lock. > > Signed-off-by: Kairui Song <[email protected]> > --- > mm/huge_memory.c | 52 ++++++++++++++++++++++++---------------------------- > 1 file changed, 24 insertions(+), 28 deletions(-) > The changes look good to me and the commit message looks great! Reviewed-by: Zi Yan <[email protected]> -- Best Regards, Yan, Zi