diff mbox

[1/3] powerpc: numa: Set a smaller value for RECLAIM_DISTANCE to enable zone reclaim

Message ID 20100517061956.GE13509@kryten (mailing list archive)
State Accepted, archived
Commit 56608209d34b8add40af54031d4e420afbcde9f6
Delegated to: Benjamin Herrenschmidt
Headers show

Commit Message

Anton Blanchard May 17, 2010, 6:19 a.m. UTC
I noticed /proc/sys/vm/zone_reclaim_mode was 0 on a ppc64 NUMA box. It gets
enabled via this:

        /*
         * If another node is sufficiently far away then it is better
         * to reclaim pages in a zone before going off node.
         */
        if (distance > RECLAIM_DISTANCE)
                zone_reclaim_mode = 1;

Since we use the default value of 20 for REMOTE_DISTANCE and 20 for
RECLAIM_DISTANCE it never kicks in.

The local to remote bandwidth ratios can be quite large on System p
machines so it makes sense for us to reclaim clean pagecache locally before
going off node.

The patch below sets a smaller value for RECLAIM_DISTANCE and thus enables
zone reclaim.

Signed-off-by: Anton Blanchard <anton@samba.org>
---
diff mbox

Patch

Index: powerpc.git/arch/powerpc/include/asm/topology.h
===================================================================
--- powerpc.git.orig/arch/powerpc/include/asm/topology.h	2010-05-17 12:56:02.000000000 +1000
+++ powerpc.git/arch/powerpc/include/asm/topology.h	2010-05-17 15:01:37.514703571 +1000
@@ -18,6 +18,16 @@  struct device_node;
  */
 #define RECLAIM_DISTANCE 10
 
+/*
+ * Before going off node we want the VM to try and reclaim from the local
+ * node. It does this if the remote distance is larger than RECLAIM_DISTANCE.
+ * With the default REMOTE_DISTANCE of 20 and the default RECLAIM_DISTANCE of
+ * 20, we never reclaim and go off node straight away.
+ *
+ * To fix this we choose a smaller value of RECLAIM_DISTANCE.
+ */
+#define RECLAIM_DISTANCE 10
+
 #include <asm/mmzone.h>
 
 static inline int cpu_to_node(int cpu)