From mboxrd@z Thu Jan 1 00:00:00 1970 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 3C22E3A4538 for ; Wed, 29 Apr 2026 12:02:34 +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=1777464155; cv=none; b=DgL77Cx4NFhnxgKZTKoTciygnxCj5iJ2zCW8ZbFcB/148UelwW28n5jGb284EZXP6oj1PN5Ab67gGr+uE1w0fIOK7pLnHRnuAawaTBlVS6RZmI615GyQ405hplv57HUFb4XoWmrbBnbaWIbJbKIMc3v/X6q9X4HH7B9zkJC6RJ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777464155; c=relaxed/simple; bh=Zs+PL83oNv9HKZFQ6YURArRRCcesSnvNCVPwTDtGH2Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b3s+VJbIC2XtmhO2kaVJsqqys6ao4YSK4IhRzrU3ccPrjnaj/tDWAbIbwn8U4API8UbnBwZf3GCjsFe38GPtZ8cfuY7zuiirSY7Yah5TJzNHDvdbkR16mxjdi8Vblw1Xcjrp49XoeWWOWlHpJR5XDnKb9Ju6ni2h2eMoqjm/J3g= 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=OxcwZUNT; 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="OxcwZUNT" Received: from localhost.localdomain (shell.ilvokhin.com [138.68.190.75]) (Authenticated sender: d@ilvokhin.com) by mail.ilvokhin.com (Postfix) with ESMTPSA id B70E0C7A80; Wed, 29 Apr 2026 12:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilvokhin.com; s=mail; t=1777464146; bh=Twsn80r9MVJjFSVO/LrkxIQo9g3SRn97RPzcuSp3ljU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OxcwZUNThGf9of/51uzvrJuCoHDFTXqLQGk1tOuVjzRSwSJADfPZS6QzSKivX0AlF BcSozBnEnpNhad9j21v2zZNvdA9wIA6/cFMo6byu51s7zIYB1CKx2CvS11r3rGZw57 S6r4ajuoxfTHgPYypleG1+Rj9A3aVZqO87MahRhQ= From: Dmitry Ilvokhin To: Andrew Morton , Vlastimil Babka , 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 v3 2/8] mm: use zone lock guard in unset_migratetype_isolate() Date: Wed, 29 Apr 2026 12:02:07 +0000 Message-ID: <815c0905ea77828ed32bf56ff0a6d3c6548eb3a2.1777462630.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: 8bit Use spinlock_irqsave zone 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 Acked-by: Michal Hocko --- 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 c48ff5c00244..9d606052dd80 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -223,15 +223,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 = false; unsigned int order; struct page *buddy; zone = page_zone(page); - spin_lock_irqsave(&zone->lock, flags); + guard(spinlock_irqsave)(&zone->lock); if (!is_migrate_isolate_page(page)) - goto out; + return; /* * Because freepage with more than pageblock_order on isolated @@ -279,8 +278,6 @@ static void unset_migratetype_isolate(struct page *page) __putback_isolated_page(page, order, get_pageblock_migratetype(page)); } zone->nr_isolate_pageblock--; -out: - spin_unlock_irqrestore(&zone->lock, flags); } static inline struct page * -- 2.52.0