[RHEL7,COMMIT] ms/mm/slub: set slub_max_order = 0 by default.

Submitted by Konstantin Khorenko on Jan. 10, 2019, 2:16 p.m.


Message ID 201901101416.x0AEGOgZ004875@finist-ce7.sw.ru
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko Jan. 10, 2019, 2:16 p.m.
The commit is pushed to "branch-rh7-3.10.0-957.1.3.vz7.83.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.1.3.vz7.83.4
commit f0c8fb51e5266ef44d9a421f88bd956cc8b79221
Author: Andrey Ryabinin <aryabinin@virtuozzo.com>
Date:   Thu Jan 10 17:16:24 2019 +0300

    ms/mm/slub: set slub_max_order = 0 by default.
    Setting slub_max_order to 0 makes slub to use minimum possible
    order for slub page.
     - Less fragmentation of slab objects in slab pages -> less slab
        consumption. E.g. on dvd-store test on machine with 256G this
         saves us ~3G.
     - Potentially faster in high memory fragmentation cases (we don't attempt
        to allocate higher-than-necessary-order page).
     - Potentially slower if higher-order page available in the system
        (less __alloc_pages() calls).
     - May increase memory waste for kmem_caches of certain size
        (e.g. with 1025-byte objects we waste 1022 bytes per 4096 bytes if
        slub order is zero. But with slub order 3 and 1025-byte objects
        we waste only 993-bytes per 32768 bytes => 124 bytes per 4096)
    According to dvd-store test pros of this change is outweigh the cons.
    Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
 mm/slub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/mm/slub.c b/mm/slub.c
index e7dd99b09681..cfed91b0fdb8 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3029,7 +3029,7 @@  EXPORT_SYMBOL(kmem_cache_alloc_bulk);
  * take the list_lock.
 static int slub_min_order;
-static int slub_max_order = PAGE_ALLOC_COSTLY_ORDER;
+static int slub_max_order;
 static int slub_min_objects;