From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 63F2E342CBA for ; Mon, 18 May 2026 10:25:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779099901; cv=none; b=Ukp+XnKqAgvkYQ9481PYM7R2+0gYy5XEWZam0BfcA1CSal0V/rQUid3D1U+OgmsaSYVT0iOKIhOFhIPRJhVwG1rot53PATk4DRposLpcxkfczYK1UEm2v+ZLOnseMb2c7eB5QAmPvWw2CeWx7Py6Ve+8K8rt8PqLtyFQUiXfz/8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779099901; c=relaxed/simple; bh=j7mf6Kdf6l70/4pk/tyJ3bKlLlrcFLC7yjtQUp3i91Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XFa0FlD5/K5MbMT60Mujb7AeBF3jm2DDfhsQUnFshROgnOLhsN+bZ9Jt9SZYRxK0OwHVfA3G1fg8VYAyRLwLFptiaSWFN5768jwdSy+SbjmSvCIsQfEH+0hKlcB3E8TNDIDVyckmsVKsSCst+zxGnb5YLzPTJxN/hm8oZ5Ykx7Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QL40FalZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QL40FalZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD4ADC2BCB7; Mon, 18 May 2026 10:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1779099901; bh=j7mf6Kdf6l70/4pk/tyJ3bKlLlrcFLC7yjtQUp3i91Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QL40FalZLXr4lz3Y73LUyCmjBdkdQEJ35L07VupPwwLQ2B+hSZQnxgOI8BSqO9bBg 5Bcm5lQdGAEnQ21+86M1VBVrCuzmetIYnR61ef0QY0u7J9BnaZ0YllvjGOG0lY4xZj NaUii0rtNKjv8HLHPxk0U/GeC9/7UXGgBslpuLCblq2qSkJUTxp9AsnBbX26Z0hR+1 3yEuvmJxXd/cQoTYLRTPV/gg/gz2duZKXeB3D1ROPfyJhOnVlahAk2ubtqJ9bqG24U UpnTUPnhoKZWxchJZmxsU4EKuG/XxPGTbJavDDCrnzfgnzau2ctHnWXnp4Jo16hAP3 adckkSFaijWMw== Date: Mon, 18 May 2026 11:24:55 +0100 From: Lorenzo Stoakes To: David Laight Cc: Yury Norov , Thorsten Blum , Andrew Morton , David Hildenbrand , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Yury Norov , Rasmus Villemoes , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 2/3] mm: add bytes_to_page_end() helper Message-ID: References: <20260517123428.1181981-4-thorsten.blum@linux.dev> <20260517123428.1181981-5-thorsten.blum@linux.dev> <20260518100933.6bfe5b8f@pumpkin> 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-Disposition: inline In-Reply-To: <20260518100933.6bfe5b8f@pumpkin> On Mon, May 18, 2026 at 10:09:33AM +0100, David Laight wrote: > On Sun, 17 May 2026 11:28:05 -0400 > Yury Norov wrote: > > > On Sun, May 17, 2026 at 02:34:30PM +0200, Thorsten Blum wrote: > > > Add bytes_to_page_end() for the common PAGE_SIZE - offset_in_page() > > > calculation. > > > > > > Suggested-by: Andy Shevchenko > > > Signed-off-by: Thorsten Blum > > > --- > > > include/linux/page_helpers.h | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/include/linux/page_helpers.h b/include/linux/page_helpers.h > > > index 102a4f3c3868..981731faa1fc 100644 > > > --- a/include/linux/page_helpers.h > > > +++ b/include/linux/page_helpers.h > > > @@ -6,5 +6,6 @@ > > > #include > > > > > > #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) > > > +#define bytes_to_page_end(p) (PAGE_SIZE - offset_in_page(p)) > > > > > > #endif /* _LINUX_PAGE_HELPERS_H */ > > > > I've got a series for this > > > > https://lore.kernel.org/all/20260303182845.250bb2de@kernel.org/ > > > > The feedback is surprisingly negative. Please add people from that > > thread. Maybe you'll be more successful convincing them. > > I don't think you need a another new header. > There is already vdso/page.h which is where PAGE_MASK comes from. Yeah please don't, that's already a weird situation I don't really love the idea of extending that. mm_types.h seems the more appropriate place. > > -- David > > > > > Thanks, > > Yury > > > Thanks, Lorenzo