[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250312032344.297946-1-liuye@kylinos.cn>
Date: Wed, 12 Mar 2025 11:23:44 +0800
From: Liu Ye <liuye@...inos.cn>
To: akpm@...ux-foundation.org
Cc: linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Liu Ye <liuye@...inos.cn>
Subject: [PATCH v2] mm/debug: Fix minor issues in mm
This patch includes several minor fixes:
- Simplify compound page judgment conditions.
- Missing a newline character at the end of the format string.
Each change is independent.
Signed-off-by: Liu Ye <liuye@...inos.cn>
---
V2 : drop Fix out-of-bounds access in page_type_name().
---
---
mm/debug.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/mm/debug.c b/mm/debug.c
index 8d2acf432385..544b2b05c567 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -132,15 +132,15 @@ static void __dump_page(const struct page *page)
again:
memcpy(&precise, page, sizeof(*page));
head = precise.compound_head;
- if ((head & 1) == 0) {
+ if (head & 1) {
+ foliop = (struct folio *)(head - 1);
+ idx = folio_page_idx(foliop, page);
+ } else {
foliop = (struct folio *)&precise;
idx = 0;
if (!folio_test_large(foliop))
goto dump;
foliop = (struct folio *)page;
- } else {
- foliop = (struct folio *)(head - 1);
- idx = folio_page_idx(foliop, page);
}
if (idx < MAX_FOLIO_NR_PAGES) {
@@ -165,7 +165,7 @@ static void __dump_page(const struct page *page)
void dump_page(const struct page *page, const char *reason)
{
if (PagePoisoned(page))
- pr_warn("page:%p is uninitialized and poisoned", page);
+ pr_warn("page:%p is uninitialized and poisoned\n", page);
else
__dump_page(page);
if (reason)
--
2.25.1
Powered by blists - more mailing lists