]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - mm/slub.c
slub: Calculate min_objects based on number of processors.
[linux-2.6-omap-h63xx.git] / mm / slub.c
index 6572cef0c43c7660f1e26b5b448a548fd59ee615..e2e6ba7a5172ea93c588089f14b59db14ab8a890 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1803,7 +1803,7 @@ static struct page *get_object_page(const void *x)
  */
 static int slub_min_order;
 static int slub_max_order = PAGE_ALLOC_COSTLY_ORDER;
-static int slub_min_objects = 4;
+static int slub_min_objects;
 
 /*
  * Merge control. If this is set then no merging of slab caches will occur.
@@ -1880,6 +1880,8 @@ static inline int calculate_order(int size)
         * we reduce the minimum objects required in a slab.
         */
        min_objects = slub_min_objects;
+       if (!min_objects)
+               min_objects = 4 * (fls(nr_cpu_ids) + 1);
        while (min_objects > 1) {
                fraction = 8;
                while (fraction >= 4) {