Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8764806rwb; Thu, 24 Nov 2022 04:07:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf4IVVqRGHFnvdcy0Wteu1QBYC7JzMDZnfXunF9uyLHZ+na3QBmPlUJKbYdrHMDknhUzeMz1 X-Received: by 2002:a05:6402:538e:b0:468:ea55:ab40 with SMTP id ew14-20020a056402538e00b00468ea55ab40mr12290250edb.323.1669291619743; Thu, 24 Nov 2022 04:06:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669291619; cv=none; d=google.com; s=arc-20160816; b=MgRKkzoB59YFRQEymCHMmlztyqPk3/weifqT3kTGwAAB8F8ovWaItcLhmO39Juh6ET 6zESNozJOwJZL2MpOwuekCOmO1RAZqYtrzDp2GJczUTMchhm3HBEn/8oIw58E3TWLJZ9 QKJjsyd0na02mWYn02V2Fophw/ZylrOnElphFtuxTCeXbxNefJPJlxaWq0owSM+NvMEL UL6Md7ULCO6sS8DDUVf+5NLwEOBuf1g5NxgcOtd3vfdRYn6KLEnmT1PvstGjJ1vo782/ Oai8XRtUVGSqdunLpobnYmJz+3RrKhjmXIDotm5vu0KteaD9GP5Mi2HBoJo/W8+NNsRJ s0qg== 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=+5EcPqvErNguuUSXQjM4Gsm5NRO9cAbvO2IWMkYz6pI=; b=SVhOWx13/gHSnI+Y6uiINvbLHhMwwjAuIzGrtQK/TvqKV8l5m5tylasb9bWEnErbW4 kXfOnj5E9idU5klOEY0gzBN5+V0g+Dv2kB0xAjqjQWT9DOzyw82qRehLiZPbaNP16Cga g8RudUp8dboMIneDlGAXTZhtBpRI6cE6/hsfpyCwX79Y+82Zt9kuldNtroE1/VpJDsk0 mBXQ+koShFiw/w2DKNFIRjYUfFTPyhMKqBzxKwDF1AsS//U2OBinQEUWzYL0gI+FBvpD AHC6XS7XckTcdxz8gVlUcTTb2uNbLNO5USnAVVzQvIio8Z0INDgdFLC024H+SWTbyCrA HL3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SOJw3pGm; 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 mp26-20020a1709071b1a00b007429f0c69ccsi786741ejc.579.2022.11.24.04.06.36; Thu, 24 Nov 2022 04:06:59 -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=SOJw3pGm; 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 S230179AbiKXLjH (ORCPT + 86 others); Thu, 24 Nov 2022 06:39:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229686AbiKXLjF (ORCPT ); Thu, 24 Nov 2022 06:39:05 -0500 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E25AA4876A for ; Thu, 24 Nov 2022 03:39:02 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id 136so1376809pga.1 for ; Thu, 24 Nov 2022 03:39: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=+5EcPqvErNguuUSXQjM4Gsm5NRO9cAbvO2IWMkYz6pI=; b=SOJw3pGmknQGOs+cKA4lwYKRAW23GcKLpXI9bEcqXWNIZQmj6qZgdaeAgW05Rnk5dc WhjgRoHta5X4f1roJmi0k+NF6085ffRp8wWbmxxYvuOoIjK9sr5+LvgZzdqjfMl6yIg+ Xf8hDCmBAfcJ209YFFw0LR09iN2AQ+/+2K4/BuHnK7hymbqFRZa3aCGBW+KbAGkgX8Ir 7TYe9cW84y2OSlc6te7WF3uPvtw/VwhP5V+eJ1+34SQ12F9m5BlSCk24SXS/howNODnc 5pUXdgbG4YKP8ViGGHEvYP69ji6BO1ElS1MW+4CXwbAxFUxPUpVdRmQiSzEjQn+UuitS sxsw== 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=+5EcPqvErNguuUSXQjM4Gsm5NRO9cAbvO2IWMkYz6pI=; b=Ko0MOyGGBu0kQNZ+1KnY119AGhzaXwmNkh22uy20s355EPaTmPV/s8eIaATTs61AJo yaK0AEQPmhbFTgmYjD9yt2VCc68Yo/mwi46bRi9eyBv+yWktbRK6kvaj5nG19w04TZpV P5oi3nEtXI0CrSKEn540I1ON+BxkisrAnuSaO66dVpcpQgo2h9CWKkWF3bLmrdMlbqFx 8cudvWk/uKDTNu3YCxSm+Of9u9hirZyfnq23pDUqq+AN5XpgpBqTOIYau9d8cv8xJVnd zopdX5krIdet4DqZXRySX/QD/YzbSf62qyB35Czuz5vHQG7RfvY1jWnmZYRsaBMjTflk GZdQ== X-Gm-Message-State: ANoB5pkdiPn8ejiRyID79pr+TiQ9yBHYPU+XDsMt7ljp9TdPIg5fBPis Z20R77/DtZjEV7eC54FGlOoQ2QFZkt7IL+VU X-Received: by 2002:a62:6083:0:b0:56d:3180:c7fc with SMTP id u125-20020a626083000000b0056d3180c7fcmr16238203pfb.41.1669289942391; Thu, 24 Nov 2022 03:39:02 -0800 (PST) Received: from hyeyoo ([114.29.91.56]) by smtp.gmail.com with ESMTPSA id f15-20020a170902684f00b00177e5d83d3esm1098955pln.88.2022.11.24.03.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 03:39:01 -0800 (PST) Date: Thu, 24 Nov 2022 20:38: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 04/12] mm, slub: retain no free slabs on partial list with CONFIG_SLUB_TINY Message-ID: References: <20221121171202.22080-1-vbabka@suse.cz> <20221121171202.22080-5-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221121171202.22080-5-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:54PM +0100, Vlastimil Babka wrote: > SLUB will leave a number of slabs on the partial list even if they are > empty, to avoid some slab freeing and reallocation. The goal of > CONFIG_SLUB_TINY is to minimize memory overhead, so set the limits to 0 > for immediate slab page freeing. > > Signed-off-by: Vlastimil Babka > --- > mm/slub.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/mm/slub.c b/mm/slub.c > index ab085aa2f1f0..917b79278bad 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -241,6 +241,7 @@ static inline bool kmem_cache_has_cpu_partial(struct kmem_cache *s) > /* Enable to log cmpxchg failures */ > #undef SLUB_DEBUG_CMPXCHG > > +#ifndef CONFIG_SLUB_TINY > /* > * Minimum number of partial slabs. These will be left on the partial > * lists even if they are empty. kmem_cache_shrink may reclaim them. > @@ -253,6 +254,10 @@ static inline bool kmem_cache_has_cpu_partial(struct kmem_cache *s) > * sort the partial list by the number of objects in use. > */ > #define MAX_PARTIAL 10 > +#else > +#define MIN_PARTIAL 0 > +#define MAX_PARTIAL 0 > +#endif > > #define DEBUG_DEFAULT_FLAGS (SLAB_CONSISTENCY_CHECKS | SLAB_RED_ZONE | \ > SLAB_POISON | SLAB_STORE_USER) > -- > 2.38.1 > Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> -- Thanks, Hyeonggon