From ba7a56cac8135f645b98bd9b7340c1ee492c6770 Mon Sep 17 00:00:00 2001 From: Zhang Yanmin Date: Thu, 12 Feb 2009 18:00:17 +0200 Subject: [PATCH] --- yaml --- r: 135880 b: refs/heads/master c: e8120ff1ffc51102ead1f4c98a3fd5d26fefc722 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/slub.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 8c69a02b3daf..c142d0d96aca 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 51735a7ca67531267a27b57e5fe20f7815192f9c +refs/heads/master: e8120ff1ffc51102ead1f4c98a3fd5d26fefc722 diff --git a/trunk/mm/slub.c b/trunk/mm/slub.c index 5a5e7f5bf799..c01a7a3001d2 100644 --- a/trunk/mm/slub.c +++ b/trunk/mm/slub.c @@ -1844,6 +1844,7 @@ static inline int calculate_order(int size) int order; int min_objects; int fraction; + int max_objects; /* * Attempt to find best configuration for a slab. This @@ -1856,6 +1857,9 @@ static inline int calculate_order(int size) min_objects = slub_min_objects; if (!min_objects) min_objects = 4 * (fls(nr_cpu_ids) + 1); + max_objects = (PAGE_SIZE << slub_max_order)/size; + min_objects = min(min_objects, max_objects); + while (min_objects > 1) { fraction = 16; while (fraction >= 4) { @@ -1865,7 +1869,7 @@ static inline int calculate_order(int size) return order; fraction /= 2; } - min_objects /= 2; + min_objects --; } /*