* [PATCH v2] pagevec.h: add `const` to pointer parameters of getter functions
@ 2025-08-28 13:03 Max Kellermann
2025-08-28 13:18 ` Matthew Wilcox
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Max Kellermann @ 2025-08-28 13:03 UTC (permalink / raw)
To: akpm, david, lorenzo.stoakes, linux-mm, linux-kernel; +Cc: Max Kellermann
For improved const-correctness.
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
---
v1->v2: reduced patch to just pagevec.h upon David Hildenbrand's suggestion
---
include/linux/pagevec.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h
index 5d3a0cccc6bf..63be5a451627 100644
--- a/include/linux/pagevec.h
+++ b/include/linux/pagevec.h
@@ -51,12 +51,12 @@ static inline void folio_batch_reinit(struct folio_batch *fbatch)
fbatch->i = 0;
}
-static inline unsigned int folio_batch_count(struct folio_batch *fbatch)
+static inline unsigned int folio_batch_count(const struct folio_batch *fbatch)
{
return fbatch->nr;
}
-static inline unsigned int folio_batch_space(struct folio_batch *fbatch)
+static inline unsigned int folio_batch_space(const struct folio_batch *fbatch)
{
return PAGEVEC_SIZE - fbatch->nr;
}
--
2.47.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] pagevec.h: add `const` to pointer parameters of getter functions
2025-08-28 13:03 [PATCH v2] pagevec.h: add `const` to pointer parameters of getter functions Max Kellermann
@ 2025-08-28 13:18 ` Matthew Wilcox
2025-08-28 13:23 ` Vlastimil Babka
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2025-08-28 13:18 UTC (permalink / raw)
To: Max Kellermann; +Cc: akpm, david, lorenzo.stoakes, linux-mm, linux-kernel
On Thu, Aug 28, 2025 at 03:03:11PM +0200, Max Kellermann wrote:
> For improved const-correctness.
>
> Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
I have a pending patch which constifies compound_order() and page_size()
so you needn't bother with those.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] pagevec.h: add `const` to pointer parameters of getter functions
2025-08-28 13:03 [PATCH v2] pagevec.h: add `const` to pointer parameters of getter functions Max Kellermann
2025-08-28 13:18 ` Matthew Wilcox
@ 2025-08-28 13:23 ` Vlastimil Babka
2025-08-28 14:12 ` Max Kellermann
2025-08-28 13:26 ` Lorenzo Stoakes
2025-08-28 16:10 ` Vishal Moola (Oracle)
3 siblings, 1 reply; 6+ messages in thread
From: Vlastimil Babka @ 2025-08-28 13:23 UTC (permalink / raw)
To: Max Kellermann, akpm, david, lorenzo.stoakes, linux-mm,
linux-kernel
On 8/28/25 15:03, Max Kellermann wrote:
> For improved const-correctness.
>
> Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Note that your Cc list is still not according to MAINTAINERS:
./scripts/get_maintainer.pl -f include/linux/pagevec.h
Andrew Morton <akpm@linux-foundation.org> (maintainer:MEMORY MANAGEMENT - CORE)
David Hildenbrand <david@redhat.com> (maintainer:MEMORY MANAGEMENT - CORE)
Lorenzo Stoakes <lorenzo.stoakes@oracle.com> (reviewer:MEMORY MANAGEMENT - CORE)
"Liam R. Howlett" <Liam.Howlett@oracle.com> (reviewer:MEMORY MANAGEMENT - CORE)
Vlastimil Babka <vbabka@suse.cz> (reviewer:MEMORY MANAGEMENT - CORE)
Mike Rapoport <rppt@kernel.org> (reviewer:MEMORY MANAGEMENT - CORE)
Suren Baghdasaryan <surenb@google.com> (reviewer:MEMORY MANAGEMENT - CORE)
Michal Hocko <mhocko@suse.com> (reviewer:MEMORY MANAGEMENT - CORE)
linux-mm@kvack.org (open list:MEMORY MANAGEMENT - CORE)
linux-kernel@vger.kernel.org (open list)
> ---
> v1->v2: reduced patch to just pagevec.h upon David Hildenbrand's suggestion
Assuming you don't intend to stop here, a series with multiple patches logically
gradually expanding the const scope would be better than sending a single patch?
Thanks,
Vlastimil
> ---
> include/linux/pagevec.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h
> index 5d3a0cccc6bf..63be5a451627 100644
> --- a/include/linux/pagevec.h
> +++ b/include/linux/pagevec.h
> @@ -51,12 +51,12 @@ static inline void folio_batch_reinit(struct folio_batch *fbatch)
> fbatch->i = 0;
> }
>
> -static inline unsigned int folio_batch_count(struct folio_batch *fbatch)
> +static inline unsigned int folio_batch_count(const struct folio_batch *fbatch)
> {
> return fbatch->nr;
> }
>
> -static inline unsigned int folio_batch_space(struct folio_batch *fbatch)
> +static inline unsigned int folio_batch_space(const struct folio_batch *fbatch)
> {
> return PAGEVEC_SIZE - fbatch->nr;
> }
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] pagevec.h: add `const` to pointer parameters of getter functions
2025-08-28 13:03 [PATCH v2] pagevec.h: add `const` to pointer parameters of getter functions Max Kellermann
2025-08-28 13:18 ` Matthew Wilcox
2025-08-28 13:23 ` Vlastimil Babka
@ 2025-08-28 13:26 ` Lorenzo Stoakes
2025-08-28 16:10 ` Vishal Moola (Oracle)
3 siblings, 0 replies; 6+ messages in thread
From: Lorenzo Stoakes @ 2025-08-28 13:26 UTC (permalink / raw)
To: Max Kellermann
Cc: akpm, david, linux-mm, linux-kernel, Michal Hocko,
Suren Baghdasaryan, Mike Rapoport, Vlastimil Babka,
Liam R. Howlett
+cc missing people.
Again, please run scripts/get_maintainers.pl and cc the right people, thanks.
On Thu, Aug 28, 2025 at 03:03:11PM +0200, Max Kellermann wrote:
> For improved const-correctness.
>
> Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
This is fine, so:
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> ---
> v1->v2: reduced patch to just pagevec.h upon David Hildenbrand's suggestion
> ---
> include/linux/pagevec.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h
> index 5d3a0cccc6bf..63be5a451627 100644
> --- a/include/linux/pagevec.h
> +++ b/include/linux/pagevec.h
> @@ -51,12 +51,12 @@ static inline void folio_batch_reinit(struct folio_batch *fbatch)
> fbatch->i = 0;
> }
>
> -static inline unsigned int folio_batch_count(struct folio_batch *fbatch)
> +static inline unsigned int folio_batch_count(const struct folio_batch *fbatch)
> {
> return fbatch->nr;
> }
>
> -static inline unsigned int folio_batch_space(struct folio_batch *fbatch)
> +static inline unsigned int folio_batch_space(const struct folio_batch *fbatch)
> {
> return PAGEVEC_SIZE - fbatch->nr;
> }
> --
> 2.47.2
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] pagevec.h: add `const` to pointer parameters of getter functions
2025-08-28 13:23 ` Vlastimil Babka
@ 2025-08-28 14:12 ` Max Kellermann
0 siblings, 0 replies; 6+ messages in thread
From: Max Kellermann @ 2025-08-28 14:12 UTC (permalink / raw)
To: Vlastimil Babka; +Cc: akpm, david, lorenzo.stoakes, linux-mm, linux-kernel
On Thu, Aug 28, 2025 at 3:23 PM Vlastimil Babka <vbabka@suse.cz> wrote:
> Note that your Cc list is still not according to MAINTAINERS:
I did, but I did this on 6.15... but master has significant additions
to the MAINTAINERS file.
> Assuming you don't intend to stop here, a series with multiple patches logically
> gradually expanding the const scope would be better than sending a single patch?
Yes, but that would mean more work, which I'm certainly willing to do,
but only if I'm confident the patches are going to be accepted. So
this tiny patch is a trial.
In v1, Lorenzo had expressed general objections to merging
const-correctness patches.
I don't want to waste time with something that's going to be rejected
anyway. I've been there so often, so often has there been one guy who
just rejects my work, after similar patches (by others) had been
merged.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] pagevec.h: add `const` to pointer parameters of getter functions
2025-08-28 13:03 [PATCH v2] pagevec.h: add `const` to pointer parameters of getter functions Max Kellermann
` (2 preceding siblings ...)
2025-08-28 13:26 ` Lorenzo Stoakes
@ 2025-08-28 16:10 ` Vishal Moola (Oracle)
3 siblings, 0 replies; 6+ messages in thread
From: Vishal Moola (Oracle) @ 2025-08-28 16:10 UTC (permalink / raw)
To: Max Kellermann; +Cc: akpm, david, lorenzo.stoakes, linux-mm, linux-kernel
On Thu, Aug 28, 2025 at 03:03:11PM +0200, Max Kellermann wrote:
> For improved const-correctness.
>
> Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Reviewed-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-08-28 16:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28 13:03 [PATCH v2] pagevec.h: add `const` to pointer parameters of getter functions Max Kellermann
2025-08-28 13:18 ` Matthew Wilcox
2025-08-28 13:23 ` Vlastimil Babka
2025-08-28 14:12 ` Max Kellermann
2025-08-28 13:26 ` Lorenzo Stoakes
2025-08-28 16:10 ` Vishal Moola (Oracle)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).