From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1D903CD4F52 for ; Mon, 18 May 2026 10:24:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A4EC6B008C; Mon, 18 May 2026 06:24:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77D026B0092; Mon, 18 May 2026 06:24:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BA656B0093; Mon, 18 May 2026 06:24:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 5A30F6B008C for ; Mon, 18 May 2026 06:24:32 -0400 (EDT) Received: from smtpin23.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0609D14091B for ; Mon, 18 May 2026 10:24:32 +0000 (UTC) X-FDA: 84780156384.23.0F5477E Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf12.hostedemail.com (Postfix) with ESMTP id 49F7B40002 for ; Mon, 18 May 2026 10:24:30 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pSv2y11n; spf=pass (imf12.hostedemail.com: domain of ljs@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=ljs@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1779099870; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3fx+ePPNuEYAGsCItD9weYpWAlNiZqA721iNmo/gjnY=; b=PIqR174ffiEKSMGu15AjmVcnkRulYSQYnWiv7lizg6tTD3r2G8wPHCaa+JllHFAjVZERl2 dMmiazNDy9jsnHv+Y6QaxNrRuFWkphczykmmA+muxoVF2Ew3JOXdj5/lJDwRoUbanQ5jQ7 FUfTBtiGzquQtwOSJn5f2MKnWWQLGfg= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pSv2y11n; spf=pass (imf12.hostedemail.com: domain of ljs@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=ljs@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1779099870; a=rsa-sha256; cv=none; b=XuqbwY/VdHYre+dm0lr82ejyDFFWo3Lreq2YS0pVm+CrwWuyX0Adfu7AoE6wLcSMtN6nFm wSKAIYp8U5OrP81NygvE6zIbpu1wKBaT2mm8KRd5hbSDTb9KQf7ZsDiW2gWFnF7FkbpHQd /QEHi5HnXpsLa6CUZonsTSMw+jXhV88= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 1A16A43CDD; Mon, 18 May 2026 10:24:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E56A7C2BCB7; Mon, 18 May 2026 10:24:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1779099869; bh=6Y5stbvQWHXLcA7XjV23eIeFyPchwtbQV2KWt9Ea000=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pSv2y11nGB9K2eENajyD7rPgFnLZs4LLW/VdcTdSMcaj+qLfHahfeHz9JYVwSvyt1 R/ywJTAJv+PAlXbwsEEo28us5H4IyGKs+aPOhFNoo+EH/zcKJLRUMc7DYQmwn5exzj ZYW2VRhLwdoJ9AXAz6xCYXbNhks8bU1AlM6bJRc1WY0yfM7YimdLQ2gvNilYuxZm0/ a7W850FWlz87m18MFFFgew5f9Hu8avQSaNQgsziBIf8KxgKV2+2immEyR/NhtGNzvx e/k0AXGqAnVw4bhzUEowPYMzz34cXIx2EinWcFA7JKh3uN9dF4HW890zaQDX3JAA9u MkA6antazQf4A== Date: Mon, 18 May 2026 11:24:23 +0100 From: Lorenzo Stoakes To: Thorsten Blum Cc: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260517123428.1181981-5-thorsten.blum@linux.dev> X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 49F7B40002 X-Rspam-User: X-Stat-Signature: of18gfz64uo7suojfbuerasmq4wfrti1 X-HE-Tag: 1779099870-975088 X-HE-Meta: U2FsdGVkX1/EEwXWJIYywDygNZaGAWlOLFEArpzsnCNNohGU9eQQVl7LzM3E6aaHGirvvR3IMtwccuskXLpPCc/KQ9wlGiFQZaGtHjVcoRNATeaLHM2PGDJbi6WnQUx1SKau0sO/fVL0I/sjQ7BLkJIkI5iFy2JaFisVIq3PR5VLA1YZ1B+EFPw37o/LPA7xUmE2u9Us+h2mlAn87HgcidG70l8sTcJGF8AlJOt1pkamP9pzDmm7uUwuvoJKG05ZWMnqItKUYbTdEh3vo5zwVU3xG8+8BrchNs54a/1eaobK63HO87jXVRecdjJ1YShqynEASWRaH5zxe3FLc3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ulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Why is this a separate commit? It's tiny, I don't think it needs to be separated at all. 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. This is a totally useless commit message. Again you're not indicating why it's needed. Please look around mm to get a sense of how commit messages should look. Also it's so common that you have exactly zero callers updated here or elsewhere? I see uses which are all pretty specific. I wonder if it's really useful to make this its own thing? And it's untyped and etc. etc. yeah, it's a no really to this. > > Suggested-by: Andy Shevchenko Was there a previous discussion that led to this series? You should really give some background somewhere (like a cover letter, and if previous revisions were sent, a history of them below the ---) > Signed-off-by: Thorsten Blum Again I'm really unconvinced you need to do any of this. > --- > 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) I mean another thing about this (and yes this was existing but since you're proposing making this rather special it's worth raising) is that it's enormously un-typesafe and 'p' is vague, what if somebody put a (struct page *) here? It'd be better if it was a static inline function, maybe there's places which use this already that require it to be a macro but perhaps not. > +#define bytes_to_page_end(p) (PAGE_SIZE - offset_in_page(p)) Here, since, you're adding it, there's no excuse at all for it being a macro. And you're implementing something just as horribly vague as the other form, it's not obvious 'p' is meant to be a pointer. Page begins with p too :) Anyway I'm not really convinced this is useful. > > #endif /* _LINUX_PAGE_HELPERS_H */ Thanks, Lorenzo