From: Christoph Lameter Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton --- mm/slub.c | 6 ++++++ 1 files changed, 6 insertions(+) diff -puN mm/slub.c~slub-core-add-explanation-for-defrag_ratio-=-100 mm/slub.c --- a/mm/slub.c~slub-core-add-explanation-for-defrag_ratio-=-100 +++ a/mm/slub.c @@ -937,6 +937,12 @@ static struct page *get_any_partial(stru * * A higher ratio means slabs may be taken from other nodes * thus reducing the number of partial slabs on those nodes. + * + * If /sys/slab/xx/defrag_ratio is set to 100 (which makes + * defrag_ratio = 1000) then every (well almost) allocation + * will first attempt to defrag slab caches on other nodes. This + * means scanning over all nodes to look for partial slabs which + * may be a bit expensive to do on every slab allocation. */ if (!s->defrag_ratio || get_cycles() % 1024 > s->defrag_ratio) return NULL; _