Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm/vmscan: fix error number for failed kthread

Fix the return value while failing to create the kswapd kernel thread.
Also, the error message is prioritized as KERN_ERR.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Gavin Shan and committed by
Linus Torvalds
d5dc0ad9 e0f3c3f7

+2 -2
+2 -2
mm/vmscan.c
··· 3126 3126 if (IS_ERR(pgdat->kswapd)) { 3127 3127 /* failure at boot is fatal */ 3128 3128 BUG_ON(system_state == SYSTEM_BOOTING); 3129 - printk("Failed to start kswapd on node %d\n",nid); 3130 3129 pgdat->kswapd = NULL; 3131 - ret = -1; 3130 + pr_err("Failed to start kswapd on node %d\n", nid); 3131 + ret = PTR_ERR(pgdat->kswapd); 3132 3132 } 3133 3133 return ret; 3134 3134 }