Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8763455rwb; Thu, 24 Nov 2022 04:06:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf5fj0+anFDfwjikRyMI0t0j6ioQ8nlEzq8B6LhJ7fUsngZJPT9QfPpCXMpZYZ2k0EQeReCX X-Received: by 2002:a17:906:590e:b0:78d:5176:c4d2 with SMTP id h14-20020a170906590e00b0078d5176c4d2mr27115540ejq.532.1669291569109; Thu, 24 Nov 2022 04:06:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669291569; cv=none; d=google.com; s=arc-20160816; b=oYrkgQsTs+F6Pz9yeDioQ9XdigBjihqRnviUx5rcVmyApqE8MHVChU/ohJ3JHDnoNZ jpF505oSlpYx/guxnwL9k7jf6VjHhe1mTVHDN3ijrQTWpiF/KLjeMYWi5uSFyt9ez3X5 aFF9BU0/HxUVBQRkrCN5LfedEduCxnXkYTgEmTpj8H74VMd/8ZIiOteY9DDUM7y1CtvV uiuKB9IekdpAreQYEC0zkFe1dQCiiR3Ri9bQf+/gt+rMmZq3Z2zApBPxB0MqkkmHyOfS 9D0ICJtGyraZplGoWm7Z6H8W3xHsDJxLFxajadE06RgLLdIaZRTzdFj0NDUEk53JdYhz 9dHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jCd6zgZ9Hqz9sR1Spt/uKXD2LWWaO3T2x6GLxEqyUkg=; b=c+RD/rF0uFLre7WGae2yKD4yZCcpDreTPEbKMOSPFnEhKECcFY1ute0WdAZrSh5sm3 c4rwSqDElYGHijwO/K6Ulyx+LcYh5PdJgV3z+60eyKD5gDqz5QdF8CRDfIAvtJ8KQl+r CQndOo8Tyhhh5BsnHx/Lgy623MeS2gc6TVSmvbj+lUCA5WLWYk076ZtjkiVkYGOGtKCy lEpXTvlnu+O3laP6xnwqASHTrIXJwcSX8smHMa3N30cJmUoRqFn9BJPnlgtADNohTMW7 3IXKBqk/tqKl0gYrZMqIqOM+TBEF6L6/nXImNn9zPMi5fM8Pru2BpGA1owW6E6yD91Aw CELg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aVtcbxcW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ib20-20020a1709072c7400b0079330b37fb6si615360ejc.880.2022.11.24.04.05.48; Thu, 24 Nov 2022 04:06:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aVtcbxcW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230174AbiKXLlG (ORCPT + 86 others); Thu, 24 Nov 2022 06:41:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229731AbiKXLlD (ORCPT ); Thu, 24 Nov 2022 06:41:03 -0500 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4FF96B9F0 for ; Thu, 24 Nov 2022 03:41:02 -0800 (PST) Received: by mail-pf1-x42b.google.com with SMTP id g62so1414079pfb.10 for ; Thu, 24 Nov 2022 03:41:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=jCd6zgZ9Hqz9sR1Spt/uKXD2LWWaO3T2x6GLxEqyUkg=; b=aVtcbxcWGK5RCiec4i5uxxwG6QRkwATKRsEZtp+hNgtD6GKJBJMHXAXgiA4M9kOETk PZSbcC1I+uFxZI7U6tYmA+Ujthmm18YFZlhRFH7Vp77+Ipyuhbv2F/CDofWiu9yeZvdg usz4tJtMQNNpo4yyRcEC8rXBel62a2MIH86Wu5qqFgTa/B+ppw1RmC1wdQwvJWsSim2O RoeLGpgzmFM22+MJ1kj/D24r765zNqlZWuT08zaPCv/lLKAKipm+3OBCQiX3IRN3hqUu loOBXEMKQZWXo/N0E/TuxPcsgUDg/uhhA1jCEdcM3j3w3JQ3NgoSrjAKtpNwV5oy+7L2 p+zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jCd6zgZ9Hqz9sR1Spt/uKXD2LWWaO3T2x6GLxEqyUkg=; b=liBEf6wZEbzZyPiaRddm5cCPw0h6nkajRGwRM3DS0xn9NLslnSODXMnQhARUxdedey L7OoHxM28vaMSCEdstEjkhOgd2KCCPeibbmBOnXnIPrLzYiue65HNsViMLF4kdiLzpUF 1KPKRZnGIHmeN2QlCQdE02UqOg7jI+fhKh+BAuJiU6MwPKchT9HbeyLRAyctExg/0BlK DE005zraT7wfbcpz7pcG2HkofJcCAcAS8IYyydH0ycqFABbm8j4k9c/G1rWtkU9BYyj2 8xvzOD1Yv8p/g25ZaFwPvgvOzjZAVgYeWrDHGjyx7/BKuwY1KBTRGwxt8nrnWWaDqEG6 R5dA== X-Gm-Message-State: ANoB5pnlvvr2EVvuY+2ZydxoCrZZ7ab4XqUMCZ2gEYL2ocgxcmpa5mek HYCUUY21xH0XItuY/QhmxN4= X-Received: by 2002:a63:fc49:0:b0:476:941a:8582 with SMTP id r9-20020a63fc49000000b00476941a8582mr11276389pgk.321.1669290062175; Thu, 24 Nov 2022 03:41:02 -0800 (PST) Received: from hyeyoo ([114.29.91.56]) by smtp.gmail.com with ESMTPSA id u11-20020a17090341cb00b00186b55e3cd6sm1098576ple.133.2022.11.24.03.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 03:41:01 -0800 (PST) Date: Thu, 24 Nov 2022 20:40:55 +0900 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Vlastimil Babka Cc: Christoph Lameter , David Rientjes , Joonsoo Kim , Pekka Enberg , Roman Gushchin , Andrew Morton , Linus Torvalds , Matthew Wilcox , patches@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 05/12] mm, slub: lower the default slub_max_order with CONFIG_SLUB_TINY Message-ID: References: <20221121171202.22080-1-vbabka@suse.cz> <20221121171202.22080-6-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221121171202.22080-6-vbabka@suse.cz> X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 21, 2022 at 06:11:55PM +0100, Vlastimil Babka wrote: > With CONFIG_SLUB_TINY we want to minimize memory overhead. By lowering > the default slub_max_order we can make slab allocations use smaller > pages. However depending on object sizes, order-0 might not be the best > due to increased fragmentation. When testing on a 8MB RAM k210 system by > Damien Le Moal [1], slub_max_order=1 had the best results, so use that > as the default for CONFIG_SLUB_TINY. > > [1] https://lore.kernel.org/all/6a1883c4-4c3f-545a-90e8-2cd805bcf4ae@opensource.wdc.com/ > > Signed-off-by: Vlastimil Babka > --- > mm/slub.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/slub.c b/mm/slub.c > index 917b79278bad..bf726dd00f7d 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -3888,7 +3888,8 @@ EXPORT_SYMBOL(kmem_cache_alloc_bulk); > * take the list_lock. > */ > static unsigned int slub_min_order; > -static unsigned int slub_max_order = PAGE_ALLOC_COSTLY_ORDER; > +static unsigned int slub_max_order = > + IS_ENABLED(CONFIG_SLUB_TINY) ? 1 : PAGE_ALLOC_COSTLY_ORDER; > static unsigned int slub_min_objects; > > /* > -- > 2.38.1 > Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> -- Thanks, Hyeonggon