From patchwork Tue Sep 3 14:20:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 13788796 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 17DCFCD3439 for ; Tue, 3 Sep 2024 14:23:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 80EC78D0184; Tue, 3 Sep 2024 10:22:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 797318D0151; Tue, 3 Sep 2024 10:22:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 614C98D0184; Tue, 3 Sep 2024 10:22:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 3656F8D0151 for ; Tue, 3 Sep 2024 10:22:58 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id CD8A0160503 for ; Tue, 3 Sep 2024 14:22:57 +0000 (UTC) X-FDA: 82523643594.01.D018D65 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf30.hostedemail.com (Postfix) with ESMTP id 1366380010 for ; Tue, 3 Sep 2024 14:22:55 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JgSzT5kw; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf30.hostedemail.com: domain of brauner@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=brauner@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725373306; a=rsa-sha256; cv=none; b=mO/W8yV5BHO/uWb73XHvqpgJZFkNwtnrzxp0LqtbQ3yrrCIFLEFJ5YPNdRF+NFcX/xBMA6 oT0SVZ16wfy92KqbTIAG5tZxzDnblAC3IY6AtvfmGz3HsBZV4GCmvqJlY1x6HZrln/TKXt hVJ2zHJ9GKNjpx6Pf1YsKNReDPh5fgQ= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JgSzT5kw; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf30.hostedemail.com: domain of brauner@kernel.org designates 147.75.193.91 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=1725373306; 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=AFI0NHPHBKaBpnbS5PQtWzDi+0G5pcyZF1ja0kkTRck=; b=ELRxt6r8/WAR0KPzXtJ1ROFGYnrbrwj8KmfvI3oSUUJpXMI4LgNlc/Ub9NSlkIlr5IIuwb 5GoLZnIhayFfL9W5t7YSZCzxLy9aOMZ9nsFN73rpj9PajqmZx+XPxHLXKpNKAJutXuRhbH LASJkI4l222LcwKzTWwPrvw/hHDQiJw= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 53ABFA43660; Tue, 3 Sep 2024 14:22:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CA42C4CEC8; Tue, 3 Sep 2024 14:22:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725373375; bh=6bG1JSwASGPcSbXbn/SP58oY4O44BFhaq6fvlGpwWZw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=JgSzT5kw/kqZjtu62rKEOhtPQaXg6+GNpK7HPlu2JAeGj9bEhx9j07h95VDy1OKzE O31WVPK0Aor2Wj0c2PJPqCQahWpa4akQrZOu+WDkA1EG1VHsmvxZMLB+IwkYLAS7+B R/zTjA9ThANEe8EYIwWi34xcct3yVJpVNb6u5JrENfp3n1grX2Zkf/UYwZbIecoyWL 5R0XAn9j6JCIHIhZN/V6PZqVH8c1zEohmwqYI8wyr/khfF7xn4DXQ9pmAOR7954BDD NiA1S6c/x6XZLb1vhIALBBWiPczImRVo3QYYPqxEV2Kg7cVyFUf2TJgorV4wcCsnHp 6WhEIvdcTTD/A== From: Christian Brauner Date: Tue, 03 Sep 2024 16:20:55 +0200 Subject: [PATCH v2 14/15] slab: remove kmem_cache_create_rcu() MIME-Version: 1.0 Message-Id: <20240903-work-kmem_cache_args-v2-14-76f97e9a4560@kernel.org> References: <20240903-work-kmem_cache_args-v2-0-76f97e9a4560@kernel.org> In-Reply-To: <20240903-work-kmem_cache_args-v2-0-76f97e9a4560@kernel.org> To: Vlastimil Babka , Jens Axboe , Jann Horn , Linus Torvalds , Mike Rapoport Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Christian Brauner X-Mailer: b4 0.15-dev-37811 X-Developer-Signature: v=1; a=openpgp-sha256; l=3031; i=brauner@kernel.org; h=from:subject:message-id; bh=6bG1JSwASGPcSbXbn/SP58oY4O44BFhaq6fvlGpwWZw=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaRdl54jXPX8rdx6/mVLDkyd06KQtJU9c0HW1+iL/6LX5 x2fsGtFdUcpC4MYF4OsmCKLQ7tJuNxynorNRpkaMHNYmUCGMHBxCsBE3ggyMrzjlnhzRLl04is9 m658Z+1bFmmFCb+0pq91PPIj48bNz6sZGZZfsks55tTGvGBllGHuUrZpJ/xDDt5X2HtBaAHH9Hc dTMwA X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 X-Rspamd-Queue-Id: 1366380010 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: ntwrj3dpmdepizuztzx453jp46bsuswh X-HE-Tag: 1725373375-479494 X-HE-Meta: U2FsdGVkX1+tyM2dIGLJwRB+/+mo+lyuwtO5ESD9/wFqXEr1d8WuNjdtAeD7S09rHXUopviPO6njmqLRyYAoenh51rHDKqLqj0LQEMRRJZ2fJDQAb8xTh65P6xy1zm0jB3nLtRuNPtju54Zanrth3ja6JnwJ5sJet7+b907pZLu/Xy/B9jlc32eH0nlhb+/y/mqzLTopiWV8QMHD8gQRZe8SfpDCDTRLzf67UIuId65b/5WX8WXvEditaMdL0Fs5iW+VmIP6HtAtX1CQRzb3cBm7/QrcPwBojXpfKno0UfJxXcUiORVFl/W5qTp2ngoCK/pnqSHRGrf7Y3kSW6tNxQP6fBAtA7kiZmnDWA1zzmKEFSkFrRKrU51NRJ26Bd+AHcRBV8s8ak7mkEwyPOzSe5n8+TuUxKqaxG7vQ2pHgcyC+jgFjYLh4yPfVy9HmFAXeygAskktVJkMJOvfhq3cxBcpLKl7hZEwBAPN+ltKHmnSTYlUFJU3g6iX14ZSEU3b4hHDRzebpZ1nBLqdlQL4I2B6942t11eqRxg/xyMj3sE5ZuBEZL2h978LgxHwRwyUWAZxk8d2UXz5AuXDUycVKp1xAYUJwBGJ2f80usqhlCs4hOzaiBd2MXOCj1uktmgvFuqICoz75jjgn9J1pe27fjafAxgWk/WzL8e1NiznRw9G2Tm2qckePIdUpEyBGyHnQaRMmuge05Z75IQffihNS0vV3TQT5EVSie+F88Qu0klirh1xwNRZiAvsysywd8RiLalOg2MzjxqMwCGBXO6rU0iak61SC9BtId8DdwJgC3H2I0JCpG4DlGcVy+K1bZQ0Q503pV+oLmYM5LIPN0pe5CRfVvHbnAU70t1kGPkZxq+0/ANwjCKGNS0QkSwopQdWQMm6GWMFd29LcJFdlsBGafTcHmrJObeyZa3lLE5lcnVvFkR9FbHN+5c9ROiAiLwPuGhixC1l3E21fopPoUN B7Nm/HMS n8IB3kx/lSI3iu/EgrJy6VepKi/RDm6fOj8QmqZYKLsU+B/c2N9xx41vDpyA4AojapazhWLsuGldZPDCIS9fepewG2N2S4ZTfOK9D2e9kQSRBeLf4JCUjuEcwd+MBkO+VIXqrB4EgSfjIPCSALE8uanNsHyeVRFINlbShrWltqUxo4B3wDHaV0+YX9CwPYbM4CHwNi9434f6wLak44BTUMWOVfEPpKw2+/r2VWhhqql/u9WGp+OElOHeqeJtGNWiS49Fe1vB5y5IN4AvWxGJkegyXIb8M18UVG+Na 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 Reviewed-by: Mike Rapoport (Microsoft) --- include/linux/slab.h | 3 --- mm/slab_common.c | 43 ------------------------------------------- 2 files changed, 46 deletions(-) diff --git a/include/linux/slab.h b/include/linux/slab.h index 4292d67094c3..1176b30cd4b2 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -270,9 +270,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); #define kmem_cache_create(__name, __object_size, __args, ...) \ _Generic((__args), \ diff --git a/mm/slab_common.c b/mm/slab_common.c index 418459927670..9133b9fafcb1 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -420,49 +420,6 @@ struct kmem_cache *__kmem_cache_create(const char *name, unsigned int size, } 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) -{ - struct kmem_cache_args kmem_args = { - .freeptr_offset = freeptr_offset, - .use_freeptr_offset = true, - }; - - return __kmem_cache_create_args(name, size, &kmem_args, - flags | SLAB_TYPESAFE_BY_RCU); -} -EXPORT_SYMBOL(kmem_cache_create_rcu); - static struct kmem_cache *kmem_buckets_cache __ro_after_init; /**