From patchwork Mon Nov 13 19:13:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 13454356 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 AF9FEC4167B for ; Mon, 13 Nov 2023 19:14:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 926E06B025E; Mon, 13 Nov 2023 14:14:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F4866B026A; Mon, 13 Nov 2023 14:14:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 493D36B0260; Mon, 13 Nov 2023 14:14:14 -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 366CA6B0266 for ; Mon, 13 Nov 2023 14:14:14 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0E7D880940 for ; Mon, 13 Nov 2023 19:14:14 +0000 (UTC) X-FDA: 81453881628.07.EB54874 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf13.hostedemail.com (Postfix) with ESMTP id D0CC520020 for ; Mon, 13 Nov 2023 19:14:11 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="iXl/C1dL"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=Ikh9Erxs; spf=pass (imf13.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699902852; 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:references:dkim-signature; bh=W7QXmIFPtyA621azrDtsOPQFV81EzYubbdba9PHLL0k=; b=QY+ImVGeQ+TFOytDFsKgj/AX1K9Sqj7fMFoUcNLVrTGQTVO0o/APaUuF4ovER6MGqimkGM wC968xqa2Oow67CWOW9zJku5fWGgRr9Jl9l5XxIUDjS3yqaa8fXLWEhq4HZvGozdi9+Rul S30u2ganLTlD7UmPterap++eVjIcdUs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699902852; a=rsa-sha256; cv=none; b=TdUvCdCLBWA5+x+cROkWTUN29vyBBuKg+tKp3ua9q4KlgkaJdFSx0RdVPOEqln24a13J4d LTErru1HAFthq3FF93VkdsWJPNl3p6mpIy2+5yhKQ4ovCdWdrvG+kZeJNMeGIVOCOJ4ggO f55bFPbHO1mx5RHAGRzZDgrmH5qD7yA= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="iXl/C1dL"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=Ikh9Erxs; spf=pass (imf13.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none 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-out2.suse.de (Postfix) with ESMTPS id 52E101F854; Mon, 13 Nov 2023 19:14:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1699902849; 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; bh=W7QXmIFPtyA621azrDtsOPQFV81EzYubbdba9PHLL0k=; b=iXl/C1dLeuvhEZYdxXFS8vwa/6hEZvHeAoLkv2y/Pro4x9I1NfIFHF2xNy7zR7td3VisoW Jnoiv+QP+KnaD4LKz8bKRn+0+X5xXp6/UocGU+oqFckvf21ODPPjfWDwXmMXhvvHR3ezLP 1DNFp4UMCfYxY5dZmgfqtz6ZRI1eavE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1699902849; 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; bh=W7QXmIFPtyA621azrDtsOPQFV81EzYubbdba9PHLL0k=; b=Ikh9Erxsl7uTaSvib65hNgBM28up4uw5lXTZ9xrfbHBQKHYYrw70te4lLGFSuD6hgqGEqZ 0ISNDKspXXt91rAg== 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 F2EE313398; Mon, 13 Nov 2023 19:14:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Us6jOoB1UmVFOgAAMHmgww (envelope-from ); Mon, 13 Nov 2023 19:14:08 +0000 From: Vlastimil Babka To: David Rientjes , Christoph Lameter , Pekka Enberg , Joonsoo Kim Cc: Andrew Morton , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Marco Elver , Johannes Weiner , Michal Hocko , Shakeel Butt , Muchun Song , Kees Cook , kasan-dev@googlegroups.com, cgroups@vger.kernel.org, Vlastimil Babka Subject: [PATCH 00/20] remove the SLAB allocator Date: Mon, 13 Nov 2023 20:13:41 +0100 Message-ID: <20231113191340.17482-22-vbabka@suse.cz> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: D0CC520020 X-Rspam-User: X-Stat-Signature: up7bfyh9tda3dnyoirkwraukssde4d1o X-Rspamd-Server: rspam03 X-HE-Tag: 1699902851-802385 X-HE-Meta: U2FsdGVkX1+H1t0Ht05zs84sqcDpQFqMvKJtageiaO5j9MpjtBzdXHdXXZlRAc/maXmXsJIRdYcPyyBRsA7Vnh0c8xgSVQNiyTUQLZUCkckttPVPJdw6H7WGF7B6WmXAdzaBeqj13qCv3gc2Ko+4De5ZWzLkmc51WE/xlUv3JHj8AwicvFYnWr8S2gqrXgY1j3cmFsG5sjDL12qa5w5MIObcc5IMElO4E3EPgnSgaFCDQHq0e+B7cooBR3DiLhsq+3jkJoi5jAVF4RxmnB1KeZUbuXNo/GHvLwHMMfggDNqOVpNcSPqMQcV5PfAT09gKkBT9VwSHvKoPWwin9vdhYdH4geOatT14nADC5sCbjmYX+mkHKgcEPh5f4VLTAHU4/xKsWboiIdLev1Bpr8vVfv+z79GYFrXB0hDeNVq2SNrhr/1GeUQKh+N4EuvCFnOlYNtqID4hG6ROM9BlXXN6xISSNC2Cn1Ay2jUDez56UUfite3pBmFMzaZndPy6Zg/7JKNbcy4INIGF8G9uv4rEmemd/QtjuZ1nSMuT3ed4GoHCqvsT5DAR18dZFt9HkBLau4jY/KzCn1pMPuCLa91hDWQ0Q1iAg7ba4ang68M51vJ0T1yYr1Depn9gWJ330ljLuK1ARbdltgTtRfC0/LBaaB2jI3RI0UgeQokV4Wj9mBGcQ6qyhxGJK7xOJOy9Zl3obZ5OW9OWxJvNYuwXsr/pP+8LB/eSu0aHdOSgkdkYtCpYlKP5h5RpxNDhaCpg4kLPWUwgJxaZyvG1Dpl2w5LNrOE9YJXkMRGU1QmE8WSd2tHf4sQMrDaQVPOJvqP9TIQb/he6m/sE6+ZD4lBQN970GeMzKdw7RCqp7mL8++QkQJjZg2hiHAiDdK3lEcwu5hy2AAj9EzKDrxqtbv5flEdOvyV6hQltFntALjxNncc8f5drbhuxhZDZR3oyTGmNeYaiq6Ch3V2gARZx0QwxSPo fonQ76UN NIWDZa4LXC9QcwI6pXZRVU41a2kPP0u6SgeAFQc7UBtVvilb2izgSMxXMz1kWF57H5qnlMSZFCJxkvBybqUvnemVYKpN3usQVK9rg2FxAeJX5uABkw+zS5nqicpyYZUiwqNNBQYjioMPFnpUHKgu3H2oPcsqvcgBayUDcGGjb1iSZkCilmKgg2SjwmGt2l72oXuBvKpMQo1bu3kBfzESYG8yCm8dBNOKKg53EoAfOdh305eDur5kADqpdjLuRpnDnGaDiykCJnoTHtBDI6NQWcCRF2ohq8oxA1etErI+Z5UVRAWbOdXZX3x4tSRUz37f1W7+7 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 SLAB allocator has been deprecated since 6.5 and nobody has objected so far. As we agreed at LSF/MM, we should wait with the removal until the next LTS kernel is released. AFAIK that version hasn't been announced yet, but assuming it would be 6.7, we can aim for 6.8 and start exposing the removal to linux-next during the 6.7 cycle. To keep the series reasonably sized and not pull in people from other subsystems than mm and closely related ones, I didn't attempt to remove every trace of unnecessary reference to dead config options in external areas, nor in the defconfigs. Such cleanups can be sent to and handled by respective maintainers after this is merged. Instead I have added some patches aimed to reap some immediate benefits of the removal, mainly by not having to split some fastpath code between slab_common.c and slub.c anymore. But that is also not an exhaustive effort and I expect more cleanups and optimizations will follow later. Patch 08 updates CREDITS for the removed mm/slab.c. Please point out if I missed someone not yet credited. Git version: https://git.kernel.org/vbabka/l/slab-remove-slab-v1r4 Vlastimil Babka (20): mm/slab: remove CONFIG_SLAB from all Kconfig and Makefile KASAN: remove code paths guarded by CONFIG_SLAB KFENCE: cleanup kfence_guarded_alloc() after CONFIG_SLAB removal mm/memcontrol: remove CONFIG_SLAB #ifdef guards cpu/hotplug: remove CPUHP_SLAB_PREPARE hooks mm/slab: remove CONFIG_SLAB code from slab common code mm/mempool/dmapool: remove CONFIG_DEBUG_SLAB ifdefs mm/slab: remove mm/slab.c and slab_def.h mm/slab: move struct kmem_cache_cpu declaration to slub.c mm/slab: move the rest of slub_def.h to mm/slab.h mm/slab: consolidate includes in the internal mm/slab.h mm/slab: move pre/post-alloc hooks from slab.h to slub.c mm/slab: move memcg related functions from slab.h to slub.c mm/slab: move struct kmem_cache_node from slab.h to slub.c mm/slab: move kfree() from slab_common.c to slub.c mm/slab: move kmalloc_slab() to mm/slab.h mm/slab: move kmalloc() functions from slab_common.c to slub.c mm/slub: remove slab_alloc() and __kmem_cache_alloc_lru() wrappers mm/slub: optimize alloc fastpath code layout mm/slub: optimize free fast path code layout CREDITS | 12 +- arch/arm64/Kconfig | 2 +- arch/s390/Kconfig | 2 +- arch/x86/Kconfig | 2 +- include/linux/slab.h | 21 +- include/linux/slab_def.h | 124 -- include/linux/slub_def.h | 204 -- kernel/cpu.c | 5 - lib/Kconfig.debug | 1 - lib/Kconfig.kasan | 11 +- lib/Kconfig.kfence | 2 +- lib/Kconfig.kmsan | 2 +- mm/Kconfig | 50 +- mm/Kconfig.debug | 16 +- mm/Makefile | 6 +- mm/dmapool.c | 2 +- mm/kasan/common.c | 13 +- mm/kasan/kasan.h | 3 +- mm/kasan/quarantine.c | 7 - mm/kasan/report.c | 1 + mm/kfence/core.c | 4 - mm/memcontrol.c | 6 +- mm/mempool.c | 6 +- mm/slab.c | 4026 -------------------------------------- mm/slab.h | 550 ++---- mm/slab_common.c | 231 +-- mm/slub.c | 597 +++++- 27 files changed, 784 insertions(+), 5122 deletions(-) delete mode 100644 include/linux/slab_def.h delete mode 100644 include/linux/slub_def.h delete mode 100644 mm/slab.c