From nobody Sat Apr 11 10:48:03 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 84BEF3ED126 for ; Fri, 6 Mar 2026 16:06:29 +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=1772813192; cv=none; b=NqhTipnYTLKIBmtbhvVpIQ0n4VCjQYxo0J1H8F/LgJisi0y1rpA7a3gcgey/cImnkczz6lfyZWP2mjVqyCmVQh0VIr3Rt0qCNGGXLdNevPbbvDlnjZZ2wkO+6Dhxtw0YsH3eMKECMWVPkBe7NTPKapbLvSBDtAGe7VnuMVXy1j4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772813192; c=relaxed/simple; bh=HGhyqHP+XMjKSEx3m75UzkzHSFAXc+6z0q6/AFl1Enk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NS6mszbK+BIhPAT48D1nlYu0eg4/IsMWW1/73PotlxzXQAwKHF7syDQMNnVdvE+EBojUYTRplgbcAH/B7lbgriveaMCvmmWQv/Ov/DeR0yGELAiAUbrj4d8tQrKWdz7mbfgGysSwxt5gUst/l9KPuTmWpl9tq9iUJYcmb78wffU= 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=vTrENs8w; 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="vTrENs8w" Received: from localhost.localdomain (shell.ilvokhin.com [138.68.190.75]) (Authenticated sender: d@ilvokhin.com) by mail.ilvokhin.com (Postfix) with ESMTPSA id 1BF0FB3450; Fri, 06 Mar 2026 16:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilvokhin.com; s=mail; t=1772813186; bh=LDE9sNwpvCyHqDBgmu8oAPHRFTOTnIBx1S/VGmZEjBI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=vTrENs8w9kXRwhEVqSh1zTjuDl4Cj/Lj3M9bIixdpG6mDhxBorXg/9Q58IGyVlYsn kzlzgs21Ol9eIA3Tq+uXIOl2z/9uKHU3mm+8cSjAuU5utPa299/oRc1QxlpkG5SX5/ rhuulyKbGbbS/UvCwwjBCvUzDC1mfcd0llmJ19Cc= 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 7/8] mm: use zone lock guard in free_pcppages_bulk() Date: Fri, 6 Mar 2026 16:05:41 +0000 Message-ID: <15d66e640ad30edea62247e7bcd98ebde05be0ff.1772811429.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: quoted-printable Content-Type: text/plain; charset="utf-8" Use zone_lock_irqsave lock guard in free_pcppages_bulk() 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 28b06baa4075..2759e02340fa 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1455,7 +1455,6 @@ static void free_pcppages_bulk(struct zone *zone, int= count, struct per_cpu_pages *pcp, int pindex) { - unsigned long flags; unsigned int order; struct page *page; =20 @@ -1468,7 +1467,7 @@ static void free_pcppages_bulk(struct zone *zone, int= count, /* Ensure requested pindex is drained first. */ pindex =3D pindex - 1; =20 - zone_lock_irqsave(zone, flags); + guard(zone_lock_irqsave)(zone); =20 while (count > 0) { struct list_head *list; @@ -1500,8 +1499,6 @@ static void free_pcppages_bulk(struct zone *zone, int= count, trace_mm_page_pcpu_drain(page, order, mt); } while (count > 0 && !list_empty(list)); } - - zone_unlock_irqrestore(zone, flags); } =20 /* Split a multi-block free page into its individual pageblocks. */ --=20 2.47.3