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

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jan 10 17:16:25 MSK 2019


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 at 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.
    
    Pros:
     - 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).
    
    Cons:
     - 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.
    
    https://jira.sw.ru/browse/PSBM-83199
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 mm/slub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 
 /*



More information about the Devel mailing list