Re: [PATCH v3 1/5] mm: introduce zone lock wrappers
From: SeongJae Park
Date: Thu Feb 26 2026 - 19:39:03 EST
I should sent this together with the previous reply, but I forgot as usual,
sorry.
On Thu, 26 Feb 2026 18:26:18 +0000 Dmitry Ilvokhin <d@xxxxxxxxxxxx> wrote:
> 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 <d@xxxxxxxxxxxx>
> Acked-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
> ---
[...]
> --- /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 <linux/mmzone.h>
> +#include <linux/spinlock.h>
> +
> +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)
checkpatch.pl complains as below. Should be ok to ignore, but, may better to
kindly make it silence?
WARNING: Single statement macros should not use a do {} while (0) loop
#116: FILE: include/linux/zone_lock.h:13:
+#define zone_lock_irqsave(zone, flags) \
+do { \
+ spin_lock_irqsave(&(zone)->lock, flags); \
+} while (0)
Thanks,
SJ
[...]