From patchwork Tue Jan 23 09:33:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 13527036 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 7A84CC47258 for ; Tue, 23 Jan 2024 09:33:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 10B2E6B0082; Tue, 23 Jan 2024 04:33:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 06E006B0083; Tue, 23 Jan 2024 04:33:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DDB5F6B0087; Tue, 23 Jan 2024 04:33:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id D016F6B0082 for ; Tue, 23 Jan 2024 04:33:56 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9C899A1F41 for ; Tue, 23 Jan 2024 09:33:56 +0000 (UTC) X-FDA: 81710064072.27.885FB9F Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) by imf13.hostedemail.com (Postfix) with ESMTP id 9B9DA20008 for ; Tue, 23 Jan 2024 09:33:54 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine); spf=pass (imf13.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.171 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=1706002434; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/tfGL6aqY7i7Mloy4UCzd9I3jn4oHdjydxAs/Nsi1Gk=; b=Watyrjj2C3Nw1PY1EdpVQ+eMHhXMQj3TfUQ8ugY7ovCXUGZ6Or1lOGAvHSSQadbkPNFTFv 08EDJOJ91krhy4BpS16dygWtPOe4B8/ntxOFrQMLY1aAxc64i887vLX5BaWRBxKl697hO0 8o9DsrUf0yLyecryA9evhELMchWHZUM= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine); spf=pass (imf13.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.171 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706002434; a=rsa-sha256; cv=none; b=q2nwUCLFEZqM6qKAg5ZIsdDTwFNWMM74uyfSvmYdxMoI4M+hf8VE2jfaLLAkaCw6IOs9Kj gX9bJVuNijZsYqUAILZXTSG7jygKDJUZ75N8Aae+/v5vJRHpLJ/WkNoRzY/1svXwPPisK2 Kwi35G2UFXs2jmur9CXw/X/nMLqeZpI= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou Date: Tue, 23 Jan 2024 09:33:29 +0000 Subject: [PATCH v2 1/3] mm/slub: directly load freelist from cpu partial slab in the likely case MIME-Version: 1.0 Message-Id: <20240117-slab-misc-v2-1-81766907896e@bytedance.com> References: <20240117-slab-misc-v2-0-81766907896e@bytedance.com> In-Reply-To: <20240117-slab-misc-v2-0-81766907896e@bytedance.com> To: Joonsoo Kim , Vlastimil Babka , David Rientjes , Roman Gushchin , Pekka Enberg , Christoph Lameter , Andrew Morton , Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Vlastimil Babka , linux-kernel@vger.kernel.org, Chengming Zhou , linux-mm@kvack.org, "Christoph Lameter (Ampere)" X-Developer-Signature: v=1; a=ed25519-sha256; t=1706002427; l=2205; i=zhouchengming@bytedance.com; s=20231204; h=from:subject:message-id; bh=RxryMU48iVU4pnALkZXNrPy7bZDqLdaz2AEx4p3Ji5Q=; b=378yGXlTZX4OD1uYzqIEJLiYJiKugeTycFRTFrJPpwzMaIF7wNnhWL/62RFkkKgtmJbEawLdi XuPcUkfqgQcAYhCGSKbsn/raWfAV9nLnWfdn7JURg7bvvxzMP/mmbwK X-Developer-Key: i=zhouchengming@bytedance.com; a=ed25519; pk=xFTmRtMG3vELGJBUiml7OYNdM393WOMv0iWWeQEVVdA= X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Queue-Id: 9B9DA20008 X-Rspamd-Server: rspam12 X-Stat-Signature: gqhtoyoe9wb3mhydtdk9aefupnpb8hnn X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspam: Yes X-HE-Tag: 1706002434-113352 X-HE-Meta: U2FsdGVkX1+afpW6c2eTlNhhoKOayGJGYXQxsCF6kjE8lwJWB5QG+dJxDQIWW7YP1wq3Qt68UOzd4JDHCzwl3pd9K8hcKTixqGt+GWXEHihJFNGpfcIo5CVj8AY9s5VFClueniUQ26oR+h9plcNr93wKSGEqPShJ3g3usSrYzjRbibv/HHKP6FS6DrvvSmX96PTAuNf5DxumpVa40iy98MPc09/xlCcyU3qpY7WaHIVTUmDTUpZT9jT9152LvCXFJmKYThRjtAnwUXGcf6x/yi5yOShgrLuXpMkgUZczSCK4AyR8UPny3DVkCMjNn5qFkJnvVsKSTq9yK+oOgAldjY9iQ8FSz8G2iOH0jUBtDxb54sw3O7754ZEgDcn/UviADeaseWXxHVE2UZtLS2DyJDHuUZ3eidvSOMQDE7+uQFrlIBNsaCyhmtbWgT2zFoOfQBgVP80um1Pt2LWiKNP8uHEewRAYUJRO9bhSMh1T5R/b/OCYc9iq9BVRnPkP/TVVCHrzC+M0FwVTETMmCDBk11NWitBKfxqVMVG7vayxQvN9NuHfR3z/BlPJO98IZigyYI2iP7cNymI/JYYibAgFKVpv9r2EOHB3jZ07Xa256jvENoFCb3LRZ/yDbkZDPa2OfeV8KO7GtuQilWmQBaUH/Waf7JQFwLIYLSZs1wJHr3CkO2ZhkELc2CSoU2LL6fINT28CSG3i1gSUeP7fmdYtO1R59XlRDHzBQ4+WSG48cPGB8quVFuYOPxLL9KZXvAW5upDmzBd57nHN9L3ZVK5QVqMX7H6049ooc/e+AX4BX+3nBO0exTzjrbhv/jvlfczGbIXkK665UL5dCokJeAwYCXBH4UyaNQAGI90UNNq8+i0Lr9sZYw0JYq9UyLzDz+WQt99rUHOGOidcKVxKqH6pgc0/Kb1Uj/R2LD4RqacC/9EeGfMHgM0UxTNlP/Nu9jgrQwXPvSLwnvk6ohsm9VJ V3Kz+7TS 6Oziv0pzK6kAEArmoVNTkkSDJPTm8KACnlbeW949oFmhDVu7oqbBOvMhOkzuHu8cwzhHoJ5frSnkKHmGfNvDfizostps/OzjGq7GP9RJG7vDTH7IMIdM1lDM19WviTnEZEttOvGj3InQWVF3RWL2BR9RuIQmP0EkpdAl0Ja9GTIPUeHCKCMJtJrHyRvJRSlhatqnzRNHg4QiB4wvHQrhrfyTTS3kJCRkjbMJpvESIfzG8hyyU8f9XzN0TwTAc3MyJOZPXuIkyfL/qW4MojfnJzS37V9CyfgYCJyuD/j51JM6r6SPlY/tbk75S3aNJMcJseBoKKlMP8Np3fRG9onbu/lSCZ3Aa7aCV9257voJiMc5q3ay3k06z7HnAzVbvqyow1o2+VzWsSG57TrM= 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: The likely case is that we get a usable slab from the cpu partial list, we can directly load freelist from it and return back, instead of going the other way that need more work, like reenable interrupt and recheck. But we need to remove the "VM_BUG_ON(!new.frozen)" in get_freelist() for reusing it, since cpu partial slab is not frozen. It seems acceptable since it's only for debug purpose. And get_freelist() also assumes it can return NULL if the freelist is empty, which is not possible for the cpu partial slab case, so we add "VM_BUG_ON(!freelist)" after get_freelist() to make it explicit. There is some small performance improvement too, which shows by: perf bench sched messaging -g 5 -t -l 100000 mm-stable slub-optimize Total time 7.473 7.209 Signed-off-by: Chengming Zhou Reviewed-by: Vlastimil Babka --- mm/slub.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 2ef88bbf56a3..fda402b2d649 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3326,7 +3326,6 @@ static inline void *get_freelist(struct kmem_cache *s, struct slab *slab) counters = slab->counters; new.counters = counters; - VM_BUG_ON(!new.frozen); new.inuse = slab->objects; new.frozen = freelist != NULL; @@ -3498,18 +3497,20 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, slab = slub_percpu_partial(c); slub_set_percpu_partial(c, slab); - local_unlock_irqrestore(&s->cpu_slab->lock, flags); - stat(s, CPU_PARTIAL_ALLOC); - if (unlikely(!node_match(slab, node) || - !pfmemalloc_match(slab, gfpflags))) { - slab->next = NULL; - __put_partials(s, slab); - continue; + if (likely(node_match(slab, node) && + pfmemalloc_match(slab, gfpflags))) { + c->slab = slab; + freelist = get_freelist(s, slab); + VM_BUG_ON(!freelist); + stat(s, CPU_PARTIAL_ALLOC); + goto load_freelist; } - freelist = freeze_slab(s, slab); - goto retry_load_slab; + local_unlock_irqrestore(&s->cpu_slab->lock, flags); + + slab->next = NULL; + __put_partials(s, slab); } #endif From patchwork Tue Jan 23 09:33:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 13527037 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 2234FC47DDB for ; Tue, 23 Jan 2024 09:34:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AA79C6B0083; Tue, 23 Jan 2024 04:33:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A57D26B0087; Tue, 23 Jan 2024 04:33:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 920E36B0089; Tue, 23 Jan 2024 04:33:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 82D296B0083 for ; Tue, 23 Jan 2024 04:33:59 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 5CDA4A1E6A for ; Tue, 23 Jan 2024 09:33:59 +0000 (UTC) X-FDA: 81710064198.03.9F71E65 Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) by imf04.hostedemail.com (Postfix) with ESMTP id 8300F4000F for ; Tue, 23 Jan 2024 09:33:57 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine); spf=pass (imf04.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.170 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=1706002437; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MVB7ftxAIVcq2QIA10U3ciYcZCcQ0jJHuOcqORi4sOA=; b=lrnwPba10nFniSCul7+YmsRUlKVpSCvix3z7B8X+rysK/BOkDbWyUsNKL4y8HoLsPg8kAz 3zF/8bXqfR66hOOMzGiYUH4Jc50RiPIsgBD1l1C8f3+L9DPMnc5SGR00FqBR8CKI32UxVg VeYLm0snbVaAZjTwbpFTG6NP3OyR7Sw= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine); spf=pass (imf04.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.170 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706002437; a=rsa-sha256; cv=none; b=Hu6tA/ptrXVWoVfOCei1VeUE2l8DeNlwTnJ5ODmPGLxZkJrAFSdwZ0m3wIY0nmCff9zPBj PdLxpcI8UNvH8QGPdWzOqkIp5R7y5ueVKuj5gOD8yqTko8MNShSn4jgit+aAYYJuCwz6s8 A2dMsT7lYPi5EPwCH8n8mews46XXOa0= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou Date: Tue, 23 Jan 2024 09:33:30 +0000 Subject: [PATCH v2 2/3] mm/slub: remove full list manipulation for non-debug slab MIME-Version: 1.0 Message-Id: <20240117-slab-misc-v2-2-81766907896e@bytedance.com> References: <20240117-slab-misc-v2-0-81766907896e@bytedance.com> In-Reply-To: <20240117-slab-misc-v2-0-81766907896e@bytedance.com> To: Joonsoo Kim , Vlastimil Babka , David Rientjes , Roman Gushchin , Pekka Enberg , Christoph Lameter , Andrew Morton , Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Vlastimil Babka , linux-kernel@vger.kernel.org, Chengming Zhou , linux-mm@kvack.org, "Christoph Lameter (Ampere)" X-Developer-Signature: v=1; a=ed25519-sha256; t=1706002427; l=1153; i=zhouchengming@bytedance.com; s=20231204; h=from:subject:message-id; bh=cuwSKTPtiNqZTZ2D9xT7/HRhzSDVJccC9FWGQ4Ep0yw=; b=mJdc+YnrEwU86ZPAWNO2hIOji1KtwvraB80SdFXY8/3S14XjUgouN7U9QY4VsPfbv0iWMF2qa jNF2VdpUcx9CAUqOdk6g8VKSrJo7sg3GFd7D/n6FIaKYhdVOjnloqeD X-Developer-Key: i=zhouchengming@bytedance.com; a=ed25519; pk=xFTmRtMG3vELGJBUiml7OYNdM393WOMv0iWWeQEVVdA= X-Migadu-Flow: FLOW_OUT X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspam-User: X-Rspamd-Queue-Id: 8300F4000F X-Rspamd-Server: rspam05 X-Stat-Signature: npbt889wkcuw8c1rggid38xxwx737puw X-Rspam: Yes X-HE-Tag: 1706002437-939872 X-HE-Meta: U2FsdGVkX1/5ccsDRdlM57GDmfuFcciG8jaQu1UDTku2jCOaqh283cZxMAHV5knKPh2af66wydFMB1Tyit8ZHy4KJ8k+HEQhHjDs0pfypzTGr1mKWgrZPOXVXAIQnvcixrBQpn6/5KPqe5VzBxifJlZFmKfAofay34iHp7RFOM5Kk1nyIdHQzhPU7/sGDHOW5QvAJOCXDdUObsdFge169kQm0sPNO43NB2LaSsy3Aq2P1p7BsM5mqC4hvuN7JV5gNMxFySxC3l8/mnMd7h2K8Nfw831XF6TWFTiRz5ntuYZ4nq+XEmnqUiNbFtbyb/wWjKP2kgakPUIQMucrSazwBhPqU4yHamYvxcD+p5Ojy40HZrS8Vnt9tiH14HU8SJWpWytzbJX6Lg2Nup3skpOdvFRzwVZaYcs1bhkV/7Ykj7DyfPUxh7KhTaOAlAKngecNGg6CJonUCd+X6DGqs2N28LcLn8ezkSYNF85eQ5OIYufxwVPXXi39VD0n5Mvhzv+Pa/F3C0a50vnMmyVDtfd/VfsoiXyYn/91iDahpb3RzIyQfuBsvH2FItCylp8k0dBIJ1HahBC6pQK6VjGOw3EOcuu8ug8FgBZhwU4NYqUiEyQ1xXMYfes9C3PaQjajJlGhtzlopt1YCJAzZkqIliRfrTl+SrC8M9nuzElP6XJwpswpgXuZm4vjLsAweLNBo3JEYy4FIVW0jZP99B/H0Y+ch6kynlTZdCU0jV5W/M8P6C0E3fBLLaHB5HJ97VoIsbdhZP50XAK9ekX7ESZjNhNo8dLTMnJiMqPcLd42L04I7+xEpzG7TL9YR9Pl3R16rFJvcaAFPqWAYvIRCMrmDvj7Athm/6CTH1TE0N3fs4DAUIwKdGdLa0xCiisxeuPcnLoTK19FqYXZINkF2zeLR8YKL8e19lrBAmwJ3Jx4HjDuBtwLS+PItb3efKIPJrrypgPnb+HPGtHF7nOhOB7mMle dIaikqXw S7K9TiU6xpBK84IRQlC5aHHgm8Zmhwd7ugG4rMZLxBfTpob7/S/WMCawHfvmAO89nXWsDjWRyGTDIo9SVIJupqGpgMwj5sNsoqlk8K3p4VeFdKejM+cF/3GqXZ4/jXXe0OaWpwYgoCVLIS4QPO3lsm5O/vHMeUmtDCJtgn1UdPq5x9zfjJTNNCLxoeDmuxh63gII1qXBJ3hu7yUwZ73YsQc3AJm0So9PpcY4cSr7eRdFJCGWF/xmM42+MvkMucu34qipW3b5TDYIB1MdHZ/5gwuGFWqxutMrAPIYOKK8nLUEnF/UgQPUq7TIrxzWK4r+gE37/pStBeQpV0QHlAAAyD7RZrxLl5dshqeaeGW9gI6fvNnhhpzLysiaAyDC3B1OIUB1DPxBWiJCKWiwtdHXjzLAQP6Os6idmZxN05SYClvaGcQZ6rspbSvJXRxpLFlz8SOd6 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: Since debug slab is processed by free_to_partial_list(), and only debug slab which has SLAB_STORE_USER flag would care about the full list, we can remove these unrelated full list manipulations from __slab_free(). Acked-by: Christoph Lameter (Ampere) Reviewed-by: Vlastimil Babka Signed-off-by: Chengming Zhou --- mm/slub.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index fda402b2d649..5c6fbeef05a8 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -4188,7 +4188,6 @@ static void __slab_free(struct kmem_cache *s, struct slab *slab, * then add it. */ if (!kmem_cache_has_cpu_partial(s) && unlikely(!prior)) { - remove_full(s, n, slab); add_partial(n, slab, DEACTIVATE_TO_TAIL); stat(s, FREE_ADD_PARTIAL); } @@ -4202,9 +4201,6 @@ static void __slab_free(struct kmem_cache *s, struct slab *slab, */ remove_partial(n, slab); stat(s, FREE_REMOVE_PARTIAL); - } else { - /* Slab must be on the full list */ - remove_full(s, n, slab); } spin_unlock_irqrestore(&n->list_lock, flags); From patchwork Tue Jan 23 09:33:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 13527038 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 8374BC47258 for ; Tue, 23 Jan 2024 09:34:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 15A8B6B0087; Tue, 23 Jan 2024 04:34:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E35E6B0089; Tue, 23 Jan 2024 04:34:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DDE206B008A; Tue, 23 Jan 2024 04:34:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id CF52B6B0087 for ; Tue, 23 Jan 2024 04:34:01 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A0C531401EC for ; Tue, 23 Jan 2024 09:34:01 +0000 (UTC) X-FDA: 81710064282.17.F2F4A70 Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) by imf27.hostedemail.com (Postfix) with ESMTP id B9CDE4000C for ; Tue, 23 Jan 2024 09:33:59 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine); spf=pass (imf27.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.170 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=1706002439; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3IpsupgbB8KI/0CM5THMh8A5I+UI4shfPxgInFnmHr0=; b=t7HuXmMGEUSOWXfpqzViWgT2Yjwby/67yBTTJy28yRh29rXwzummJMO0DUodXziXpdfgXu aCUAvTO6X3NhCh6x+jdMht3FiHCLCktsLIzWr03yWuoEZIjlL3Z0FWnGf/dwfqUzSeMty4 /TDaoLPLafQZ3Hruhr/eaLbsWmWGr+I= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine); spf=pass (imf27.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.170 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706002439; a=rsa-sha256; cv=none; b=VvErqOrbgEVZFPg2v9qA349d2IcJgSfdO9mO4sqvQuJcQ8kaIu9xAsoODRbzNzVPKkSa2z Jxy69bBTMp92z//w2WhDCWzEiAybMVf/m9IIGRddXSDxcOPjUGK2FhsQeVPhigCzlELf5U kIet7W1nmRgHhV2IJXq8hKLzXMxhMQU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou Date: Tue, 23 Jan 2024 09:33:31 +0000 Subject: [PATCH v2 3/3] mm/slub: remove unused parameter in next_freelist_entry() MIME-Version: 1.0 Message-Id: <20240117-slab-misc-v2-3-81766907896e@bytedance.com> References: <20240117-slab-misc-v2-0-81766907896e@bytedance.com> In-Reply-To: <20240117-slab-misc-v2-0-81766907896e@bytedance.com> To: Joonsoo Kim , Vlastimil Babka , David Rientjes , Roman Gushchin , Pekka Enberg , Christoph Lameter , Andrew Morton , Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Vlastimil Babka , linux-kernel@vger.kernel.org, Chengming Zhou , linux-mm@kvack.org, "Christoph Lameter (Ampere)" X-Developer-Signature: v=1; a=ed25519-sha256; t=1706002427; l=1540; i=zhouchengming@bytedance.com; s=20231204; h=from:subject:message-id; bh=ZXzd5ZM1kPfc29nku387qFGBNfMPhmyqnVdI70QYk5o=; b=eO3C/qpMGEax+MfzVtLNHcbDe+c64BixN/5g6zrbrjsUMaxGOraPVsgUT0dI0grRB+ucrDO2l j/WoJtVo5iuD79mh2KmwA9Hx/yNMXxarI/hcbm5mwl8odmEhDnXWi2x X-Developer-Key: i=zhouchengming@bytedance.com; a=ed25519; pk=xFTmRtMG3vELGJBUiml7OYNdM393WOMv0iWWeQEVVdA= X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: B9CDE4000C X-Rspamd-Server: rspam02 X-Rspam-User: X-Stat-Signature: x9m4m4b6ow6oadtridk6iow7tch65imo X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspam: Yes X-HE-Tag: 1706002439-765185 X-HE-Meta: U2FsdGVkX1+XR7DhmTh84z5GfRpOlvn/kRfT65Hmk36EZltjdK5z+CWU7DvRl8JuBin9fsHXfzlk7T1lLKE/+lCxcUBj5cCffEwcu1KxzFoAhcZMK3bCqbNXP2U4NveD2v7Sjrkwphn4spZpSeC2ILSiO2fVRmEHr6XMoleKOfBRZUZ7Rgtu7KOZT/S5jbypVNp8/abb6y2gi6DR2yRWddMpe8hu1qrGHNw3vtPBR9J/r9uZpCI3O9DCyeN5CrWgyoTN89/zX9LwmzZGlQTulfe9SV7CEM6XTf4zOgqhCCDXRSX6ojHhl3oc0AXw1AqYEIIhLKPZbDnKY+Akw8t/dXppqH+zZjoubtIq0ToB28aGAe4ymdduDBO4hTZ8RyT/aHr7Xo2ZTAWUHuMKCLXPlRB+W4rd8ZSBd8Kf8FgQ0DKrV6Yt2edai1G/oWRniWCIJiRJDYq7L1TcdzrxzZKI8bntpiQfq/JiOvkG6E75YaqWMikTmqSwU9k0b80yMHszPg7Lf1/wRriUXFUFdcBkThR90uJvaTw9gNsile7a1716E6G6AaFHE/6F2wZ//UpmZQF+f7X4IVKOnhr32NuJI69rnAvy7/lSS9GfQUmV3QTgV+Qobux/A+43OOzr9KMi6dUbtwb2qzMPalU1Z4UDMvycKWQ1eggC3fkoqN9GBspGTRjtWHYszsI5MI8Vft7ZfliDI748kZ6dhdYI+12nKeyEZXCKfQe9gMyItI8M0vim0q1H2r8E4TeqqznwSof3BBY9XsJEMYoStqW5ZrTxhDe9GcAl91v/BXTFMbiNeD3lYsLA+X878TMC2BUyLqGulNSdoCpk+DF1cYwSPJiakPRysN8lqzqSe+Dlqbq7tNztKHjbh9eamGLvNUX3cAiNe8MEg++FTKO2Za/ijz4x9UtoMKEUas1RQS8jfRM1Wk+0DyXlF3mlGNrDQOrVIyyV9JgIW8BSYR/aDpWM9zD HJ5Kpjkr as7jettg3x0BRXh5nkFU52coi4Grcf+dqhk+DmXm8JnS3JMyxGn2aB7pM6dvmfz1FkmDge4cya4r2JMMmhkpx3EufWo6OQKpkQxD2qm/WWOGrqddHhPO+VPWgP4YTod4DPWFQ+Z1Z3iGfEVgz4zjkv1F1I0Th8eyTcQTQT3W9kEGVRqqQ3BsJbNoG/bvqEFCxLZ/fmovCX7rv2q5UlZdU3c0XbpuRovF9WtiTPOk/Q9t4oUEzQyqmSGHwSGAj7doGt+rgH83R8mJf7uQsqHo51Mm2X0tYEYtzY7TK2nVSRfz9vD7yJFx3FZo02KubJCKbimKs8sNEada23KqtKS+BLzfjy+26b6tdBA7E3ob1Y3ZMOSx97zllCR4OcuhTNLymm5Qrkk2n+iLHv8X3B0ypuvtesUxaRW/K9aXHZQ3IA3yq9ICliQYVIqDrdveVsYb+cDP/x0qQSks2TsfcslVnoca4AeQO1rOhcjN3gvbVPqLJ3VBVpTpbCiBizPmNPbkM8lQ6 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: The parameter "struct slab *slab" is unused in next_freelist_entry(), so just remove it. Acked-by: Christoph Lameter (Ampere) Reviewed-by: Vlastimil Babka Signed-off-by: Chengming Zhou --- mm/slub.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 5c6fbeef05a8..7f235fa6592d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2243,7 +2243,7 @@ static void __init init_freelist_randomization(void) } /* Get the next entry on the pre-computed freelist randomized */ -static void *next_freelist_entry(struct kmem_cache *s, struct slab *slab, +static void *next_freelist_entry(struct kmem_cache *s, unsigned long *pos, void *start, unsigned long page_limit, unsigned long freelist_count) @@ -2282,13 +2282,12 @@ static bool shuffle_freelist(struct kmem_cache *s, struct slab *slab) start = fixup_red_left(s, slab_address(slab)); /* First entry is used as the base of the freelist */ - cur = next_freelist_entry(s, slab, &pos, start, page_limit, - freelist_count); + cur = next_freelist_entry(s, &pos, start, page_limit, freelist_count); cur = setup_object(s, cur); slab->freelist = cur; for (idx = 1; idx < slab->objects; idx++) { - next = next_freelist_entry(s, slab, &pos, start, page_limit, + next = next_freelist_entry(s, &pos, start, page_limit, freelist_count); next = setup_object(s, next); set_freepointer(s, cur, next);