Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <ljs@kernel.org>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	 David Hildenbrand <david@kernel.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	 Vlastimil Babka <vbabka@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	 Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	 Yury Norov <yury.norov@gmail.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	 Andy Shevchenko <andriy.shevchenko@intel.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/3] mm: move offset_in_page() to page_helpers.h
Date: Mon, 18 May 2026 11:02:10 +0100	[thread overview]
Message-ID: <agrgWscr26Kj5yk0@lucifer> (raw)
In-Reply-To: <20260517123428.1181981-4-thorsten.blum@linux.dev>

Seriously, please resend this.

This is 3 patches with 2 in-reply-to 1/3, that's not how we do series in mm,
take a look around :)

Write a cover letter, and have all the patches in-reply-to that.

Was there not previous versions of this? I _seem_ to remember that, but might be
misremembering :)

Also I'm really questioning the value of this, you've not sold why we should
take this whatsoever.

'Add a random new header file we have to maintain because it's smaller' is not
really hugely compelling.

Also a _lot_ of stuff in the kernel ultimately pulls in mm.h. So what exactly
has the specific requirement of both needing this define and (somehow) doesn't
use mm?

On Sun, May 17, 2026 at 02:34:29PM +0200, Thorsten Blum wrote:
> Move offset_in_page() out of linux/mm.h so users that only need page
> offset calculations can include this lightweight header instead of
> pulling in all of linux/mm.h.

What's the motivation? What caused you to want to do this? Why should we have a
new tiny header with only this define? What makes that important?

Why is pulling in a 'big' header file such an issue?

This commit message is pretty useless right now, you're just saying what you're
doing, yeah I can see that from the diff.

You should use the commit message to explain why and what for etc.

>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  include/linux/mm.h           |  2 +-
>  include/linux/page_helpers.h | 10 ++++++++++

You've added a new file and not updated MAINTAINERS, nor indicated that it will
be caught by a glob?

Also super super restrictive to have 'page helpers', that's likely to be tiny
forever, why not just move this macro to mm_types.h and import that instead?
It's highly likely it's already imported wherever you need it, anyway.

>  2 files changed, 11 insertions(+), 1 deletion(-)
>  create mode 100644 include/linux/page_helpers.h
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index af23453e9dbd..bf49e52f749a 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -17,6 +17,7 @@
>  #include <linux/mm_types.h>
>  #include <linux/mmap_lock.h>
>  #include <linux/range.h>
> +#include <linux/page_helpers.h>
>  #include <linux/pfn.h>
>  #include <linux/percpu-refcount.h>
>  #include <linux/bit_spinlock.h>
> @@ -3033,7 +3034,6 @@ static inline void clear_page_pfmemalloc(struct page *page)
>   */
>  extern void pagefault_out_of_memory(void);
>
> -#define offset_in_page(p)	((unsigned long)(p) & ~PAGE_MASK)
>  #define offset_in_folio(folio, p) ((unsigned long)(p) & (folio_size(folio) - 1))
>
>  /*
> diff --git a/include/linux/page_helpers.h b/include/linux/page_helpers.h
> new file mode 100644
> index 000000000000..102a4f3c3868
> --- /dev/null
> +++ b/include/linux/page_helpers.h
> @@ -0,0 +1,10 @@
> +/* SPDX-License-Identifier: GPL-2.0 */

No description of what this is for?

> +
> +#ifndef _LINUX_PAGE_HELPERS_H
> +#define _LINUX_PAGE_HELPERS_H
> +
> +#include <asm/page.h>
> +
> +#define offset_in_page(p)	((unsigned long)(p) & ~PAGE_MASK)

Why are you only porting the page version when ostensibly folios are more likely
to be the unit-of-operation in future?

> +
> +#endif /* _LINUX_PAGE_HELPERS_H */

Thanks, Lorenzo


      parent reply	other threads:[~2026-05-18 10:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-17 12:34 [PATCH 1/3] mm: move offset_in_page() to page_helpers.h Thorsten Blum
2026-05-17 12:34 ` [PATCH 2/3] mm: add bytes_to_page_end() helper Thorsten Blum
2026-05-17 15:28   ` Yury Norov
2026-05-18  6:48     ` Andy Shevchenko
2026-05-18 10:23       ` Lorenzo Stoakes
2026-05-18 11:33         ` William Kucharski
2026-05-18 11:53         ` William Kucharski
2026-05-18  9:09     ` David Laight
2026-05-18 10:24       ` Lorenzo Stoakes
2026-05-18  6:49   ` Andy Shevchenko
2026-05-18 10:24   ` Lorenzo Stoakes
2026-05-17 12:34 ` [PATCH 3/3] lib/bitmap: use " Thorsten Blum
2026-05-18 10:33   ` Lorenzo Stoakes
2026-05-18  6:51 ` [PATCH 1/3] mm: move offset_in_page() to page_helpers.h Andy Shevchenko
2026-05-18 10:02 ` Lorenzo Stoakes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=agrgWscr26Kj5yk0@lucifer \
    --to=ljs@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=david@kernel.org \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=thorsten.blum@linux.dev \
    --cc=vbabka@kernel.org \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox