On 2020-07-09 13:21, Matthew Wilcox (Oracle) wrote:
Simplify both the implementation and the output by splitting all the
compound page information onto a second line.
Reported-by: John Hubbard <jhubbard@xxxxxxxxxx>
Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
---
mm/debug.c | 30 ++++++++++++------------------
1 file changed, 12 insertions(+), 18 deletions(-)
Yes, looks good and is working nicely for me, too.
Reviewed-by: John Hubbard <jhubbard@xxxxxxxxxx>
thanks,
--
John Hubbard
NVIDIA
diff --git a/mm/debug.c b/mm/debug.c
index e5de63406b59..f35c1ae1a7a5 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -89,27 +89,21 @@ void __dump_page(struct page *page, const char *reason)
*/
mapcount = PageSlab(head) ? 0 : page_mapcount(page);
- if (compound)
+ pr_warn("page:%px refcount:%d mapcount:%d mapping:%p index:%#lx\n",
+ page, page_ref_count(head), mapcount, mapping,
+ page_to_pgoff(page));
+ if (compound) {
if (hpage_pincount_available(page)) {
- pr_warn("page:%px refcount:%d mapcount:%d mapping:%p "
- "index:%#lx head:%px order:%u "
- "compound_mapcount:%d compound_pincount:%d\n",
- page, page_ref_count(head), mapcount,
- mapping, page_to_pgoff(page), head,
- compound_order(head), compound_mapcount(page),
- compound_pincount(page));
+ pr_warn("head:%px order:%u compound_mapcount:%d compound_pincount:%d\n",
+ head, compound_order(head),
+ compound_mapcount(head),
+ compound_pincount(head));
} else {
- pr_warn("page:%px refcount:%d mapcount:%d mapping:%p "
- "index:%#lx head:%px order:%u "
- "compound_mapcount:%d\n",
- page, page_ref_count(head), mapcount,
- mapping, page_to_pgoff(page), head,
- compound_order(head), compound_mapcount(page));
+ pr_warn("head:%px order:%u compound_mapcount:%d\n",
+ head, compound_order(head),
+ compound_mapcount(head));
}
- else
- pr_warn("page:%px refcount:%d mapcount:%d mapping:%p index:%#lx\n",
- page, page_ref_count(page), mapcount,
- mapping, page_to_pgoff(page));
+ }
if (PageKsm(page))
type = "ksm ";
else if (PageAnon(page))