From patchwork Wed Jan 17 11:45:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 13521650 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 C8CDAC47DA2 for ; Wed, 17 Jan 2024 11:46:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 51C6B6B00DD; Wed, 17 Jan 2024 06:46:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4CDAF6B00DF; Wed, 17 Jan 2024 06:46:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3BB596B00E0; Wed, 17 Jan 2024 06:46:36 -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 2F33A6B00DD for ; Wed, 17 Jan 2024 06:46:36 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 093521A0BC3 for ; Wed, 17 Jan 2024 11:46:36 +0000 (UTC) X-FDA: 81688625592.15.F71F142 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) by imf28.hostedemail.com (Postfix) with ESMTP id B9D67C0014 for ; Wed, 17 Jan 2024 11:46:33 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.179 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705491993; 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=HJvFuZYnuu1ODgl4d1fXT62/I2n9Fp6Oz8eo/QOcTA8=; b=DoODo4tUddnr8gCvnSOaXQHwyBE1EEkc197KSLlydmp2m6dzNg8tyPWFuB4Js0/rqcXv1U Q6pio3NVMYP26XTNbW79pItckdAtrh3InFeETTsGP63GLQThyKrQp7wX6NkdBGnLgLJ0Sq 11z3aKORQqM0hP3q2zikWU78Z3/qsK8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705491993; a=rsa-sha256; cv=none; b=sA83UPonkEk010VQdF9SxZ+w6hiTpSRrFLRmw/ha6iGdGdMMVcax3/3BlrgTkpSok0DcBf bvrF73i2e01+jQh3UJbqI6ST4m1yYECXVzH8/o+B0EN6h8ta+55H8LPDVl6zSkcxPOQ/bc P1x6riLU4VXK21ive/hK9L1YMY7Plmw= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.179 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou Date: Wed, 17 Jan 2024 11:45:58 +0000 Subject: [PATCH 1/3] mm/slub: directly load freelist from cpu partial slab in the likely case MIME-Version: 1.0 Message-Id: <20240117-slab-misc-v1-1-fd1c49ccbe70@bytedance.com> References: <20240117-slab-misc-v1-0-fd1c49ccbe70@bytedance.com> In-Reply-To: <20240117-slab-misc-v1-0-fd1c49ccbe70@bytedance.com> To: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Joonsoo Kim , Vlastimil Babka , Christoph Lameter , Pekka Enberg , Andrew Morton , Roman Gushchin , David Rientjes Cc: linux-mm@kvack.org, Chengming Zhou , linux-kernel@vger.kernel.org X-Developer-Signature: v=1; a=ed25519-sha256; t=1705491984; l=1967; i=zhouchengming@bytedance.com; s=20231204; h=from:subject:message-id; bh=1cV2tT3H0/m/Zwl/1edZJTWNsxvFuwH6aWvUH2ceDxA=; b=lspzQdoDP02OxesbrkhjrNtCmxWtOMg+h1t6s9v2piAwijqH3Tc7Q1b13y4pdQjtZJBFFuN85 MSi/7Nl/He4A7iY8555VHvt+jjR22vlwQ2KgFZAuvEDcaZ+skfH0ZEc X-Developer-Key: i=zhouchengming@bytedance.com; a=ed25519; pk=xFTmRtMG3vELGJBUiml7OYNdM393WOMv0iWWeQEVVdA= X-Migadu-Flow: FLOW_OUT X-Stat-Signature: 86yij3iuqikqeruah834k1truyjcagzq X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: B9D67C0014 X-Rspam-User: X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspam: Yes X-HE-Tag: 1705491993-184715 X-HE-Meta: U2FsdGVkX19gCR0Fx0xBZbwUb8WzW/SXxxEMsQvqcJ550qoApRzkGLbBW2AXWldCQzgks6fo3CgjVgG5LuidemVgTs3bD6xi6DDuOot8pYIeh72Ok5sZWkG5HjLXFkSBaKhAkpCeMEBQgwdpW0gVHX0NAFrEpLZvwC3rT82FL2ccevQLvDlWEM153UI7bBYK0DfTS4SoRxAUd17twKjJbg6uvTlRLJlHYNnLW5WqXYheNvkNnc4n2LSWAYScr8ZSfexOSnpQWDG6h0+pwQp5Wx4Q3NPeeZHk5zh8xTpxdOtB6HPU4nHjfdtMmz9QUBim7k63JmvYXd7MDFvkOWLXq8WbMgrXu5g1IY0JrsjhJkWFjAGvHxtIdo3xGhcRA/S03nwoFbCwo7Goj3hVx8rXLVz50YxDPUbY9X6/Ggq60aimYH7TzGmndK6wZl15v1ktfcpS1DLrTJfRtqBsCeMdp7QwZvsu9K+heo2j9c6gazq7RQMV9MyTk9pdawYaugUej4Q/rhDlLuvoGkLaJ7uzTOmv/38iJnztQbWpwaCeiQECGJ9H8kq+dSgklAv/wiG8pYTwnITtEVu9PPc3X42pR07n1D2ro9hz96Kes1DE324bpHvOHPO8N7U32xgnPhGVGItk9P9zK8giaA1jQXPoDDf1GuvODNN5NuVRh+fyhQsl2zIq2Hkbrs7Oym3NgS7rDqCEJ14yFYXYtK4YHpgYMYjV8aVkn8kgMH8CHC+kc5AcV0kXgwaxnheYeUWz5vSwYPYZ4KnyiDqkIbYh64qrIRrcXIHwoEoe3sBrr1FthMIMJJ4G89FPJZqHLodWWDTeTq8ncxjuvglbTx1JmZ42fs/OF9po2l/j99Sl0RmH4Z+6G/1up0lE80+FbR+YAfUlOQ95NhuNUtkj7ENfdQteLyne9ee/uOz2DXBJzY1tQs4tqchf1giVpA+F186O23oSaXslQFgDWqShrfHoYSP B19dAark rgFwgJ2wKce/1sOeNansZQQh4PiLYcG1rObYX04wyY1XeUYzDmnDs9W4sSxTpabzsSoTXBt1Y3W2tLkOXlm4r/M7R0CuyUIBKrh/qp729/q080E3TOgDAspNjDIrf+La4GxA/0eB/QMD9dGYJYPii9/UpxiFw9Czv/leGjb5yk33xalh5LeEfhTRfMZWysrMdEo7UOGRmKX8k4Mjvo6jppkThXHWyLwnKmDT0Xr9GLT+y6TXhJk3sVVdXt/LDxE+gEcGYB9vJZKHiR92yoFwdcU23Nh+c3Xj9A0vcnfVRyXv6Kf2L40pj9EnL7O3oLWvrXlBoYO1UYVEZVbGZvN1+IaGjpW75nx2gaqXOb3yNvFRiL3uYfOmjpJHGZiK0PWIWzLbj9A9w0ayUVZgGMhy+ea3Jng== 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. 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 --- mm/slub.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 2ef88bbf56a3..20c03555c97b 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,19 @@ 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); + 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 Wed Jan 17 11:45:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 13521651 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 49188C47258 for ; Wed, 17 Jan 2024 11:46:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B86456B00E2; Wed, 17 Jan 2024 06:46:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B35A26B00E4; Wed, 17 Jan 2024 06:46:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FF296B00E5; Wed, 17 Jan 2024 06:46:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8EA026B00E2 for ; Wed, 17 Jan 2024 06:46:39 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 607DD120A66 for ; Wed, 17 Jan 2024 11:46:39 +0000 (UTC) X-FDA: 81688625718.20.C117C14 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) by imf17.hostedemail.com (Postfix) with ESMTP id 5E8FE40019 for ; Wed, 17 Jan 2024 11:46:37 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.182 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705491997; 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=4HDr49UmFwIRlrPlPmxLaKJQ6Bsv2Jm5RU4nZOF6dLw=; b=DCzJm8TfFphESKyIiPfcTx8H4l5iN+ijRWYuqX6iCBG7t8wUzfmnlT7aDS6TJ2SKBxFgbJ fL3l5qNVmSPFpMLHDB3Q5mWh5D5hkULLJrMnTIzQGLsotdASPCoX6LdcXFpM4hEJaD271U 4z/STo1+D7iK+s3OkkcgN+QG1OsRl0o= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705491997; a=rsa-sha256; cv=none; b=6JOv7VS/JJM8lMZpqqM+ntDH2dCCipoX5xq5iMThw2sMK6GJHrmVFi+F5q5csYijvmUIRG gaQiP+I1CHBt8QnTrgI6yWjiWI0UgGWAMS6zhae4SE0V/GTVxXe6yYXHfQKhR03BcoRCsi D4jHqYSkPllkSrFORBUr90aDFm7eaPw= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.182 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou Date: Wed, 17 Jan 2024 11:45:59 +0000 Subject: [PATCH 2/3] mm/slub: remove full list manipulation for non-debug slab MIME-Version: 1.0 Message-Id: <20240117-slab-misc-v1-2-fd1c49ccbe70@bytedance.com> References: <20240117-slab-misc-v1-0-fd1c49ccbe70@bytedance.com> In-Reply-To: <20240117-slab-misc-v1-0-fd1c49ccbe70@bytedance.com> To: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Joonsoo Kim , Vlastimil Babka , Christoph Lameter , Pekka Enberg , Andrew Morton , Roman Gushchin , David Rientjes Cc: linux-mm@kvack.org, Chengming Zhou , linux-kernel@vger.kernel.org X-Developer-Signature: v=1; a=ed25519-sha256; t=1705491984; l=1053; i=zhouchengming@bytedance.com; s=20231204; h=from:subject:message-id; bh=dSgFg48t7LupTsKBO2gZsJttDy0+Yco9PB4eWVCuRJk=; b=5XIIuX0qwsSqEvymGfIXuXLWpVtl9zXEjYel4Re50np/cxam9armg3d5VQKRVueB0DNreHkfP hgVbFAM35ZaDZEywwRZZ52cNqr8+6l7gbh1JIGosavcoqYyq5KQue2/ 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: 5E8FE40019 X-Rspamd-Server: rspam11 X-Stat-Signature: rj434ndxg9dr4h6zyauk6yssh6ffxr5i X-Rspam: Yes X-HE-Tag: 1705491997-362633 X-HE-Meta: U2FsdGVkX1+ezP+M+GOpYwcFdCq7pX6mXoD7SF5w3qqbFTXN5kOPWXEf0Xj3WNn+D7bYSuKoKrD6MTP4TKGZPzBq2m/StwcDjpdNPBXjcVa7vvYUT7LMR15RUNcfyvT5/jmlf6ITPCh5GjgriTj56bLtBobzqXjwxeScSdq7ZxHD4Mj+dtQfFwf8aB1y5IBvZ7qLob/Nj41y8zHwmZmcyqiHqYpwQ6ijC0LED4YmJZ8KY21YsTMqFapgul6CK+PSA0rh5HJsvreK0X66wP0NEu7xEkrH3jmwhP2vwwDggnNV8ztUAPWTn5crkNhySlPNeg1qWgxNXdI+bvp/Boq+CoO+ducgb1D0muD5H7wNX3B/umXXLN5J7jmoxPGUr/p/S1lsPNUC5hFI6kIe1ZM9xPwcb9bzPpLBvw56GTcr6mdDHWm9kc9FKwfRI/ct5Ym4gJVygdphA+5rBo/2Nk1hmJdiiZYoHVIGDbfJZ/Ra2h+zijgluNFc3lVnhcKS4i2X74aMiJlWQGvRV/wRgGdWwwaY+FfQSjlTwFs4hRUUNQZNu4Af2E6IsHIZPH5W1kY2WV8EuFCPFwNaMBIm/wPn+yZbrIUl8DTUj6dOxhqeucNe4kFdKcoLiO0pZFgxHv3x0+aZBloMornOFz3QQoB9ZXJC0vM1Jnr2IqMK8KVMhICgEsUI3rDctQU3D3LGxjSb2sKIMaln35pD8Z6hwz6QQZ4cz6VQjlZnKzkiXujtvddhayGhWIbK1crFIP1rHEyUd6u2Xj5J/1hbAMgO4HtMxTfDQJKCJ0vgjKIIohsKmhsWf7tycPRV/fgdR9Y/gvVex841i+lYSX+Ehk5z6xZduHflov5mgMIRWDOfJZpmqedJeu5eteCoZc9BowTHlnLNb3oq2Vn0ej/rWirev7zBIGKV/JKGA5oDlSxcccY6k1Cr2p9Gox25qtPDg2/Ab3eroDa2UkiPVkJTy3iIIf8 TlDazqA0 Ti3i7DcQGAfua1n7GySdvx3O6L2UhJDtdg0wZ51M2HT6q6LPrk/r5PxiwHIFvT+Vjs84oPTXr20RmRPdMM/980PqYdmgB+QWuhdQ/vMQ9+zZKcxzefOgNeCssTum1ndvyBWc01xXDHonIh8hzaldnF77GIZeyZbky4AhVo5h6wWZG4QYPBOup12UTX5YUNAwJt7wDoc0WIfASzNoP5UFCs418mzlQ8vig9pE9TUTr37s05DcSVn74A5LBxLPUIkDy7D2FZAxX2Qn9ZGxqauJXA5u9m27rE/dBauCrRQKjlpHAqDqwUAK63KhhWI1OuCWEsszc+e1IWsqqtJKknkkGAI6aQkC9KgCfDpczQfdAHSHW/IOmz0FnJuMVbFPfAqBMHD5E54m7BzuTEnc= 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(). Signed-off-by: Chengming Zhou Acked-by: Christoph Lameter (Ampere) Reviewed-by: Vlastimil Babka --- mm/slub.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 20c03555c97b..f0307e8b4cd2 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -4187,7 +4187,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); } @@ -4201,9 +4200,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 Wed Jan 17 11:46:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 13521652 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 5806EC47DA2 for ; Wed, 17 Jan 2024 11:46:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D5A7D6B00E4; Wed, 17 Jan 2024 06:46:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CE3146B00E5; Wed, 17 Jan 2024 06:46:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BF8FF6B00E6; Wed, 17 Jan 2024 06:46:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B15B96B00E4 for ; Wed, 17 Jan 2024 06:46:44 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 77098160B87 for ; Wed, 17 Jan 2024 11:46:42 +0000 (UTC) X-FDA: 81688625844.30.CA4E7A7 Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) by imf23.hostedemail.com (Postfix) with ESMTP id 96B2114000D for ; Wed, 17 Jan 2024 11:46:40 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine); spf=pass (imf23.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.189 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=1705492000; 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=yidEzXzJPgSqQaIUJwDUiw63hBbEIw1Zt18J4A65pq4=; b=0SeyxH8ShmcC6/gsDD36QRbFjrURGBAxidTDI7H66me4BSkBAzlsBO/b+0kGNHAOq4Jm7t 4aDy35IDnrIZYimcpafoT/KlWF9nUftJNk+Sx2sOq1EH+h6ci1mMwTRwLpFA1duVtx7LzA DOevalqfUGfLlefM8qr5tp9sjtnlg2w= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine); spf=pass (imf23.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.189 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705492000; a=rsa-sha256; cv=none; b=O/OMrwu+gY1gEPbTyL49i1HT7+OU5sjrPWrR2Bc0Gb6OXzQtOfOndg5rtp1odGfggDyDUT WMRT9KC2gxhgHXaM+NbFcLbcYY+eauyiRP7DSzkVAnsHxW16BHNLS2ruYPvWkgO/LP4zPA 3vj8dm14AZ/6OlJMdR9LsFJcu2nfh68= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou Date: Wed, 17 Jan 2024 11:46:00 +0000 Subject: [PATCH 3/3] mm/slub: remove unused parameter in next_freelist_entry() MIME-Version: 1.0 Message-Id: <20240117-slab-misc-v1-3-fd1c49ccbe70@bytedance.com> References: <20240117-slab-misc-v1-0-fd1c49ccbe70@bytedance.com> In-Reply-To: <20240117-slab-misc-v1-0-fd1c49ccbe70@bytedance.com> To: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Joonsoo Kim , Vlastimil Babka , Christoph Lameter , Pekka Enberg , Andrew Morton , Roman Gushchin , David Rientjes Cc: linux-mm@kvack.org, Chengming Zhou , linux-kernel@vger.kernel.org X-Developer-Signature: v=1; a=ed25519-sha256; t=1705491984; l=1440; i=zhouchengming@bytedance.com; s=20231204; h=from:subject:message-id; bh=FCOnwYrhZkluxCwU1rI7qym40IkKZ74sKbmGZdbV/NU=; b=r60bI1xFOSY0XMd/T4Vsn0QUucBv9bV6X7Ko6gDXvzMuaW9qAxNwy6xtQTq9LHk4bfdsUq04n Izus8lbaiz1CHUbUv63tGpbiP1Tp3eAQ0hAti23U2ipWl75vInBFP5w X-Developer-Key: i=zhouchengming@bytedance.com; a=ed25519; pk=xFTmRtMG3vELGJBUiml7OYNdM393WOMv0iWWeQEVVdA= X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Queue-Id: 96B2114000D X-Rspamd-Server: rspam12 X-Stat-Signature: yxubtazei4e89o6oikhk5fpoep69j3hd X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspam: Yes X-HE-Tag: 1705492000-776554 X-HE-Meta: U2FsdGVkX18IheeztIJKNxX2qkbxIszxl7QZpv9KQ3ri8E5WutnnvClhDlhPOJ855sNGSOxAKd6pYramqC/5DGg64neHk91k+MMuOWsW29V+ZWKBDgkMtkdiFTiDveWLuRht5LtGsOSh+szGIHkA4G2rfixbxSZ2LcpzCWNEqUOwmFFnJrSfZ5MM7wtG4Vih9bIMyXaSj9kRxxEAmmu1lqmNoxSFdcNptuPk5GGKuJkl013XoTE9Ia05JTo0pZYeycC+G4+uKu3DlFx/gCB1qLBpiJ6jHRJM5JY2/0XLzrfIHtllO7Gemcf09aFSU+68aBLA0EQBWgwrrNbxNqpDRnst43P8dGe3y0xaQNZjiaI9ouETQ+zX7IxEPI2YMCaWInNa8F8W9WKM7mT+9ZgHJYwoyeLJxkNcT4PRxCy9R3Yva8nydi/Qgafn4sftY9vjHU8JhcabX5kpRexZMttaOlzknYO7jRfGXlNmS/8v298VlaafNvqBcj8Uro4/zPVx2CG7YzFjav7/Q+uE3osdLrqCfwubm2tRBAdTHZ9os5FXYKd3tLId2RCNPwXfHHeYxXEqf/qIYTvZMtUR0HuopSO4fcjeskAZPOJFrg90O1DigMFEQJsvtYFJA67iU8HDDACW80IEX/xhoR2KBzs5en8ZbgpE5M6Z9GP0DzkWqFrcJ+7FCTY3n1VPfLb0Tr9RkJlhx46J6y/r+KGs/QSwd+qQq9C45cXa0E9MHjRIm1IWig6F8U0l75ugHtTxCizktitRawnDlZAINQJN5j5pSL/dn4pprfOPc+/ZkVF5vBx3hman2HrU0Jr4X8z+J/SPeesj8ubifvgknp5KA+UuXgHEU4gWjZAlMcf0DY4ISMJsmYt5lRM2Jjcl8F1GR4eWm9j1D3YjSPI+pENvgIL96u/xvQoUFpBo1oJ76gVPTkjZGCAQ2Ywjw2C9S7u06CWARFDKao1u+n0pkZc44HU blx2IuYA 4WXuEYIvQyiaV9s3jJLlbIEYHu9K9dx3/cPR4NnF3h1MlKe0IQsHBNPP7Ezwap2c3n+S4n32cILnomSXskNsUu7OAh2PiYE9ZTELfjbdRolqCgIvfxJpiHd55kGfJpYjw/SdH5x5SA+BsFvbTpDehFI1hxp014uTwSlDslvysyYWk3MiMLEemihv1MgNEqUpz3h4FMXOVUMF5HJGbzp3jgjGw5OJid57eP2R1QbYPKxIpmHxq5rIUzIgCJg5jEk1ItLVFgmFGSwjqRGetikQI0Zq7EEnkacXUE1cP2UjPdrwzsYlmcvnmXP7pxVOlwv6brpx7QMS1ugME77QkH6yyDajXyoH2PdpZrUh+/UzT2q19w3bjXIU6XyDxld3ZbDH3DDJ4WUM1AXqcMLu/YKsQcIAGuopg8hWOxZflMlwTNwbs4WnLIAzFXKk+gip6lK85NEJi 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. Signed-off-by: Chengming Zhou Reviewed-by: Vlastimil Babka --- mm/slub.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index f0307e8b4cd2..3a4e2f8d341c 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);