From nobody Thu Apr 9 19:25:18 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 DD93D3E95B0 for ; Fri, 6 Mar 2026 16:06:26 +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=1772813189; cv=none; b=GIakBaStvdbxpFi9LirSshbR5dYXGIPaYiYq+gIVpRHJO/RTCXXt4ZqMfqTnZ6h/YvXWwoH+IHJAkFJCqirjQ6Ln7HAyD5/qdqQarEtihQtUFbBvNXkpHRZ3qrO5O7eW+Neg2+YnOIfFBu4t/naunXfLqqt07cdRLfdR7YMogfg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772813189; c=relaxed/simple; bh=QMtdn+L9pd4/KB2h1GrkWpa6okvj0X3jqHDIh+iGlSU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ey1/UFWNit5lZMyFB4S/YMg0oAWp8dds5jWZfo6KwN2YqpkuSWMJnN2SDTTYh49OMQ/i5tHF2Op4brZjaeOlgkH1gNk/kxip06sY+nxu/gm/QJQcwQz+lSseRHbhAhPuHH0goWxnWb2HRz+Gden3TGEs8LRjJB0cSQXtbP8hHeY= 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=um+dgqwq; 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="um+dgqwq" Received: from localhost.localdomain (shell.ilvokhin.com [138.68.190.75]) (Authenticated sender: d@ilvokhin.com) by mail.ilvokhin.com (Postfix) with ESMTPSA id 01E31B3441; Fri, 06 Mar 2026 16:06:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilvokhin.com; s=mail; t=1772813185; bh=xmQ9hgnSXzc8ICiALHSxS12/8YYk8LAoyAkwViY9f/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=um+dgqwqwu+LOmxoH8jJjbUK5QsR6oD/Q8owfus/MFUmLPoQvDHx10/773Tr+Ir7Z newCPiFftX7QukoybePCW3/XhauRad935KKymZgcdNSeqoYULRIJYBblBOQUcxg2G3 2vQJgyXcKoAGEqwuAp7EYootQejw9kF1m4nPQRvk= From: Dmitry Ilvokhin To: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , 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 3/8] mm: use zone lock guard in unreserve_highatomic_pageblock() Date: Fri, 6 Mar 2026 16:05:37 +0000 Message-ID: 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" Use zone_lock_irqsave lock guard in unreserve_highatomic_pageblock() to replace the explicit lock/unlock pattern with automatic scope-based cleanup. Suggested-by: Steven Rostedt Signed-off-by: Dmitry Ilvokhin --- mm/page_alloc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 260fb003822a..2857daf6ebfd 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3456,7 +3456,6 @@ static bool unreserve_highatomic_pageblock(const stru= ct alloc_context *ac, bool force) { struct zonelist *zonelist =3D ac->zonelist; - unsigned long flags; struct zoneref *z; struct zone *zone; struct page *page; @@ -3473,7 +3472,7 @@ static bool unreserve_highatomic_pageblock(const stru= ct alloc_context *ac, pageblock_nr_pages) continue; =20 - zone_lock_irqsave(zone, flags); + guard(zone_lock_irqsave)(zone); for (order =3D 0; order < NR_PAGE_ORDERS; order++) { struct free_area *area =3D &(zone->free_area[order]); unsigned long size; @@ -3521,11 +3520,9 @@ static bool unreserve_highatomic_pageblock(const str= uct alloc_context *ac, */ WARN_ON_ONCE(ret =3D=3D -1); if (ret > 0) { - zone_unlock_irqrestore(zone, flags); return ret; } } - zone_unlock_irqrestore(zone, flags); } =20 return false; --=20 2.47.3