[PATCH] memory page_alloc zonelist caching speedup
[firefly-linux-kernel-4.4.55.git] / mm / mempolicy.c
index 617fb31086eef17d45f5b04df65ff3a851a7a19c..fb907236bbd82fad7140f2c9ffdb12d7624715c0 100644 (file)
@@ -141,9 +141,11 @@ static struct zonelist *bind_zonelist(nodemask_t *nodes)
        enum zone_type k;
 
        max = 1 + MAX_NR_ZONES * nodes_weight(*nodes);
+       max++;                  /* space for zlcache_ptr (see mmzone.h) */
        zl = kmalloc(sizeof(struct zone *) * max, GFP_KERNEL);
        if (!zl)
                return NULL;
+       zl->zlcache_ptr = NULL;
        num = 0;
        /* First put in the highest zones from all nodes, then all the next 
           lower zones etc. Avoid empty zones because the memory allocator