From patchwork Thu Nov 2 03:23:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 13443356 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3B0BC4167D for ; Thu, 2 Nov 2023 03:25:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 833128E001D; Wed, 1 Nov 2023 23:25:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E36A8E0009; Wed, 1 Nov 2023 23:25:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 683D78E001D; Wed, 1 Nov 2023 23:25:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 549A58E0009 for ; Wed, 1 Nov 2023 23:25:26 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 1652FA0E92 for ; Thu, 2 Nov 2023 03:25:26 +0000 (UTC) X-FDA: 81411573852.10.56A2D7D Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) by imf26.hostedemail.com (Postfix) with ESMTP id 5F609140006 for ; Thu, 2 Nov 2023 03:25:24 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=k4QQibDC; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf26.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.178 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698895524; a=rsa-sha256; cv=none; b=DlT2662wQE5dS40A0i/eSB4g6WJdW3ne4dPc4f+GcuDu80u3sUQEEdsPTOeQLUvXUhsY2K wyp+k2pF0iaiM48ESNGoK7MEC5d63030MvxSO1qbAuQF8RlkSXjeTZV9jDGqkraNoMbijF uhcPqZLv+x/up1AIDwjpcbuExUSRCH8= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=k4QQibDC; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf26.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.178 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698895524; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=N3Xfo0y6jZ0YfVFtmWrT6BPsa9Nsm+KQGum2QWoNV0I=; b=AQMYum94SF1awUNBDi5t6xBD+6WFaFdb6sZe3E9Uh16nYBQ7346eESAb4sldaMEBqtMZuq OGmCVSwo8c1o860LugMvigL4aQLnBomhPPxoMtxla2A6XspWJalzNjHasbIHaJJ6MvFmSf 120otrt9HkzmgRkgBjpWVKiOYiqaGyQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1698895522; h=from:from:reply-to:subject:subject: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=N3Xfo0y6jZ0YfVFtmWrT6BPsa9Nsm+KQGum2QWoNV0I=; b=k4QQibDC1ld0UrW3iBDGGZ48phYAHJ1+HACNNhCO/C89ykyWOPzBIhsNfTvaTJprJCvNXn xOQ7UO16oxS2c3AfRJJiFnt6rOq3FciJQ8ilKoxXDPfHcQOyfEz6OK1DOpVwj61rke/jDb 3Vlw5deJI3Z6PFrtYghaLkTN4KlSeUA= From: chengming.zhou@linux.dev To: vbabka@suse.cz, cl@linux.com, penberg@kernel.org Cc: rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, chengming.zhou@linux.dev, Chengming Zhou Subject: [PATCH v5 8/9] slub: Rename all *unfreeze_partials* functions to *put_partials* Date: Thu, 2 Nov 2023 03:23:29 +0000 Message-Id: <20231102032330.1036151-9-chengming.zhou@linux.dev> In-Reply-To: <20231102032330.1036151-1-chengming.zhou@linux.dev> References: <20231102032330.1036151-1-chengming.zhou@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 5F609140006 X-Stat-Signature: mkjfkrhmutjrqkcsnznxuhhgcwakxkty X-HE-Tag: 1698895524-439575 X-HE-Meta: U2FsdGVkX1/phueQpF5Lfs00Q4pHsxhJZalGe5lg+hags/8kPaQRchlFt3WnP/z6XJaOOyHEv7PV46zrQtU4zWS1yc3Hoq9Pv60Eys6Ao6G/4SFhq29rYgaBSG+nTfiJRjvFhCEdUWv73e7CH/H5rQi0GHX1r5iThsHsGrKpvss4yUz8I+2tn1uwg5vbCGCDZ/Yz/y/CeAMlo1xrFQIb3Yn1BY/ROwmatjn4SIoHYWsoyAc/5DAbUNte/K5f3on5CZaRGOflXZa7ihzFUsgSEPa8uteko/ok3yxyadEYs5FoQ4nPTCup4U886PkyKGOW/CfbwuFQXTu/5N+9cSMmmyyUEzCvjoPa7xsbWZqbQQqcL0k+axriEe2uywWH7nUuQALPg1V9NpkgTxJ2SSUC7+Ybjk3g1+cqXVOPBTAZIAyCHoD8P2YfDYUpehXIsRVJKY9+oEQdWYUH0OpTGUel7CsraOdKnDd5EyGUc3v3BQfcfggPDdMHumN85IFnbNj4MiWn5/tx30KOpYjzTluFIOmz09UnzsbOXFQgZ8lAfCMKheK13/1PGLqN9hm/ZHACentdXWt9keEVZs4E678YAmRIST1vlMv2GUfrfDoXhQaQvyHgMw1GAtEUa3dZwnkFENq6KawxNXIE+FIlbReAe24LYsup/MuskOUJfBenqUqWJMnnkX64YnhhHt0d7ECjbf3D+pwtJuyI8uwIqgveZMTVNzeFXwzDLAgVIgE2G/Ptb0Gq0aG8I35Pp0FchtAt6SNTKRWzstuMvTEwdjQG0nESEfqG6HFfTUYDVNZX61aGoiQBCt5Cec3tPU2IbfTsn1FxyOu/F/mMTzfvSD7IXprzD6IZwvVCIScqR4/zmUw9MIU9vCxZWq9eZIA2bRv9x8I6zILHf6fGOKm402HJiG21mEvTlWdKVVH4OvyO6R8mtlHRf8N6uMazrVI0JZ1PNUPUlpgMKREaB0foIwQ P+npumae kZqrTjvYIpBWiXzwZR6FYGMNmnjnzZHEYys1nnUp9TpM7x1nwCOs02ALcM+Ko7HOXKSBuWFoLd6G0DgnpHwLnXXzDSOx+Jq8Tc6MnlhqtYGKTbe/D7qRvU4o+H1BKjI3CvKu2teesYK0pxEyvWg1ElaqEF7VbMowJTnOlpWjcf6zZdRbvyodshEIsbhYvcy0RHWry/nqiGlpJA4Z4ckTu2831qs6U0BROK5zO/jumBivHX5De1t9iIHbLdiuf9UdMOFhvW3DLl3c4F1M= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Chengming Zhou Since all partial slabs on the CPU partial list are not frozen anymore, we don't unfreeze when moving cpu partial slabs to node partial list, it's better to rename these functions. Signed-off-by: Chengming Zhou Reviewed-by: Vlastimil Babka Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> --- mm/slub.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index d137468fe4b9..c20bdf5dab0f 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2546,7 +2546,7 @@ static void deactivate_slab(struct kmem_cache *s, struct slab *slab, } #ifdef CONFIG_SLUB_CPU_PARTIAL -static void __unfreeze_partials(struct kmem_cache *s, struct slab *partial_slab) +static void __put_partials(struct kmem_cache *s, struct slab *partial_slab) { struct kmem_cache_node *n = NULL, *n2 = NULL; struct slab *slab, *slab_to_discard = NULL; @@ -2588,9 +2588,9 @@ static void __unfreeze_partials(struct kmem_cache *s, struct slab *partial_slab) } /* - * Unfreeze all the cpu partial slabs. + * Put all the cpu partial slabs to the node partial list. */ -static void unfreeze_partials(struct kmem_cache *s) +static void put_partials(struct kmem_cache *s) { struct slab *partial_slab; unsigned long flags; @@ -2601,11 +2601,11 @@ static void unfreeze_partials(struct kmem_cache *s) local_unlock_irqrestore(&s->cpu_slab->lock, flags); if (partial_slab) - __unfreeze_partials(s, partial_slab); + __put_partials(s, partial_slab); } -static void unfreeze_partials_cpu(struct kmem_cache *s, - struct kmem_cache_cpu *c) +static void put_partials_cpu(struct kmem_cache *s, + struct kmem_cache_cpu *c) { struct slab *partial_slab; @@ -2613,7 +2613,7 @@ static void unfreeze_partials_cpu(struct kmem_cache *s, c->partial = NULL; if (partial_slab) - __unfreeze_partials(s, partial_slab); + __put_partials(s, partial_slab); } /* @@ -2626,7 +2626,7 @@ static void unfreeze_partials_cpu(struct kmem_cache *s, static void put_cpu_partial(struct kmem_cache *s, struct slab *slab, int drain) { struct slab *oldslab; - struct slab *slab_to_unfreeze = NULL; + struct slab *slab_to_put = NULL; unsigned long flags; int slabs = 0; @@ -2641,7 +2641,7 @@ static void put_cpu_partial(struct kmem_cache *s, struct slab *slab, int drain) * per node partial list. Postpone the actual unfreezing * outside of the critical section. */ - slab_to_unfreeze = oldslab; + slab_to_put = oldslab; oldslab = NULL; } else { slabs = oldslab->slabs; @@ -2657,17 +2657,17 @@ static void put_cpu_partial(struct kmem_cache *s, struct slab *slab, int drain) local_unlock_irqrestore(&s->cpu_slab->lock, flags); - if (slab_to_unfreeze) { - __unfreeze_partials(s, slab_to_unfreeze); + if (slab_to_put) { + __put_partials(s, slab_to_put); stat(s, CPU_PARTIAL_DRAIN); } } #else /* CONFIG_SLUB_CPU_PARTIAL */ -static inline void unfreeze_partials(struct kmem_cache *s) { } -static inline void unfreeze_partials_cpu(struct kmem_cache *s, - struct kmem_cache_cpu *c) { } +static inline void put_partials(struct kmem_cache *s) { } +static inline void put_partials_cpu(struct kmem_cache *s, + struct kmem_cache_cpu *c) { } #endif /* CONFIG_SLUB_CPU_PARTIAL */ @@ -2709,7 +2709,7 @@ static inline void __flush_cpu_slab(struct kmem_cache *s, int cpu) stat(s, CPUSLAB_FLUSH); } - unfreeze_partials_cpu(s, c); + put_partials_cpu(s, c); } struct slub_flush_work { @@ -2737,7 +2737,7 @@ static void flush_cpu_slab(struct work_struct *w) if (c->slab) flush_slab(s, c); - unfreeze_partials(s); + put_partials(s); } static bool has_cpu_slab(int cpu, struct kmem_cache *s) @@ -3168,7 +3168,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, if (unlikely(!node_match(slab, node) || !pfmemalloc_match(slab, gfpflags))) { slab->next = NULL; - __unfreeze_partials(s, slab); + __put_partials(s, slab); continue; }