Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135880
b: refs/heads/master
c: e8120ff
h: refs/heads/master
v: v3
  • Loading branch information
Zhang Yanmin authored and Pekka Enberg committed Feb 20, 2009
1 parent fab1ff7 commit ba7a56c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 51735a7ca67531267a27b57e5fe20f7815192f9c
refs/heads/master: e8120ff1ffc51102ead1f4c98a3fd5d26fefc722
6 changes: 5 additions & 1 deletion trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand All @@ -1865,7 +1869,7 @@ static inline int calculate_order(int size)
return order;
fraction /= 2;
}
min_objects /= 2;
min_objects --;
}

/*
Expand Down

0 comments on commit ba7a56c

Please sign in to comment.