From patchwork Mon Sep 2 15:31:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 13787434 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 0A4EFCA0ED3 for ; Mon, 2 Sep 2024 15:31:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0FAA18D00F0; Mon, 2 Sep 2024 11:31:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0AA518D00EF; Mon, 2 Sep 2024 11:31:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF0118D00F0; Mon, 2 Sep 2024 11:31:34 -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 BEF1D8D00EF for ; Mon, 2 Sep 2024 11:31:34 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 700E9120113 for ; Mon, 2 Sep 2024 15:31:34 +0000 (UTC) X-FDA: 82520187708.22.4892F4C Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf15.hostedemail.com (Postfix) with ESMTP id 964D8A002A for ; Mon, 2 Sep 2024 15:31:32 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=IOE5Q5IZ; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of brauner@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=brauner@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725291023; a=rsa-sha256; cv=none; b=m0UaMaMPq6Nz3K5/tTB6lavMYks5CLe+p+OIW402lIvgeO74l3Vuu0Quaimbs3naItfipt +KBcFZAhUdjSJlLzvCsu+hoLsS5WlDPyHKVtoXfvJkoIWJVGAwJLYTmg4V0EN5zMDgk2JB esYkAxzlUxKVWGx2Hhi7BlwMxhfBYco= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=IOE5Q5IZ; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of brauner@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=brauner@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725291023; 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:dkim-signature; bh=3QJOD5yhOQMr3yYbiCl1BKPaQmgN0Uy6uWL9wx2gqZk=; b=8bWwqQz3S4eTVwnTAD9XL/8vFeA84RqDgZm3AB+b2pUjTodx40+Nt5AXMP3YCYsYYg89oJ kJfmbw+L5kvO9xCyMyTfH8BrmYgmBH2fukNLn0uVcgWX0wWD51yHD1NMNDcsU78aIhiYCM UQfC8l/30mj8nw+pUedyv5G+qCu/GCU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 588485C5886; Mon, 2 Sep 2024 15:31:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0841CC4CEC8; Mon, 2 Sep 2024 15:31:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725291091; bh=9zu2IbGpv71HoVCdgColGdhMpTajDXjwvs1F+AN7ueA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IOE5Q5IZY+FNytF5Ytes7FjALMN9owAMe2PzG8Q+gotcCbynaYu4Ein1twqiu7WEG CaoBlN7jrbD4KhBCpZtHMFf3KB3l33WpIY2ADs+wuIhkfJ1yIbJlIjuKEXm+prxnDL JalHlQYoG8fFapzM82qLGTdFCK7xhkR7s5kvEhkCwkaCZPCzQMWh//bY1k+y3H7UDj sPxmWIlbCbLrekonQaVhB15jk3vXTiooCPIRGNjC6n/O6gUfwLE1y3l/FChQxcDLrZ NbVOhfc6/+5mbMS3P8kKI/KSfFPnJP8lCOuPGr7o07nZUkzFCjqLUjMWcc9zbrCm3s jXZYmhcJfXgSg== From: Christian Brauner Date: Mon, 02 Sep 2024 17:31:15 +0200 Subject: [PATCH RFC 5/6] slab: remove kmem_cache_create_rcu() MIME-Version: 1.0 Message-Id: <20240902-work-kmem_cache_args-v1-5-27d05bc05128@kernel.org> References: <20240902-work-kmem_cache_args-v1-0-27d05bc05128@kernel.org> In-Reply-To: <20240902-work-kmem_cache_args-v1-0-27d05bc05128@kernel.org> To: Vlastimil Babka , Jens Axboe , Jann Horn , Linus Torvalds Cc: linux-mm@kvack.org, Christian Brauner X-Mailer: b4 0.15-dev-37811 X-Developer-Signature: v=1; a=openpgp-sha256; l=2955; i=brauner@kernel.org; h=from:subject:message-id; bh=9zu2IbGpv71HoVCdgColGdhMpTajDXjwvs1F+AN7ueA=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaRdveWxb7e6YOeh5xHvX9eZh9/ZH3jcY5tSaMWpdv+nk wJmxbj3dpSyMIhxMciKKbI4tJuEyy3nqdhslKkBM4eVCWQIAxenAEwkSZ2RoVH9uOE0Z/l/s76I TfbNYju/XlW8LflT4/zSR7EWR+38njIyLPldE5hl1n93jr7zjsTD19y9I687StjMLGgs++Cl9uA QCwA= X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 X-Rspamd-Queue-Id: 964D8A002A X-Rspam-User: X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yDZLWPA2tpBnm1ZrbtAkcOhuaW2q0dDlNZC2+Wp6UWavf7DFE5iFv30HmWsxyQ2/CLUMY5D4eCoZYNBXZ3rLGYJh0s/ktRJjZ8jLrEahubSJu2QtQXso+DlmK6dMihlkjxm5R2Z+mvL8mGZOt4/LZ7eKnSt+KhWQsHAJnpcTdQE+Nd/ViYsC8gzYAKswcXdDhzGZc0jqbd1mCoxA1A16MUHSnzw8rSMeYD0h1jLCWATiNEeeD/bFipQYRH3tYfuGfM3106FAXEt3Brw9Tm6ZRFYhQd 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 we have kmem_cache_setup() and have ported kmem_cache_create_rcu() users over to it is unused and can be removed. Signed-off-by: Christian Brauner --- include/linux/slab.h | 3 --- mm/slab_common.c | 42 ------------------------------------------ 2 files changed, 45 deletions(-) diff --git a/include/linux/slab.h b/include/linux/slab.h index 52928474e6a1..7d79410996b8 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -269,9 +269,6 @@ struct kmem_cache *kmem_cache_create_usercopy(const char *name, slab_flags_t flags, unsigned int useroffset, unsigned int usersize, void (*ctor)(void *)); -struct kmem_cache *kmem_cache_create_rcu(const char *name, unsigned int size, - unsigned int freeptr_offset, - slab_flags_t flags); void kmem_cache_destroy(struct kmem_cache *s); int kmem_cache_shrink(struct kmem_cache *s); diff --git a/mm/slab_common.c b/mm/slab_common.c index 515ad422cf30..90180f02a153 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -434,48 +434,6 @@ kmem_cache_create(const char *name, unsigned int size, unsigned int align, } EXPORT_SYMBOL(kmem_cache_create); -/** - * kmem_cache_create_rcu - Create a SLAB_TYPESAFE_BY_RCU cache. - * @name: A string which is used in /proc/slabinfo to identify this cache. - * @size: The size of objects to be created in this cache. - * @freeptr_offset: The offset into the memory to the free pointer - * @flags: SLAB flags - * - * Cannot be called within an interrupt, but can be interrupted. - * - * See kmem_cache_create() for an explanation of possible @flags. - * - * By default SLAB_TYPESAFE_BY_RCU caches place the free pointer outside - * of the object. This might cause the object to grow in size. Callers - * that have a reason to avoid this can specify a custom free pointer - * offset in their struct where the free pointer will be placed. - * - * Note that placing the free pointer inside the object requires the - * caller to ensure that no fields are invalidated that are required to - * guard against object recycling (See SLAB_TYPESAFE_BY_RCU for - * details.). - * - * Using zero as a value for @freeptr_offset is valid. To request no - * offset UINT_MAX must be specified. - * - * Note that @ctor isn't supported with custom free pointers as a @ctor - * requires an external free pointer. - * - * Return: a pointer to the cache on success, NULL on failure. - */ -struct kmem_cache *kmem_cache_create_rcu(const char *name, unsigned int size, - unsigned int freeptr_offset, - slab_flags_t flags) -{ - return kmem_cache_setup(name, size, - &(struct kmem_cache_args){ - .freeptr_offset = freeptr_offset, - .use_freeptr_offset = true, - }, - flags | SLAB_TYPESAFE_BY_RCU); -} -EXPORT_SYMBOL(kmem_cache_create_rcu); - static struct kmem_cache *kmem_buckets_cache __ro_after_init; /**