From patchwork Mon Nov 20 18:34:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 13461876 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 102F0C2BB3F for ; Mon, 20 Nov 2023 18:34:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6F64D6B0394; Mon, 20 Nov 2023 13:34:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2437A6B039C; Mon, 20 Nov 2023 13:34:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E2A1A6B03A0; Mon, 20 Nov 2023 13:34:44 -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 8D5406B039A for ; Mon, 20 Nov 2023 13:34:44 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6132FB514B for ; Mon, 20 Nov 2023 18:34:44 +0000 (UTC) X-FDA: 81479183688.11.A608BA7 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf19.hostedemail.com (Postfix) with ESMTP id 233DC1A0014 for ; Mon, 20 Nov 2023 18:34:41 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=NTA9iWAb; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="ZZRf0/d+"; spf=pass (imf19.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=1700505282; 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: references:dkim-signature; bh=TE/wmIqY+Mqmq3Uv3qpaJHn4wLurFsze1PiLFKu5tjU=; b=sbcSEC+EWOp9gEiumBa2gzIoMNwhdCMfy3PLJ86sIB4VgFG48HHR8OLLdUJn5D6BNCkGVT NRO95z+Jd27bqNZqeQXKfunRjxgAr6EpueNkk4vXArIvmfKq0pOPDMVQlDjGpYCm97DHMt SY4GBZbmGxMqCoGdEJVIZeu0AQWsdNg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700505282; a=rsa-sha256; cv=none; b=e3hJv21wSAbPA+2jNWDAEVfPMnFC5mXb9pVbV+C0K0HTQzf7fywb5/s7DCJK1xpvyz4hJI y6RajRMwxJ0FPU68B7uHgiIKN0FYcvK4pTpZDmsg0saQEhMenfuNfJhyxhADqjHzE3KCPn qe1Y3JKuLLx9fxdtNzo0TQqwTeStt4o= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=NTA9iWAb; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="ZZRf0/d+"; spf=pass (imf19.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 7B0AB1F895; Mon, 20 Nov 2023 18:34:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1700505279; 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; bh=TE/wmIqY+Mqmq3Uv3qpaJHn4wLurFsze1PiLFKu5tjU=; b=NTA9iWAb7zpjPvHwyg4esMrdJ8vKeanEb3iLWBslYWd3X7vt3x1fcGIctO29bmM8VtZa9y CL8VH2A7xuHHLshh4X9erTFthmcC5Q3DqS2QsInmMww+U7j2YuUn8yabXRectCp9H4NcG2 k1NwXPWDXAHMZsjRc6UuPdjyeTq2NFY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1700505279; 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; bh=TE/wmIqY+Mqmq3Uv3qpaJHn4wLurFsze1PiLFKu5tjU=; b=ZZRf0/d+HXx84QJ4iQmfJf8GbYpdCD8NzhSyVn1DAQRsoM9MmArYprkHgd5AgYU02Q3WP1 67j1bRCggDslOKAg== 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 2D01313499; Mon, 20 Nov 2023 18:34:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id omBJCr+mW2UUMgAAMHmgww (envelope-from ); Mon, 20 Nov 2023 18:34:39 +0000 From: Vlastimil Babka Subject: [PATCH v2 00/21] remove the SLAB allocator Date: Mon, 20 Nov 2023 19:34:11 +0100 Message-Id: <20231120-slab-remove-slab-v2-0-9c9c70177183@suse.cz> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAKSmW2UC/03MQQ7CIBCF4as0s5YGhoaiK+9hXACdWqIthlFib Hp3iW7cvW/x/hWYciSGQ7NCphI5pqUCdw2EyS0XEnGoBpSolUIp+Oa8yDSnQr/tekPBGDvYYKD e7pnG+PomT+fqMadZPKZM7i+ktNor3clW9Z1FgSiKd/7qjvxkasMbtu0DXrt6spsAAAA= To: David Rientjes , Christoph Lameter , Pekka Enberg , Joonsoo Kim Cc: Andrew Morton , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Roman Gushchin , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Marco Elver , Johannes Weiner , Michal Hocko , Shakeel Butt , Muchun Song , Kees Cook , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org, linux-hardening@vger.kernel.org, Vlastimil Babka , Michal Hocko X-Mailer: b4 0.12.4 X-Rspamd-Queue-Id: 233DC1A0014 X-Rspam-User: X-Stat-Signature: qizedefeqr5h9ur1bmab4x6945cjs51i X-Rspamd-Server: rspam03 X-HE-Tag: 1700505281-622319 X-HE-Meta: U2FsdGVkX1+Z7+Tm7nr5WAls/Q9tT/tHrInMYnuvvFZTx3aFHjPo0OgSyMLNwkhyckZwuxADwJoLIA5v42z7N+4jJ/3Ir4EK9rpLMm8MUUSedOvJqDEcabuyFkeTNw1E7c87Rzpu8cbOFh4jFQgw4wBPP/fATUrjXdNBwTF0mqz9xHEJrsnAdZ/j9odeav5Gzs0XK/Jy8HD+Fi6C2VCgKkwkecPEDONP9ds13zoW1x5J/2q/uH8TEGGuv0dl4G+7rdO7pTt3vSNVXRdDn2FLJALHgNjJ5oIqFifYhdlAdBqwRPB3mtASHH2WHAwsvz8BPtZ20ehn78MSKw6f3S/gED28IX/ez0AtGJkPf1zLogf+8JBQ+hgabL9JnD+KLL0rWnS59v05JF4MpUaG2aF6BeAtn+RYJEgB1dPzzvzEkBbrt8GOV1iFDCMfIbfSxBUTWzAVdYQP+N7PCUO+4000YGWGep1AOQXsKF/CtRdudRF2CykXETfs2iUkDl0cZr0nITFv3eifvP76lMA2fgbSZVZcuZuvTXKMKZa7SY9Us0/THBxkciPFoIdMercRzB+txezvA4A3UJ1hJ/k/Iw9i2Kt2+uiOM9X+/juuLtux5qwkwSrvqajVScqP4JkQm3f3SULL+mhNN1AQwLO6VvC60js99g+W/9tDzpC7MKWFsmLNl5rzui0KcFYiEyAcW79L8seMuuhOii4Od2U/SaHuEltk2+LM6PY9Eq5dqYBqqrKxTxtBbRdlgnlE6BzzgqbzeU9LoTb8e9dJDg9XB9OQ+JXCSd9txznzQBuJeSG4p+ewmaa9mD1BlEBO/C5rlcoQeFW7uhC/GnIPoNGGkC/0DyV1mEq3eQQjuJC3cv6a8onusWnSXEEYnZUKc96V9FxPAtWZPvC88LTgWGTA5DY9qxIygcNgEt4DLanBMoxko9ZT1RLOuKf2im21L3+eBqHb4S84g4OFwpF6IzEj+AO dAKm2oim Fe+IWj9OWXlNOxKqpSpQYfbrIxTRh+fvZpaKjIdsp7Yr10EA4sNh4LriJ4Biw+vhJZ2ZkcO0BAU4r+fvjAnl+wTNOy6n3Bprzyjj9xw8sQku2ASYdgkFgSvzpX9qk/bRsHf6kQFvLYZyd+WsxbnsS90w4bYSzJDmtmCbGUfSvoJHxxCAymYEkEJFAA+O8Se1/6Z4F/xe0WjOBC2G7YryVhJsEC+TZaUBYAjPG8VQb1xbsmz7dBsXbOzU3AIO99zTNzQhVZ+iPtCi2iEH5HLnUc+qm7U6vq8fXjpqnMbkS2/pAakU1/8avykmzl/OagwHBJalB9VCyBHuvOJo= 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: Changes from v1: - Added new Patch 01 to fix up kernel docs build (thanks Marco Elver) - Additional changes to Kconfig user visible texts in Patch 02 (thanks Kees Cook) - Whitespace fixes and other fixups (thanks Kees) 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. This is now determined to be 6.6, and we just missed 6.7, so now we can aim for 6.8 and start exposing the removal to linux-next during the 6.7 cycle. If nothing substantial pops up, will start including this in slab-next later this week. 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 09 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-v2r1 Acked-by: David Rientjes Tested-by: David Rientjes Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> --- Vlastimil Babka (21): mm/slab, docs: switch mm-api docs generation from slab.c to slub.c 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 +- Documentation/core-api/mm-api.rst | 2 +- arch/arm64/Kconfig | 2 +- arch/s390/Kconfig | 2 +- arch/x86/Kconfig | 2 +- include/linux/cpuhotplug.h | 1 - include/linux/slab.h | 22 +- 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 | 68 +- 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 | 551 ++--- mm/slab_common.c | 231 +-- mm/slub.c | 617 +++++- 29 files changed, 815 insertions(+), 5134 deletions(-) --- base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86 change-id: 20231120-slab-remove-slab-a76ec668d8c6 Best regards,