From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ilvokhin.com (mail.ilvokhin.com [178.62.254.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B07A346FA7 for ; Fri, 27 Mar 2026 16:15:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.62.254.231 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774628114; cv=none; b=ApZ9ZhfcFBsN9tU1tIIGID54hvPdSBw0JPsUCmbM/DdX82WXOgFphLgJpcNIaPNHBrHdZmIKZzKmm3N2Q9vxtW5Rqyfua/rJ6HW5/zZlqhyI98FoTwaFa86J72gduA+imPYT6SN6KSon0tnWVTn570fT2p7ab8HL7THCTbyFNjE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774628114; c=relaxed/simple; bh=8GKqmxHZuhYtSJDW/I/dJiVJzWC/zYevGMiowWC/kJU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fLdiYj/+sR3mOg3QgYSjW0IR96D8CU/JjKNc/SBkAmUVOF230MvBxCWxA9CvpS11CiTFlLYZZBXtPVfKz5u7Vp6j2qt/KZKNW3POCz6g09VojC5EJycwXGYOIL9kZxc9EfdCqfIzcOQpDNYbPAcY0CJmsYgMJd/rVlsQhpiOoY0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ilvokhin.com; spf=pass smtp.mailfrom=ilvokhin.com; dkim=pass (1024-bit key) header.d=ilvokhin.com header.i=@ilvokhin.com header.b=Jy3sN4o5; arc=none smtp.client-ip=178.62.254.231 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ilvokhin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ilvokhin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ilvokhin.com header.i=@ilvokhin.com header.b="Jy3sN4o5" Received: from localhost.localdomain (shell.ilvokhin.com [138.68.190.75]) (Authenticated sender: d@ilvokhin.com) by mail.ilvokhin.com (Postfix) with ESMTPSA id A3669BDFEF; Fri, 27 Mar 2026 16:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilvokhin.com; s=mail; t=1774628105; bh=8xIH/bLFhgsX9Xukaml3GhxkGzwhy8uKInPK3LEkRJI=; h=From:To:Cc:Subject:Date; b=Jy3sN4o5JTt/lp3RF525qilKkgZ3mjrIsZeMDOsqPvoKly6lLxKMrQBT7QQN3D8zf HLKqPqSRlY21uGChc95OFIkq0p8gv7Fva9n2UOzD3MskSoSq3CvW5KcbFLldxRXDsX aCZy1XftEM6xrxzN2ZcKq8cfBp4KDSI6Dn29QwOg= From: Dmitry Ilvokhin To: Andrew Morton , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, Dmitry Ilvokhin , Steven Rostedt Subject: [PATCH v2 0/8] mm: use spinlock guards for zone lock Date: Fri, 27 Mar 2026 16:14:40 +0000 Message-ID: X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series uses spinlock guard for zone lock 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-stable. Suggested-by: Steven Rostedt v1 -> v2: - Andrew Morton raised concerns about binary size increase in v1. Peter Zijlstra has since fixed the underlying issue in the guards infrastructure in tip [1]. Note: the fix is not yet in mm-stable, so it needs to be applied first to reproduce these results. With that fix, bloat-o-meter on x86 defconfig shows a net decrease of 49 bytes (-0.12%) for page_alloc.o. - Rebased on mm-stable, since the patch this series depended on was dropped from mm-new. - Converted guard(zone_lock_irqsave)(zone) to guard(spinlock_irqsave)(&zone->lock). - Dropped redundant braces in unreserve_highatomic_pageblock() (Steven Rostedt) v1: https://lore.kernel.org/all/cover.1772811429.git.d@ilvokhin.com/ [1]: https://lore.kernel.org/all/20260309164516.GE606826@noisy.programming.kicks-ass.net/ 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() mm/page_alloc.c | 53 ++++++++++++----------------------- mm/page_isolation.c | 67 +++++++++++++++++++-------------------------- 2 files changed, 45 insertions(+), 75 deletions(-) -- 2.52.0