[PATCH 0/8] mm: introduce zone lock guards
From: Dmitry Ilvokhin
Date: Fri Mar 06 2026 - 11:07:15 EST
This series defines DEFINE_LOCK_GUARD_1 for zone_lock_irqsave and uses
it across several mm functions to replace explicit lock/unlock patterns
with automatic scope-based cleanup.
This simplifies the control flow by removing 'flags' variables, goto
labels, and redundant unlock calls.
Patches are ordered by decreasing value. The first six patches simplify
the control flow by removing gotos, multiple unlock paths, or 'ret'
variables. The last two are simpler lock/unlock pair conversions that
only remove 'flags' and can be dropped if considered unnecessary churn.
Based on mm-new.
Suggested-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
Dmitry Ilvokhin (8):
mm: use zone lock guard in reserve_highatomic_pageblock()
mm: use zone lock guard in unset_migratetype_isolate()
mm: use zone lock guard in unreserve_highatomic_pageblock()
mm: use zone lock guard in set_migratetype_isolate()
mm: use zone lock guard in take_page_off_buddy()
mm: use zone lock guard in put_page_back_buddy()
mm: use zone lock guard in free_pcppages_bulk()
mm: use zone lock guard in __offline_isolated_pages()
include/linux/mmzone_lock.h | 9 +++++
mm/page_alloc.c | 50 +++++++++------------------
mm/page_isolation.c | 67 ++++++++++++++++---------------------
3 files changed, 53 insertions(+), 73 deletions(-)
--
2.47.3