Thread (6 messages) 6 messages, 3 authors, 2016-07-05

Re: [RFC RESEND PATCH] swap: choose swap device according to numa node

From: Aaron Lu <hidden>
Date: 2016-07-05 06:22:27
Also in: lkml

On Tue, Jul 05, 2016 at 01:57:35PM +0800, Yu Chen wrote:
On Tue, Jul 5, 2016 at 11:19 AM, Aaron Lu [off-list ref] wrote:
quoted
Resend:
This is a resend, the original patch doesn't catch much attention.
It may not be a big deal for swap devices that used to be hosted on
HDD but with devices like 3D Xpoint to be used as swap device, it could
make a real difference if we consider NUMA information when doing IO.
Comments are appreciated, thanks for your time.
-------------------------%<-------------------------
quoted
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 71b1c29948db..dd7e44a315b0 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -3659,9 +3659,11 @@ void kswapd_stop(int nid)

 static int __init kswapd_init(void)
 {
-       int nid;
+       int nid, err;

-       swap_setup();
+       err = swap_setup();
+       if (err)
+               return err;
        for_each_node_state(nid, N_MEMORY)
                kswapd_run(nid);
        hotcpu_notifier(cpu_callback, 0);
In original implementation, although swap_setup failed,
In current implementaion swap_setup never fail :-)
the swapd would also be created, since swapd is
not only  used for swap out but also for other page reclaim,
so this change above might modify its semantic? Sorry if
I understand incorrectly.
Indeed it's a behaviour change. The only reason swap_setup can return an
error code now is when it fails to allocate nr_node_ids * sizeof(struct
plist_head) memory and if that happens, I don't think it makes much
sense to continue boot the system.

Thanks,
Aaron

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help