From nobody Tue Apr 7 18:46:38 2026 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 A17B835A383; Thu, 26 Feb 2026 18:26:56 +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=1772130417; cv=none; b=JLDhMhZ58Q+cLXkrzTyXFgjgtfLA32aLsCNnsigs2Pj5/bAQG2MHWBQAByLgVzuqWgAHU4yVFq+BYOK/UJxLQKqh7pOjoqjsNSzIjd0qHEtZ7cHWt5RjmhhPMRWDrlbnjRSGuhvKMX5b/SvgAmS9KOFprV1c3OZYelp6emc2MJE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772130417; c=relaxed/simple; bh=yU9vCeRMDcqXp7tsGW4gPYfDua5ipd7nY3ulJWyAZNE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QW9OjUKdMV8fCFKPrx2lIyiKIrANAG6spAri16UCSsT6g28YmOPF0AWGaSMx+FYfG4R+uPf2su/QfTjd3q6Q4zPxCqAVGS0kN+0dXgIFHixJLhrENFPXLbKAltu2XXopZZNPmUdo9NOYJ0dUWVgimjWQQmCvq89mhlXgViYdv48= 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=kK/UaSYO; 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="kK/UaSYO" Received: from localhost.localdomain (shell.ilvokhin.com [138.68.190.75]) (Authenticated sender: d@ilvokhin.com) by mail.ilvokhin.com (Postfix) with ESMTPSA id 9421EB2CDA; Thu, 26 Feb 2026 18:26:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilvokhin.com; s=mail; t=1772130414; bh=zgqMM8R7TMKjzolsktMoOqd00HunAyLpj6pvpo7Z8tY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kK/UaSYOcu1t+smdLydMAUj8pFB1/KTNJYMF0ZEAsHJX3ZLxzzVoS3ZgiABRAb4dB TkmWnuJeYqJib81Wwyzo58ccwWjHpGS/yJSvkPtuJmkcZefr+drvChjwg+zWsI5tjn DOMzvUuNYrdQEXEIQkBANZRFxbgQF+R6jVTBNr+k= From: Dmitry Ilvokhin To: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Axel Rasmussen , Yuanchu Xie , Wei Xu , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Brendan Jackman , Johannes Weiner , Zi Yan , Oscar Salvador , Qi Zheng , Shakeel Butt Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, linux-cxl@vger.kernel.org, kernel-team@meta.com, Benjamin Cheatham , Dmitry Ilvokhin Subject: [PATCH v3 1/5] mm: introduce zone lock wrappers Date: Thu, 26 Feb 2026 18:26:18 +0000 Message-ID: <5bcc39cd3a227944d0fbe75ff86cdac92b38d4ca.1772129168.git.d@ilvokhin.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add thin wrappers around zone lock acquire/release operations. This prepares the code for future tracepoint instrumentation without modifying individual call sites. Centralizing zone lock operations behind wrappers allows future instrumentation or debugging hooks to be added without touching all users. No functional change intended. The wrappers are introduced in preparation for subsequent patches and are not yet used. Signed-off-by: Dmitry Ilvokhin Acked-by: Shakeel Butt --- MAINTAINERS | 1 + include/linux/zone_lock.h | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 include/linux/zone_lock.h diff --git a/MAINTAINERS b/MAINTAINERS index 55af015174a5..61e3d1f5bf43 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16680,6 +16680,7 @@ F: include/linux/pgtable.h F: include/linux/ptdump.h F: include/linux/vmpressure.h F: include/linux/vmstat.h +F: include/linux/zone_lock.h F: kernel/fork.c F: mm/Kconfig F: mm/debug.c diff --git a/include/linux/zone_lock.h b/include/linux/zone_lock.h new file mode 100644 index 000000000000..c531e26280e6 --- /dev/null +++ b/include/linux/zone_lock.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_ZONE_LOCK_H +#define _LINUX_ZONE_LOCK_H + +#include +#include + +static inline void zone_lock_init(struct zone *zone) +{ + spin_lock_init(&zone->lock); +} + +#define zone_lock_irqsave(zone, flags) \ +do { \ + spin_lock_irqsave(&(zone)->lock, flags); \ +} while (0) + +#define zone_trylock_irqsave(zone, flags) \ +({ \ + spin_trylock_irqsave(&(zone)->lock, flags); \ +}) + +static inline void zone_unlock_irqrestore(struct zone *zone, unsigned long= flags) +{ + spin_unlock_irqrestore(&zone->lock, flags); +} + +static inline void zone_lock_irq(struct zone *zone) +{ + spin_lock_irq(&zone->lock); +} + +static inline void zone_unlock_irq(struct zone *zone) +{ + spin_unlock_irq(&zone->lock); +} + +#endif /* _LINUX_ZONE_LOCK_H */ --=20 2.47.3