From patchwork Fri Mar 10 10:32:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 13169121 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 04EFEC6FD1C for ; Fri, 10 Mar 2023 10:32:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8B4268E0003; Fri, 10 Mar 2023 05:32:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 862F28E0001; Fri, 10 Mar 2023 05:32:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 555806B0074; Fri, 10 Mar 2023 05:32:18 -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 421806B0072 for ; Fri, 10 Mar 2023 05:32:18 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D7DD1A12E9 for ; Fri, 10 Mar 2023 10:32:17 +0000 (UTC) X-FDA: 80552623914.24.C1A272B Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf17.hostedemail.com (Postfix) with ESMTP id 08FE340015 for ; Fri, 10 Mar 2023 10:32:15 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Pi4jmECI; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=qc9mtv8o; dmarc=none; spf=pass (imf17.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678444336; 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=+UxaHT8mKSvWC1QwdfPHOIKK79hhmlWoe1rpbrZg63I=; b=aQt1AyxbCChl5qn3bV8pbMbGyJVgBqFbC7VPGX6cAdIcWaZJ1FFVFQdTFcwfu/sqnvDE+0 58sysCy0vsrwi3dKa6hJNQiAlKplEvA8cadQJd2eBBJbOY68tmrremgxikZ2uIpnBKGq/l ey2TLVZvqJNx3I8x7iRM+XD1zOKrrv8= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Pi4jmECI; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=qc9mtv8o; dmarc=none; spf=pass (imf17.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678444336; a=rsa-sha256; cv=none; b=DlvVCcvz8q0iYOpN3RsWARuxs0tPBxEVcra0+1E1hcAtnH3Mp8hqIJmJLNB5hy0Nhocvnr 5cWZ9EQyDxYKSA9t8JuV7/A5EwBaf2gltC0A0dSKzCCZmDKTkL0w53nsgKkJWCmuWgkI9b vlBfrij+XosxJAytXkd6YiG1zpYhyOQ= 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 4FCF020652; Fri, 10 Mar 2023 10:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1678444334; 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=+UxaHT8mKSvWC1QwdfPHOIKK79hhmlWoe1rpbrZg63I=; b=Pi4jmECIhq9mt7ExG5YPIfVLCnWAsu13s1ZcnGG8QMsXvppeWz1uSPuiQAAUb4TWtAnyIK FFaCIxvGmlNxUZwx+6E7paW4fJEQ4r+txzLRaCowoeYJsr2zCk53dGc5tmS0m3rN5Lr0/K Kt/Mg6W6ijqhwCTTXPogOO/aOCVXxr0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1678444334; 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=+UxaHT8mKSvWC1QwdfPHOIKK79hhmlWoe1rpbrZg63I=; b=qc9mtv8oEd3rdK+9AU0fRFP6mEP8TogXgGtqfBKs7DxeOUmeHcrefoqf50gZ3br6pltm6a mpmzxQWPR95dfxBA== 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 E502D13592; Fri, 10 Mar 2023 10:32:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id bBceNy0HC2SsXQAAMHmgww (envelope-from ); Fri, 10 Mar 2023 10:32:13 +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, netdev@vger.kernel.org, linux-doc@vger.kernel.org, Vlastimil Babka , "David S. Miller" , Eric Dumazet , Frederic Weisbecker , Jakub Kicinski , Joel Fernandes , Jonathan Corbet , Josh Triplett , Lai Jiangshan , Mathieu Desnoyers , Mike Rapoport , Neeraj Upadhyay , Paolo Abeni , "Paul E. McKenney" , Steven Rostedt Subject: [PATCH 0/7] remove SLOB and allow kfree() with kmem_cache_alloc() Date: Fri, 10 Mar 2023 11:32:02 +0100 Message-Id: <20230310103210.22372-1-vbabka@suse.cz> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 08FE340015 X-Stat-Signature: xnfzmd6wptizczq3de55r7cdowz46qzk X-HE-Tag: 1678444335-808011 X-HE-Meta: U2FsdGVkX19trAqn3BEaOS1kibL+a1/dDX5/DF3SayodpxaxxiXX7pw5CuuUCujvXnY5ikYM8o1XWuMbZwjLpqPmNk0Ut4LLaWUjRCG/lNnPrQrflyeZbLMC7NEPKSntwhlDFxCgVEeX8JSnwZtTlLS7at38lonBeNrjMimblMisg6xIIcE7/WrE6y5ipU1RT8yDEKqQhlPsK8Cz4W9wAqOu6edAXIE2XUh6JlI+6ZmwJh4GP5NB+qrgiEoPw83qi5mNjdw5tD3fy3AB2V4Uv2ddADgWyzm2OPopV5MwbBiin3m9fz+Jsz+PXrgx5/qykvkeCFwNPROV+Sjxlyp095oiJfaugLC1XkQQKCve25TpHNred3DseTqkqsjtnS4ENo08oWI8hZ86XQgTVnd5tbIfUu3+nIg2zY5mvaVGiNarPW9IM87fQ48OMQV7E0d7ENunKi2+c1QzVHq6Bw1GQnC0fu0ui+HhM2D391qZRJKTLbNiDQMby5LgZP+z80ZBSallJ1hEYY0TqAZbJbFifKVyV2ZrZJhjoKZlolfwUqxuIseUqdOW+NMXZK6CqBuFN5cj6nh1+D4VpkpW751L1eBUtm6x6w1T4mMYC1VEH2U1ViDvyWSS48ng1HWUHbVv5eKYxitFl9j0aDzJOOTh5HQdLUa0AeT1FPfE9I9YMxirFOx+tgTSiGSM8c79qyi6bt/PlOoD1iz+3Y8oAZky03bLMELGsesfzk94EtjravMX6dT2291RjL1kGTQ4vb0m61kF07XDSSBcssu/yPTQ9K0Q8Mi3dMzu0bzGEwP22Pyi42kd1boIfh0JMtbbo0OiNAnOI5Rg4AbTrcOGmUBnAcT/cUp77TpYQKQCFgJKLeQwviLYOCH2qJC4fS1jqI1tFPctApGDwjujLxJrok488mbfhpFSPb4drSvDuVZVPj13y90mFBvCO2hZuqbLfXN6WLJGq/WxJVecnbuBiHr xw0SP5OO 9fFjm/nzp01lDq2KjkhwztjC5o89K8S8IEQADyz0QarQA8Cyl8ZxrRe7NQ3IbMwaz6PfLffcgG/mFgmsmpg806kloy2V9TC359Z0vBfGBeis4jsWNedH465wzucaBVYDK09RJUIATelWzSFAsZtV3IUSvnxvKiFaW39BgWKCS0+RcKNR6cmC0tSN/JRRfMX67ajd5INsJdtby7zEOyEqHOMOnwRd5+XH00TZ3Jnm41CBCFJkjjdzfbjxXQjiDVxXkR5HbigiHaMAjnAGgCikgScXSOLHE4CLbuFygVt59D9MpJ0K8Y6PMKK4KhJ89+1BXDutj2tSas86K80IAarpsVTGwb/A9Ax1OdKlfsokd4AVbEHRYAXNpVokzoJhlw4G+gHZF 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-v1r1 The SLOB allocator was deprecated in 6.2 so I think we can start exposing the complete removal in for-next 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 7), 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 straightforward. Patch 2 is a cleanup in net area, that I can either handle in slab tree or submit in net after SLOB is removed. Another cleanup in tomoyo is already in the tomoyo tree as that didn't need to wait until SLOB removal. Vlastimil Babka (7): mm/slob: remove CONFIG_SLOB net: skbuff: remove SLOB-specific ifdefs 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 | 15 +- fs/proc/page.c | 5 +- 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 | 1 - mm/slab.h | 61 -- mm/slab_common.c | 7 +- mm/slob.c | 757 ------------------- net/core/skbuff.c | 16 - tools/mm/page-types.c | 6 +- 15 files changed, 23 insertions(+), 925 deletions(-) delete mode 100644 mm/slob.c Reported-by: Mike Rapoport Signed-off-by: Vlastimil Babka