Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp148723lqe; Thu, 4 Apr 2024 02:27:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWYQ+V9LupSF7kaLsgxZCQe0szJH80+NDEZnlmGdRcjoGpWSNyao4qYGsjALICAhoH64i0n0s1ahomNLGQr3N+MNvOzY0aIlgXJxeN6FA== X-Google-Smtp-Source: AGHT+IHTfrNwW6fFmrpP2r+U/I2lUOWSI+aNQZ6jfbG6+jFOLRQ5d6pt0uKKM8Rq0hT2l08A67lD X-Received: by 2002:a05:6214:20e6:b0:699:1ece:9def with SMTP id 6-20020a05621420e600b006991ece9defmr2954124qvk.22.1712222821450; Thu, 04 Apr 2024 02:27:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712222821; cv=pass; d=google.com; s=arc-20160816; b=CRsV186jmlT3MhefAug1c0LnlEKRvxntDkSwZ5iyvsc7IExkG/zLxBCbDuLJAcpUgh K8flcR6SgTXIv0a+qm2cvs8cNrrfTVuGmQFgF2vwL1NgYswRqK24dgPfH92qZq4DtSsC X7ZkqIkTl4izlY7aWz7vO7kTZIUbcVL27s5IQtwEknyP+ZP1tkji3xJCcMo3+uEc/olC +kPQnv4DPcBUj7FaqMvcYbZy8vSY+DVRd3ApUt4EiXo41S3BUAfiOfDvxAVtx2PmGvka 4JWokZrX4JgEdg7YghVCIuZv33U8Y5bNzBSYBlJ+z4QP4YmmC2VV7wV5R1FqzcoHWBcw GEGQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature:dkim-signature; bh=K718IVs++aefO+JflhqPFBhOVoNtCDSYrTOiw2Ex8WA=; fh=MS6UY0Ie8OklUyI/Nq0PzyaL2G0XzHmBCHrUo51Lf3c=; b=JV2Bvwp6jAIzlW4qJeZG0Pfv7X5x2gevR2OEClBSiSqdUnsh4Lv7hjbokYzBYO70dJ 19D+FmneeYFk6X/3DgfSUgglWgQAv/LN43T/IVzOMYkoHNNnEeKUFndrkuAf53mWP75z gSR2UNC1TCdapJY7R30dPMxxSoCAXcI78UYAWQUBqSjDZfKzlSDLE1TgRBKB245UK1k9 E8hDyOwbzx4KxuQRxoQI+5Ep6SBCqC6Sn/PGTzRB/GHAmh170pn6AX4naBwjGHkYn1nC dEgHFczkTX+F9hN16g4BKwIASvp7D4+hboUVDyqbEpu3YrFGxoMSqOPtFJYgvCkzjfVb D4iA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ks1K9p+y; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-131166-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131166-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f4-20020a0cf7c4000000b00699192b5952si5430938qvo.222.2024.04.04.02.27.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 02:27:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131166-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ks1K9p+y; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-131166-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131166-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1833A1C222AA for ; Thu, 4 Apr 2024 09:27:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 59C00745C0; Thu, 4 Apr 2024 09:26:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="ks1K9p+y"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="fFQdm6+o" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E79E74BE5 for ; Thu, 4 Apr 2024 09:26:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712222814; cv=none; b=TFmduMQtkr+KxjZ3udCcpnGAzoQhHtjJvFq8eg5X/afAXqyM6yU0+ROW0cqOJPAo68yZps0Whr84NGohG9SU8V5NAieLa4zjP7tlJ9EJcvcVoJ2p+OxpR8HbaoEyjGKoR/NoHCnhBaHE3HRxhNQVRSeROADSE/NfpAU1czKAQj4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712222814; c=relaxed/simple; bh=lfE8JfpNDJwwkt2EwjekZvO6E9caYSoLl1n5nw5zKu8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QVOi8NsFiMRH74JGloE9vMv+UiJixCm/Mc0GolD+DDfZ4WdKZk5S3E+n7iclf/JYF6bKZt2c2IOphWW8nRhr0tu6RIIx6lOMu3HFCm+1f22Y/hMr+ku7mvYPy+STf5//0uHR5C4pO/CIQExFZtlW+UdtjOgN6UVpo5pzzD/Tbho= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=ks1K9p+y; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=fFQdm6+o; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 431FC210A4; Thu, 4 Apr 2024 09:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1712222808; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=K718IVs++aefO+JflhqPFBhOVoNtCDSYrTOiw2Ex8WA=; b=ks1K9p+yBDuu9YIEeEmwrOVbuWk9S7XKnGQLAiyd34d99+nVSLAYW8wEuu2k8l2rHB7dRe 5YMA4rF44tX3AC8/j7tyK/V+hAMfJNskXKOQFeehjXJSIbXSg9AmyGI6hf0EPhR8BWgiUD 6oEI0p1THxBH7a01nDIAcn7zm01F05g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1712222808; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=K718IVs++aefO+JflhqPFBhOVoNtCDSYrTOiw2Ex8WA=; b=fFQdm6+osuqhnhojugEiowU1K1ecB+hf5JKZ0/UgLwy3mAboBWwU4Tae5Zx4ACG1lfEVu1 tYqbKVmhRWTmVyDw== Authentication-Results: smtp-out2.suse.de; none Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 282FD139E8; Thu, 4 Apr 2024 09:26:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id KmF7CVhyDmbXIwAAn2gu4w (envelope-from ); Thu, 04 Apr 2024 09:26:48 +0000 Message-ID: <8a2890f0-108f-4fca-98e1-913373aa2cff@suse.cz> Date: Thu, 4 Apr 2024 11:26:47 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/3] mm/slub: simplify get_partial_node() Content-Language: en-US To: xiongwei.song@windriver.com, rientjes@google.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, chengming.zhou@linux.dev References: <20240404055826.1469415-1-xiongwei.song@windriver.com> <20240404055826.1469415-4-xiongwei.song@windriver.com> From: Vlastimil Babka Autocryp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BDDE31t5SBg++veI6tXfpco/UiKEsDswL1WAr tEAZaruo7254TyH+gydURl2wJuzo/aZ7Y7PpqaODbYv727Dvm5eX64HCyyAH0s6sOCyGF5/p eIhrOn24oBf67KtdAN3H9JoFNUVTYJc1VJU3R1JtVdgwEdr+NEciEfYl0O19VpLE/PZxP4wX PWnhf5WjdoNI1Xec+RcJ5p/pSel0jnvBX8L2cmniYnmI883NhtGZsEWj++wyKiS4NranDFlA HdDM3b4lUth1pTtABKQ1YuTvehj7EfoWD3bv9kuGZGPrAeFNiHPdOT7DaXKeHpW9homgtBxj 8aX/UkSvEGJKUEbFL9cVa5tzyialGkSiZJNkWgeHe+jEcfRT6pJZOJidSCdzvJpbdJmm+eED w9XOLH1IIWh7RURU7G1iOfEfmImFeC3cbbS73LQEFGe1urxvIH5K/7vX+FkNcr9ujwWuPE9b 1C2o4i/yZPLXIVy387EjA6GZMqvQUFuSTs/GeBcv0NjIQi8867H3uLjz+mQy63fAitsDwLmR EP+ylKVEKb0Q2A== In-Reply-To: <20240404055826.1469415-4-xiongwei.song@windriver.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-1.79 / 50.00]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; ARC_NA(0.00)[]; RCPT_COUNT_SEVEN(0.00)[11]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_TO(0.00)[windriver.com,google.com,linux.com,kernel.org,lge.com,linux-foundation.org,linux.dev,gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_RCPT(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap2.dmz-prg2.suse.org:rdns,imap2.dmz-prg2.suse.org:helo,windriver.com:email] X-Spam-Score: -1.79 X-Spam-Level: X-Spam-Flag: NO On 4/4/24 7:58 AM, xiongwei.song@windriver.com wrote: > From: Xiongwei Song > > The break conditions for filling cpu partial can be more readable and > simple. > > If slub_get_cpu_partial() returns 0, we can confirm that we don't need > to fill cpu partial, then we should break from the loop. On the other > hand, we also should break from the loop if we have added enough cpu > partial slabs. > > Meanwhile, the logic above gets rid of the #ifdef and also fixes a weird > corner case that if we set cpu_partial_slabs to 0 from sysfs, we still > allocate at least one here. > > Signed-off-by: Xiongwei Song > --- > > The measurement below is to compare the performance effects when checking > if we need to break from the filling cpu partial loop with the following > either-or condition: > > Condition 1: > When the count of added cpu slabs is greater than cpu_partial_slabs/2: > (partial_slabs > slub_get_cpu_partial(s) / 2) > > Condition 2: > When the count of added cpu slabs is greater than or equal to > cpu_partial_slabs/2: > (partial_slabs >= slub_get_cpu_partial(s) / 2) > > The change of breaking condition can effect how many cpu partial slabs > would be put on the cpu partial list. > > Run the test with a "Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz" cpu with > 16 cores. The OS is Ubuntu 22.04. > > hackbench-process-pipes > 6.9-rc2(with ">") 6.9.0-rc2(with ">=") > Amean 1 0.0373 ( 0.00%) 0.0356 * 4.60%* > Amean 4 0.0984 ( 0.00%) 0.1014 * -3.05%* > Amean 7 0.1803 ( 0.00%) 0.1851 * -2.69%* > Amean 12 0.2947 ( 0.00%) 0.3141 * -6.59%* > Amean 21 0.4577 ( 0.00%) 0.4927 * -7.65%* > Amean 30 0.6326 ( 0.00%) 0.6649 * -5.10%* > Amean 48 0.9396 ( 0.00%) 0.9884 * -5.20%* > Amean 64 1.2321 ( 0.00%) 1.3004 * -5.54%* > > hackbench-process-sockets > 6.9-rc2(with ">") 6.9.0-rc2(with ">=") > Amean 1 0.0609 ( 0.00%) 0.0623 * -2.35%* > Amean 4 0.2107 ( 0.00%) 0.2140 * -1.56%* > Amean 7 0.3754 ( 0.00%) 0.3966 * -5.63%* > Amean 12 0.6456 ( 0.00%) 0.6734 * -4.32%* > Amean 21 1.1440 ( 0.00%) 1.1769 * -2.87%* > Amean 30 1.6629 ( 0.00%) 1.7031 * -2.42%* > Amean 48 2.7321 ( 0.00%) 2.7897 * -2.11%* > Amean 64 3.7397 ( 0.00%) 3.7640 * -0.65%* > > It seems there is a bit performance penalty when using ">=" to break up > the loop. Hence, we should still use ">" here. Thanks for evaluating that, I suspected that would be the case so we should not change that performance aspect as part of a cleanup. > --- > mm/slub.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/mm/slub.c b/mm/slub.c > index 590cc953895d..6beff3b1e22c 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -2619,13 +2619,10 @@ static struct slab *get_partial_node(struct kmem_cache *s, > stat(s, CPU_PARTIAL_NODE); > partial_slabs++; > } > -#ifdef CONFIG_SLUB_CPU_PARTIAL > - if (partial_slabs > s->cpu_partial_slabs / 2) > - break; > -#else > - break; > -#endif > > + if ((slub_get_cpu_partial(s) == 0) || > + (partial_slabs > slub_get_cpu_partial(s) / 2)) > + break; > } > spin_unlock_irqrestore(&n->list_lock, flags); > return partial; After looking at the result and your v1 again, I arrived at this modification that incorporates the core v1 idea without reintroducing kmem_cache_has_cpu_partial(). The modified patch looks like below. Is it OK with you? Pushed the whole series with this modification to slab/for-next for now. ----8<----- --- a/mm/slub.c +++ b/mm/slub.c @@ -2614,18 +2614,17 @@ static struct slab *get_partial_node(struct kmem_cache *s, if (!partial) { partial = slab; stat(s, ALLOC_FROM_PARTIAL); + if ((slub_get_cpu_partial(s) == 0)) { + break; + } } else { put_cpu_partial(s, slab, 0); stat(s, CPU_PARTIAL_NODE); - partial_slabs++; - } -#ifdef CONFIG_SLUB_CPU_PARTIAL - if (partial_slabs > s->cpu_partial_slabs / 2) - break; -#else - break; -#endif + if (++partial_slabs > slub_get_cpu_partial(s) / 2) { + break; + } + } } spin_unlock_irqrestore(&n->list_lock, flags); return partial;