From patchwork Fri Mar 17 10:43:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 13178861 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 EBEABC6FD1D for ; Fri, 17 Mar 2023 10:43:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 211866B0075; Fri, 17 Mar 2023 06:43:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1BF586B007B; Fri, 17 Mar 2023 06:43:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 07D2C6B0078; Fri, 17 Mar 2023 06:43:27 -0400 (EDT) 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 EDCB56B0074 for ; Fri, 17 Mar 2023 06:43:26 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 9E9621C5DA0 for ; Fri, 17 Mar 2023 10:43:26 +0000 (UTC) X-FDA: 80578053612.18.5BFF929 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf16.hostedemail.com (Postfix) with ESMTP id C193518001F for ; Fri, 17 Mar 2023 10:43:24 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=nDlQKhaT; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="t2IaQyu/"; spf=pass (imf16.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=1679049805; 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=o1Bd/gf90WdisSwwS/vFbHpVvxBLf3xzgu2g/b2rdJA=; b=rtUIpM4z+6/qXDee6uZHMm262/PHYzIRZCne9cI22pqosN0OLMPgMGp9YW6dNal7UhB2Ez HxCUdRFixdAH7FBtKmX1dN8JOq0v04TZPn7qKD/jmdfO+mTDUB6SUYufzO3+WvWa8Exhf6 L8RXwbNcuws21VI4PS1Rq199E4EIH7c= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=nDlQKhaT; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="t2IaQyu/"; spf=pass (imf16.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679049805; a=rsa-sha256; cv=none; b=xMK2HIX+BMchI+uM1D3Bf7m8lNm11KgGU6uha9SblyEBhXHQ52+bnlAaPhI5J+NvDgdFcM Do6hD/5j4EtTQBq+F06oQkRcrJVpaI6ljDuq2fGPuTvsDysR7uiwWC5TUvVWRlMoxBVIy4 6HT1H/1EUQjQGKsqrZl0U6q9TVChG5g= 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 9CFA71FE4D; Fri, 17 Mar 2023 10:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1679049802; 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=o1Bd/gf90WdisSwwS/vFbHpVvxBLf3xzgu2g/b2rdJA=; b=nDlQKhaTyEX6T/6m1aUPTpA7kEN4gZDpFVzA2Xek9so2Gjl37yELlyf78dr+gSnyQDIPls +ITc+PBcjFhipCvdNptK6MpNJ/54M06O2XW0ZbbK9yQqCdYYbgiJ7RBSV5oFKlZLKrW3iU +qko/YhJplWnjW+rexyd0Rr+TwoN0O4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1679049802; 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=o1Bd/gf90WdisSwwS/vFbHpVvxBLf3xzgu2g/b2rdJA=; b=t2IaQyu/bJ56hVfwE52wAmc7HMN68khnpeQkGLYb8NvcxiZvPTdRrN+pRorI5dSunTqIdc 6nUQX7yRR9/ZAIBQ== 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 483221346F; Fri, 17 Mar 2023 10:43:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id BHjpEEpEFGRgdwAAMHmgww (envelope-from ); Fri, 17 Mar 2023 10:43:22 +0000 From: Vlastimil Babka To: Christoph Lameter , David Rientjes , Joonsoo Kim , Pekka Enberg Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Roman Gushchin , Andrew Morton , linux-mm@kvack.org, rcu@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, linux-doc@vger.kernel.org, Vlastimil Babka , Frederic Weisbecker , Joel Fernandes , Jonathan Corbet , Josh Triplett , Lai Jiangshan , Lorenzo Stoakes , Mathieu Desnoyers , Mike Rapoport , Neeraj Upadhyay , "Paul E. McKenney" , Steven Rostedt Subject: [PATCH v2 0/6] remove SLOB and allow kfree() with kmem_cache_alloc() Date: Fri, 17 Mar 2023 11:43:01 +0100 Message-Id: <20230317104307.29328-1-vbabka@suse.cz> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C193518001F X-Rspam-User: X-Stat-Signature: n8jhib4efy15699xzbn58c6mh6g36uup X-HE-Tag: 1679049804-115219 X-HE-Meta: U2FsdGVkX19rcCKUahcUldw66EZT6R3Uzd4nPh7pp30yN3QAwhPYJdQsz50GSTytfAjOZMTX0Ak5JvGpfXZgHPjh8cO6cza473k0aTiNetajuwkrG+/Uz9JVPc2ULD5LMcLkfDoExfaL1DHMIMJlSbLxNmKcJPjgPYY6BzhJLInhTou3Hn///QL4iJUL0BzDv0Hb/+brtendW6TqYZXJn9MhlFMzW0v8jPM8BcUCr7315rWSYKJu52rxcdd5+KWU+ofKIYNiV00T4hN3Q4MZA9Ur7yzDFUK7ELtLhRiELtWsuRxzGSIMs4F6kmKOsB+3SokArrR/DCN4br8lK2Ey3XM0VzsKRCNA+AsXqQP1Pu+x9UFW+LNlFimczEKlu10cXTOOlH4nQG0GoBUpxyhy7Fja1DSTdHrsPdSmDQ3iNf3mHaTVL/AoGIBODXvrqOjjrL0w8VIL4+Az5L8qLHGuQuH4Egf3HFQwfUs8iqlIvaqCv+Coz1s82A9cxIusOr17LInwhtJDK5DN5zL6Gr5bfLR/GmLU9Uzz1u0llBZ6k+mXsCalguJTDzeEEky/QJwP8i4Lv3Ziwuh2QIRAoCqdaS0/Nf6ZxNhCInX2GyMm5lvfEEeA0TYnc3BUNb4M8a+Gk9VeINmIAF10onXr0dp2yEst2uUtie3+r9l3iIX4G/nYZ/WLN0CHmnddjAJKcDLqUk8xj+bFAuCMEzOXE2bzHS35f6eQDB06u3u21TEuUDNuSKRK3wJFBFVqneu1sMiM+kHsbnE9OfP0MdZTrZDk/gJXkTQVdFl6dQ3OInGuGorro2ouPP1TbtNuqxKVtn3AAldc5DhjlDPuG3p1jAhwmOvZpSvG2DTm6V4D4gjMTc3dgrm7wE4ktBl6wWrLO8TXUaHuGJwuqcIHjeTzmoNW8sQYIyvgtaDyOvWMVfkJnjuDSQVW/8npqL6xpJzi2EI5QgWSZKogsDLPxyDxMsL ghEAPBbW ixFAckzl1pDOMY2L/jPylIbWZkRzNykpR9c16J348TPqovg6syBwuw22pi74CtIFEAx1f+D8oEcxyEaIQk2TgW3oE1dQvSdQc2YOEMtmEWGyUf0571GGY2HaOnky6FoNdFJiesAx+YzWs19GJ8syROlvxhaiNMtY4pDq5ESft81nAnZUXw4NGOTmUSoEj/eO92dYI8BNzWVv399cCtrD9OHRQx4O3Py/3yIIiuwJ3jRskEz3DD4TOMmnFs2L1t/yjPr8C4m+XF4dEcX3fXogFRcviTnvG1EWpwt455Ioy+dr9JAYCdH0a8ofsVkrIlaEcSB/KhMAlxopDQzhhhNbE7lxwZJ5g2V1A5WtLg2A+z/GoF6DkWNb94FJ5anWTfP4JtVQl 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: Also in git: https://git.kernel.org/vbabka/h/slab-remove-slob-v2r1 Changes since v1: https://lore.kernel.org/all/20230310103210.22372-1-vbabka@suse.cz/ - skbuff patch removed from the series as recommended by net folks - fix up comments in fs/proc/page.c (Hyeonggon) - removed an extra line in mm/Makefile that I missed (Mike) - tweak the Documentation wording (Mike) - added Acks/Reviews - thanks! The SLOB allocator was deprecated in 6.2 so I think we can start exposing the complete removal in for-next (already included as of today) and aim at 6.4 if there are no complaints. Besides code cleanup, the main immediate benefit will be allowing kfree() family of function to work on kmem_cache_alloc() objects (Patch 6), which was incompatible with SLOB. This includes kfree_rcu() so I've updated the comment there to remove the mention of potential future addition of kmem_cache_free_rcu() as there should be no need for that now. Otherwise it's all straightforward removal. After this series, 'git grep slob' or 'git grep SLOB' will have relevant hits in non-mm code: - tomoyo - patch submitted and carried there, doesn't need to wait for this series - skbuff - patch to cleanup now-unnecessary #ifdefs will be posted to netdev after this is merged, as requested, to avoid conflicts - ftrace ring_buffer - patch to remove obsolete comment was submitted The rest of 'git grep SLOB' hits are false positives, or intentional (CREDITS, and mm/Kconfig SLUB_TINY description to help those that will happen to migrate later). Vlastimil Babka (6): mm/slob: remove CONFIG_SLOB mm, page_flags: remove PG_slob_free mm, pagemap: remove SLOB and SLQB from comments and documentation mm/slab: remove CONFIG_SLOB code from slab common code mm/slob: remove slob.c mm/slab: document kfree() as allowed for kmem_cache_alloc() objects Documentation/admin-guide/mm/pagemap.rst | 6 +- Documentation/core-api/memory-allocation.rst | 17 +- fs/proc/page.c | 9 +- include/linux/page-flags.h | 4 - include/linux/rcupdate.h | 6 +- include/linux/slab.h | 39 - init/Kconfig | 2 +- kernel/configs/tiny.config | 1 - mm/Kconfig | 22 - mm/Makefile | 2 - mm/slab.h | 61 -- mm/slab_common.c | 7 +- mm/slob.c | 757 ------------------- tools/mm/page-types.c | 6 +- 14 files changed, 27 insertions(+), 912 deletions(-) delete mode 100644 mm/slob.c