Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4597384rwb; Mon, 21 Nov 2022 09:26:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf5xo9bcHwAT/+4jqBBXNcUBMGXP7lFEZFiI0iUT1BPTfv6nEpS5NGpyGxga9A4JTkTAeyhQ X-Received: by 2002:a17:90a:e2c2:b0:218:825e:17f8 with SMTP id fr2-20020a17090ae2c200b00218825e17f8mr17704586pjb.129.1669051589415; Mon, 21 Nov 2022 09:26:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669051589; cv=none; d=google.com; s=arc-20160816; b=I+CxDvxG1jMiEjpZtnQbsoHtpfEysFE0ertB5JAKnVWWw5r2YnmSPvkoEiLeyEbls3 6Z9L0a6J8JGoybirsfS/yM7Q8sxTijgnJA9g0cXV1YstXm5kPRyUWMOaOpI7SksGaX7P 3wJhCkSl0C7VTvcwPJZH9h1CGGr3bAtnDzrCPcahBXt5/ulf+1qpEN5D9uBadUNfijm5 OzUbJTxt1kCu1dqJId+UPsC8fb/zPOWC92OfWijXK4ZkSM84XgcBXJnpo8hKuCwUgJGt MMA695TwAsWd3Lvxy9L0O0jo07v62CHXKgZgaPEilQeZl+d1NfV3ERoct1Zp+Gus2p51 MbzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=AE6b9Ip1Jv26Xwgek6onVQxbl/nnvniL1XqPDrcyQQ0=; b=nMxufUz8sZUsfg9I+7Cy3PmhTeZQtMZCTZ4aiCeYeloxbhX01kxzd5HlR8wVJAdZKS 0u1loHrI+N8773MTYV7th48tZdNzVGrz5eNv1J/uMm7Dpo5D+xtHgsIBN7qMDMrVknKh keL0m3CIv78it05Ivw0RzTC/Q6gnuRgcYS0hulBpWNRPge1hO4N8njLJzHGN4yvXXLq4 fY3UYP5K9MNo3TnKoxNfdBk1dMu2IFk82qBepGUzcUIhoRaw5h9dmUsraHqiHYcvWiFr Sp/iNkhX+cPrlzJrkJo34SrbtB8Ws3eRuOe4xL/tH8FvYhQUiYA0RasyyR4cHVzFUTQz j/fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="1/VTn6d3"; dkim=neutral (no key) header.i=@suse.cz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f21-20020a17090a4a9500b002186ca32904si9748952pjh.94.2022.11.21.09.26.17; Mon, 21 Nov 2022 09:26:29 -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=@suse.cz header.s=susede2_rsa header.b="1/VTn6d3"; dkim=neutral (no key) header.i=@suse.cz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230484AbiKURM2 (ORCPT + 91 others); Mon, 21 Nov 2022 12:12:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230441AbiKURMP (ORCPT ); Mon, 21 Nov 2022 12:12:15 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8437DCEFDE for ; Mon, 21 Nov 2022 09:12:12 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 46D35220D3; Mon, 21 Nov 2022 17:12:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1669050731; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AE6b9Ip1Jv26Xwgek6onVQxbl/nnvniL1XqPDrcyQQ0=; b=1/VTn6d3nJ/r68CevB7e+wCDMbxnR2MTtiL6t4eG83n1/xPF5FDa5TmLbvbToZhzqKsJsG l1H1iDYpN0lQy3MhKDXrvHx79gVP4a2M9w5yso/OsBylq5lk7y6JIffE9GuiS/e/MVuRij 9KhvvDaOCrn9Ol6Lx7067yqcmG2QFS0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1669050731; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AE6b9Ip1Jv26Xwgek6onVQxbl/nnvniL1XqPDrcyQQ0=; b=bBKuH2Y7eX+L9HTCPMnlLbK53G+n/K2K3+rWDVILDjbkeZm8pOwpFzT1RXpbmwxlkx6vMn KbqVlik0Z4wWhlBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1AB361377F; Mon, 21 Nov 2022 17:12:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EJ7dBWuxe2MQeQAAMHmgww (envelope-from ); Mon, 21 Nov 2022 17:12:11 +0000 From: Vlastimil Babka To: Christoph Lameter , David Rientjes , Joonsoo Kim , Pekka Enberg Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Roman Gushchin , Andrew Morton , Linus Torvalds , Matthew Wilcox , patches@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Vlastimil Babka Subject: [PATCH 04/12] mm, slub: retain no free slabs on partial list with CONFIG_SLUB_TINY Date: Mon, 21 Nov 2022 18:11:54 +0100 Message-Id: <20221121171202.22080-5-vbabka@suse.cz> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221121171202.22080-1-vbabka@suse.cz> References: <20221121171202.22080-1-vbabka@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=ham 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 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