From nobody Thu Apr 9 18:03:01 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 8CD3D3E8C6C 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=1772813188; cv=none; b=Wj96PnyntoC9LPgsvzonxPlBg6XfoosK8VHgcivg1kVEzxtyDBOdxpqOlP/xV2oZJndBkg2KoBtBgaOCiMkahVCQKIBgc4RBlsunhiajr8clnbzWwVrS8rO8maQsNkWPOD6VwdlHnb1q3PrpTL3tJF4/VZi2RcDLpPvy89phbKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772813188; c=relaxed/simple; bh=oDXQFELYtTTSZtjXt2IVARr4zqwQK1N33MMTWi17kd8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LtKcijXFRuf2PSWWg9YgaAWvqi7jwjnYYQqZ4nBiFPi5AHKacB0hN1k5TkKni8SpO6arzv20zWsleakfOZrC1Fn1php/iYfkhsoP7ZOGU+tSggl5nadYMQbnwiG09bc+m5agUTfskFPz+tYMA271reQcTPGpgA4Dweoqj40ytgg= 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=BpySMpVw; 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="BpySMpVw" Received: from localhost.localdomain (shell.ilvokhin.com [138.68.190.75]) (Authenticated sender: d@ilvokhin.com) by mail.ilvokhin.com (Postfix) with ESMTPSA id B32F9B343E; 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=1772813184; bh=5MNMr1IHoVTzBoiG5P1ta/i/aMAz7SlmBpjrvkTxTqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BpySMpVwFeY9+TCd+MZC+3/XwNvGqnwn/V5SiPGg2iQQblqmuGnAxUuZexkBhPlEr uLZEY8pqaLVhfws1wtEkeCwPaX8//6ZwcG+jtHxUBtTwE6MTnvcC5YVRrfxhUC+/1D dsKMpl7qUm/I5MJOwJ6KIMNtFSs8x+KgpdBLO5kg= 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 2/8] mm: use zone lock guard in unset_migratetype_isolate() Date: Fri, 6 Mar 2026 16:05:36 +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 unset_migratetype_isolate() to replace the explicit lock/unlock and goto pattern with automatic scope-based cleanup. Suggested-by: Steven Rostedt Signed-off-by: Dmitry Ilvokhin --- mm/page_isolation.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index e8414e9a718a..dc1e18124228 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -224,15 +224,14 @@ static int set_migratetype_isolate(struct page *page,= enum pb_isolate_mode mode, static void unset_migratetype_isolate(struct page *page) { struct zone *zone; - unsigned long flags; bool isolated_page =3D false; unsigned int order; struct page *buddy; =20 zone =3D page_zone(page); - zone_lock_irqsave(zone, flags); + guard(zone_lock_irqsave)(zone); if (!is_migrate_isolate_page(page)) - goto out; + return; =20 /* * Because freepage with more than pageblock_order on isolated @@ -280,8 +279,6 @@ static void unset_migratetype_isolate(struct page *page) __putback_isolated_page(page, order, get_pageblock_migratetype(page)); } zone->nr_isolate_pageblock--; -out: - zone_unlock_irqrestore(zone, flags); } =20 static inline struct page * --=20 2.47.3