From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 090902E2DF3; Mon, 2 Mar 2026 22:37:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772491066; cv=none; b=BRwcBNiJ6NAC2+5g0HmY0iVAvNZ6NUKBwRoI9Aah3Ji3K3q4sTFyUzd7Map6/C5I5oXKo8QrtGOB05dJrt+mfHZw9IZ7A/eQ2UBzOv65MHAhx4v8KZXvt8cThS3KbGE2TZhxC+Ba5iVsekYbDBOSJRiXv1Q23s+qdAdqi4HXsZA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772491066; c=relaxed/simple; bh=J2fvo+KSGZvC6JZi3Fa6EZ+t0vgBEn0ictN2fEgWIcU=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=P3ukbVKjuk/Jmkad/43g6aT9Gm/JVWIf79FB5U/dJWlJgS7vg2ehX5WaGnj+65GolNE8MFFqOOXmj7taftXyZ+5nSx/GpwNC6bPXmNhkxSiY1OdlBVvmIa1oYaxBb+hBk6+3iB/jlB/00OdCoQ7yqUfgX3d6oRQr7H5n0XVy68Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=yBQXxcwP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="yBQXxcwP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B69DC19423; Mon, 2 Mar 2026 22:37:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1772491065; bh=J2fvo+KSGZvC6JZi3Fa6EZ+t0vgBEn0ictN2fEgWIcU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=yBQXxcwP9mbl6ewa3zuQ7K4FL6E89jF1hXOOl0UxVT7zm9U4qr5CRzNo3mZRzswbj yFvT9BHNGoT3b7cGE0DsOEcNs/3YzNes9NLszNK31ww6yKE3FQ3EwkyaLa+mMdvC0z Cl0G0MPesho2q6c7fgIFwUb9qBCx5RknJTdxab9g= Date: Mon, 2 Mar 2026 14:37:43 -0800 From: Andrew Morton To: "Vlastimil Babka (SUSE)" Cc: Dmitry Ilvokhin , 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 , "Rafael J. Wysocki" , Pavel Machek , Len Brown , Brendan Jackman , Johannes Weiner , Zi Yan , Oscar Salvador , Qi Zheng , Shakeel Butt , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, linux-pm@vger.kernel.org, "linux-cxl@vger.kernel.orgkernel-team"@meta.com, SeongJae Park Subject: Re: [PATCH v4 4/5] mm: rename zone->lock to zone->_lock Message-Id: <20260302143743.220eed4feb36d7572fe726cc@linux-foundation.org> In-Reply-To: <0f340324-502b-4719-b3e7-c7ccd4378385@kernel.org> References: <0f340324-502b-4719-b3e7-c7ccd4378385@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 2 Mar 2026 15:10:03 +0100 "Vlastimil Babka (SUSE)" wrote: > On 2/27/26 17:00, Dmitry Ilvokhin wrote: > > This intentionally breaks direct users of zone->lock at compile time so > > all call sites are converted to the zone lock wrappers. Without the > > rename, present and future out-of-tree code could continue using > > spin_lock(&zone->lock) and bypass the wrappers and tracing > > infrastructure. > > > > No functional change intended. > > > > Suggested-by: Andrew Morton > > Signed-off-by: Dmitry Ilvokhin > > Acked-by: Shakeel Butt > > Acked-by: SeongJae Park > > I see some more instances of 'zone->lock' in comments in > include/linux/mmzone.h and under Documentation/ but otherwise LGTM. > I fixed (most of) that in the previous version but my fix was lost. include/linux/mmzone.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/include/linux/mmzone.h~mm-rename-zone-lock-to-zone-_lock-fix +++ a/include/linux/mmzone.h @@ -1037,12 +1037,12 @@ struct zone { * Locking rules: * * zone_start_pfn and spanned_pages are protected by span_seqlock. - * It is a seqlock because it has to be read outside of zone->lock, + * It is a seqlock because it has to be read outside of zone_lock, * and it is done in the main allocator path. But, it is written * quite infrequently. * - * The span_seq lock is declared along with zone->lock because it is - * frequently read in proximity to zone->lock. It's good to + * The span_seq lock is declared along with zone_lock because it is + * frequently read in proximity to zone_lock. It's good to * give them a chance of being in the same cacheline. * * Write access to present_pages at runtime should be protected by @@ -1065,7 +1065,7 @@ struct zone { /* * Number of isolated pageblock. It is used to solve incorrect * freepage counting problem due to racy retrieving migratetype - * of pageblock. Protected by zone->lock. + * of pageblock. Protected by zone_lock. */ unsigned long nr_isolate_pageblock; #endif @@ -1502,7 +1502,7 @@ typedef struct pglist_data { * manipulate node_size_lock without checking for CONFIG_MEMORY_HOTPLUG * or CONFIG_DEFERRED_STRUCT_PAGE_INIT. * - * Nests above zone->lock and zone->span_seqlock + * Nests above zone_lock and zone->span_seqlock */ spinlock_t node_size_lock; #endif _