Skip to content

Commit

Permalink
slab: rename slab_break_gfp_order to slab_max_order
Browse files Browse the repository at this point in the history
slab_break_gfp_order is more appropriately named slab_max_order since it
enforces the maximum order size of slabs as long as a single object will
still fit.

Also rename BREAK_GFP_ORDER_{LO,HI} accordingly.

Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
  • Loading branch information
David Rientjes authored and Pekka Enberg committed Nov 10, 2011
1 parent 1ea6b8f commit 543585c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@ EXPORT_SYMBOL(slab_buffer_size);
/*
* Do not go above this order unless 0 objects fit into the slab.
*/
#define BREAK_GFP_ORDER_HI 1
#define BREAK_GFP_ORDER_LO 0
static int slab_break_gfp_order = BREAK_GFP_ORDER_LO;
#define SLAB_MAX_ORDER_HI 1
#define SLAB_MAX_ORDER_LO 0
static int slab_max_order = SLAB_MAX_ORDER_LO;

/*
* Functions for storing/retrieving the cachep and or slab from the page
Expand Down Expand Up @@ -1502,7 +1502,7 @@ void __init kmem_cache_init(void)
* page orders on machines with more than 32MB of memory.
*/
if (totalram_pages > (32 << 20) >> PAGE_SHIFT)
slab_break_gfp_order = BREAK_GFP_ORDER_HI;
slab_max_order = SLAB_MAX_ORDER_HI;

/* Bootstrap is tricky, because several objects are allocated
* from caches that do not exist yet:
Expand Down Expand Up @@ -2112,7 +2112,7 @@ static size_t calculate_slab_order(struct kmem_cache *cachep,
* Large number of objects is good, but very large slabs are
* currently bad for the gfp()s.
*/
if (gfporder >= slab_break_gfp_order)
if (gfporder >= slab_max_order)
break;

/*
Expand Down

0 comments on commit 543585c

Please sign in to comment.