From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 80C61757EA for ; Thu, 25 Jun 2026 00:20:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782346827; cv=none; b=Ao6Hg37PTuy1C9UHW9axpR9YT76LVr3Cno74fsSzLIlUtf7Y1bdNAf8JXGfzlrIM3Snb7mHAziEp70tTnX8eEhdFZ17+zp5esXOmUkSikmWz3biupWG0dSzkMdn5tppglemd0PAtfQKg0StcfSbEtYa6utOIgjhvTVegH4FVTRc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782346827; c=relaxed/simple; bh=OZMN18bplrFBM+YAdXBY4E69DtQzvvm/UNCe1X7IhRw=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=cTkiuIivLoyemhGo6VY9KL8JcKgZ5M/MLVGy+qTOd+FcNceZi94cSBMqTFIRh3vD0d4PX2gD8TSPTPXT2+na88BtM85xuGcZkuAmLYzUz2mq2/V/WSjkUzLcjU/K0UdknACMJdQvPLANWUT626pCJB5koeX61YGrDdhR4nsUrZ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=JkzVG/Si; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="JkzVG/Si" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4DD61F000E9; Thu, 25 Jun 2026 00:20:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1782346826; bh=ec86U2KYfVPXD0aDv/YEnMaPQl4HFcBkPI8cCMgcWNw=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=JkzVG/SiTfTwQpcZ3j5jeMPHGHyISjbX7lUpSd3X37ddUBqdEb8nrkSgAlBhtHFFP Jp31Is2+MkNtnbxtjf/KQmAsO/PtbLKFFJoKcllAPb+vXCjYkKj5u2lOeIO1B+4jOC xurncsVybWurH6HY/R7vzp7Goc7ywjUHnpXx7QsU= Date: Wed, 24 Jun 2026 17:20:25 -0700 From: Andrew Morton To: Ye Liu Cc: Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/6] mm/page_owner: extract skip_buddy_pages() helper to unify buddy page skipping Message-Id: <20260624172025.3087e8d574285bfa8d6772e3@linux-foundation.org> In-Reply-To: <20260623065234.31866-2-ye.liu@linux.dev> References: <20260623065234.31866-1-ye.liu@linux.dev> <20260623065234.31866-2-ye.liu@linux.dev> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 23 Jun 2026 14:52:26 +0800 Ye Liu wrote: > Three places in page_owner.c duplicate the same pattern: check if a > page is PageBuddy, read its order via buddy_order_unsafe(), advance > the pfn past the buddy block if the order is valid, and continue. > > Consolidate them into a single inline helper skip_buddy_pages(). > The function returns true (skip) for any buddy page and advances > @pfn past the block when the order is valid; returns false if the > page is not a buddy page and should be processed normally. > > The old init_pages_in_zone() variant used "order > 0" as an extra > guard before advancing pfn, but the continue was unconditional and > (1UL << 0) - 1 == 0, so the behaviour is identical. The comment > about zone->lock is preserved in the helper's kernel-doc. All looks nice, thanks. A [0/N] cover letter is nice to have. AI review identified a few possible pre-existing issues, if you're interested: https://sashiko.dev/#/patchset/20260623065234.31866-2-ye.liu@linux.dev