Re: [PATCH] mm: Make some folio and page function arguments const and use bool

From: Matthew Wilcox
Date: Thu Nov 10 2022 - 15:04:11 EST


On Thu, Nov 10, 2022 at 05:29:28PM +0000, David Howells wrote:
> Mark the folio* argument to some of the folio accessor functions as a const
> pointer and similarly make some page* arguments to some page functions
> const.

I think the build bots are going to whinge.

#ifdef CONFIG_DEBUG_VM_PGFLAGS
#define VM_BUG_ON_PGFLAGS(cond, page) VM_BUG_ON_PAGE(cond, page)

#define VM_BUG_ON_PAGE(cond, page) \
do { \
if (unlikely(cond)) { \
dump_page(page, "VM_BUG_ON_PAGE(" __stringify(cond)")");

void dump_page(struct page *page, const char *reason);

I've looked at making dump_page() take a const struct page * in the past,
but it's a lot of work.

Do you really need this or is this a Friday afternoon project?