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 E7853327BFA for ; Wed, 8 Apr 2026 13:33:46 +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=1775655228; cv=none; b=jZ/jfujOJRpcbUmWea4d78DrNQLLuaA3IC9DJ3e2JGlvTYSmHgCOtA0CY8UsIp6KLS5acmydFZ7rsNwUmtmVQ2JhdT6eUAA6zQ/aJTbmIawj8/v97bvzSY2sLF2UGd/Ylf9IF+cfkUABf+iPecS8wp4hU02y5dWx9zKx5n3oxAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775655228; c=relaxed/simple; bh=l+YzA9hNjmXL9xVtURK/zXyTfC2OME24qpma5l9majk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NLpC4npObSj/u6JjsMe5s840uKKOBt7+VZpolwP5WbDcmBM315FxbBfFDr+FEkVYYufbYTBAbLsBYELWeqbSGk/E+Aw/C033MhVknG6Wr+FOhcAacftl5Y7bzOjygU0fhv4gTZz4dw11NJnFbIS2JVuwktva65WFlHAK1QVDeo8= 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=Byro1AdR; 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="Byro1AdR" Received: from localhost.localdomain (shell.ilvokhin.com [138.68.190.75]) (Authenticated sender: d@ilvokhin.com) by mail.ilvokhin.com (Postfix) with ESMTPSA id 254D6BE713; Wed, 08 Apr 2026 13:33:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilvokhin.com; s=mail; t=1775655219; bh=B7DEJ5+heQ7onPG4SiPavDH/m9STlxrOJvRAAYFCZmk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Byro1AdRFmhHNV2ta5mXvcd4QswA/3naGRANsHBhr1wQ28PT8pgLRn035Guuocetb j/svy96Ds3qH6v5rOeF5US4scV2Lovh/Bm4MVhW1hm0CNf8Ckjbx8VF++lezc/nDyw 1c0GRLkhoFbRK3O2fmavL0//C2Y028YHmGIiyb60= 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: [RESEND PATCH v2 2/8] mm: use zone lock guard in unset_migratetype_isolate() Date: Wed, 8 Apr 2026 13:33:17 +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: 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 --- 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