Skip to content

Commit

Permalink
mm: make __dump_page static
Browse files Browse the repository at this point in the history
Patch series "Constify struct page arguments".

While working on various solutions to the 32-bit struct page size
regression, one of the problems I found was the networking stack expects
to be able to pass const struct page pointers around, and the mm doesn't
provide a lot of const-friendly functions to call.  The root tangle of
problems is that a lot of functions call VM_BUG_ON_PAGE(), which calls
dump_page(), which calls a lot of functions which don't take a const
struct page (but could be const).

This patch (of 6):

The only caller of __dump_page() now opencodes dump_page(), so remove it
as an externally visible symbol.

Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Reviewed-by: Vlastimil Babka <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Reviewed-by: William Kucharski <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Matthew Wilcox (Oracle) authored and torvalds committed Jun 29, 2021
1 parent b19bd1c commit d2f07ec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions include/linux/mmdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ struct page;
struct vm_area_struct;
struct mm_struct;

extern void dump_page(struct page *page, const char *reason);
extern void __dump_page(struct page *page, const char *reason);
void dump_page(struct page *page, const char *reason);
void dump_vma(const struct vm_area_struct *vma);
void dump_mm(const struct mm_struct *mm);

Expand Down
2 changes: 1 addition & 1 deletion mm/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const struct trace_print_flags vmaflag_names[] = {
{0, NULL}
};

void __dump_page(struct page *page, const char *reason)
static void __dump_page(struct page *page, const char *reason)
{
struct page *head = compound_head(page);
struct address_space *mapping;
Expand Down
3 changes: 1 addition & 2 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,7 @@ static void bad_page(struct page *page, const char *reason)

pr_alert("BUG: Bad page state in process %s pfn:%05lx\n",
current->comm, page_to_pfn(page));
__dump_page(page, reason);
dump_page_owner(page);
dump_page(page, reason);

print_modules();
dump_stack();
Expand Down

0 comments on commit d2f07ec

Please sign in to comment.