* [PATCH] mm/vmscan: print err before panic
@ 2023-09-06 8:37 Angus Chen
0 siblings, 0 replies; only message in thread
From: Angus Chen @ 2023-09-06 8:37 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel, Angus Chen
If panic is enable,the err information will not be printed before bugon,
So swap it.
Print the return value of PTR_ERR(pgdat->kswapd) also.
Signed-off-by: Angus Chen <angus.chen@jaguarmicro.com>
---
mm/vmscan.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 6f13394b112e..0436f0ed9671 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -7892,8 +7892,9 @@ void __meminit kswapd_run(int nid)
pgdat->kswapd = kthread_run(kswapd, pgdat, "kswapd%d", nid);
if (IS_ERR(pgdat->kswapd)) {
/* failure at boot is fatal */
+ pr_err("Failed to start kswapd on node %d,ret=%ld\n",
+ nid, PTR_ERR(pgdat->kswapd));
BUG_ON(system_state < SYSTEM_RUNNING);
- pr_err("Failed to start kswapd on node %d\n", nid);
pgdat->kswapd = NULL;
}
}
--
2.25.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-09-06 8:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-06 8:37 [PATCH] mm/vmscan: print err before panic Angus Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox