From patchwork Thu Sep 5 07:56:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 13791884 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 8D8A1CD4F59 for ; Thu, 5 Sep 2024 07:57:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2328C6B018C; Thu, 5 Sep 2024 03:57:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E3396B0193; Thu, 5 Sep 2024 03:57:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0AC446B01A5; Thu, 5 Sep 2024 03:57:23 -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 E015F6B018C for ; Thu, 5 Sep 2024 03:57:22 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A6011C0848 for ; Thu, 5 Sep 2024 07:57:22 +0000 (UTC) X-FDA: 82529929524.17.B6E16D1 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf06.hostedemail.com (Postfix) with ESMTP id CBB8A180009 for ; Thu, 5 Sep 2024 07:57:20 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pZmgX8C5; spf=pass (imf06.hostedemail.com: domain of brauner@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=brauner@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725522992; 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=R0FJ7EEAyT91kPnU/k7OeBfuL6MkGhh8HVPdTieSOXM=; b=qs14DQyylnlymxRBZ9YYyQkzbZUTvWHGiDQMm/h9TpauUBJsOSOnXSibFNMH9pfXq9kU7M mvLhEXDcr0/o4x2xtHxJV5r5DJkJvqzbqNM110SAc1N21i/bJy4wG+vAp4jWH4rJeBinxz jcwSO+nAMU+X11C0L7KGxlKqzo2HVp0= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pZmgX8C5; spf=pass (imf06.hostedemail.com: domain of brauner@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=brauner@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725522992; a=rsa-sha256; cv=none; b=CmXSUuy4LLGp0YfDy/I6KT42Bwa3R2Pw2GGhDRYwA0e/oEmKfYncGz8YGqU3tb1QNLzPyB iEkqFrN3WHJ+ANfW8sJ3oh51NaYKkEqp4qGo6HNO7SZzxxSCNIb43D5fTMyVbU5bN/AlTq 4wm/al1RGN0N/D57oJa3mPPgTOGSuAU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 875035C433F; Thu, 5 Sep 2024 07:57:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F658C4CEC4; Thu, 5 Sep 2024 07:57:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725523039; bh=yFwPV9RImMNE3Jd/xX3WyJKu7K+3lEbT+HKSODA016Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pZmgX8C5yhojHGzSpwIYVN1O8utd8eTeLfdJ+KCv8Vq2ZO5b52/05Pm9H3KqyU9Sq KvxnTBeWV9EhLSJMPdcmuc8CcLt8l1dDGMfDb7IKtrjwwFUfYWiPmPCaC3zwNGQLVv 1UychvUaOYnSlbFnpF0RBzzuiI6FDN4e2JsiHn4W6UvPYT1xRC7ZYyltk5yrG9OmPl XskKQWIaXsjwZ4rxWuBORBXonKDQC7cmwAb2l7a61JT1WYOE0KwjZKZh7N7HpgXgWb 4nTvRSeFZgNbpVuX7XD3mTpt4gLCfZGcoTm1paEOrUvgjg0Ve5wFXFHy0idr+l5LP4 5uSsgI5j5WxUQ== From: Christian Brauner Date: Thu, 05 Sep 2024 09:56:47 +0200 Subject: [PATCH v4 04/17] slab: port kmem_cache_create_rcu() to struct kmem_cache_args MIME-Version: 1.0 Message-Id: <20240905-work-kmem_cache_args-v4-4-ed45d5380679@kernel.org> References: <20240905-work-kmem_cache_args-v4-0-ed45d5380679@kernel.org> In-Reply-To: <20240905-work-kmem_cache_args-v4-0-ed45d5380679@kernel.org> To: Vlastimil Babka , Jens Axboe , Jann Horn , Linus Torvalds , Mike Rapoport Cc: Kees Cook , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, 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=1121; i=brauner@kernel.org; h=from:subject:message-id; bh=yFwPV9RImMNE3Jd/xX3WyJKu7K+3lEbT+HKSODA016Y=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaTdTPEqyfVkZ/Lj+7FDdPbsN+wabw4veVAVw1Dp/L6yh 1tta6p2RykLgxgXg6yYIotDu0m43HKeis1GmRowc1iZQIYwcHEKwETebWZkWJdyJGSWRv2/JNut Rf8X2y3aqBSctErO9RKXB7feo4PxlxgZrp64x/5lh85xJQ5hG0E+iSWFzVsOqEx4/f12rLuN5oX 5XAA= X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: CBB8A180009 X-Stat-Signature: bky44sfbd8cpg9i9r3mpqnkuhidqff7x X-HE-Tag: 1725523040-470876 X-HE-Meta: U2FsdGVkX1/cEjkeYsY0rRyvk4HtuS2icFO9Ufu6cP7TQltXDNWnZY1Y2cYC7XLYyMKJa26vNpLdIQiIAvP1AYbrqMDMmV1e4BcLT8VlAyTtHnUkqkusEZ+qwZxiMHidbFIC6XBeNGv5su3Wms1WPLmcHii2aY13n/cuP5aXfE7OgZCi3VY9EXF5CS1gWfkujexX/w0/XME8cdhV/qrJZEy4RgkNWbsP0ZcVi2Nl2WF+4dDMCkE9OnNlIOIGx0Ys5nyWpp3kD75jJTfco3qG9SBUofVmqnFUJ/KZtcUvCkaDyzb47SRPQqbY5ovRG7XeijF9O3i4ILxAEvR0PX4Nz8kbrcCxDc54QvsDcupgeqTNLoTUa8swZAidh56GEeZPs+auiRQwAehYZ0dPGE/CJA2nAiFXMqca9I6/4wKxAqZxRhFq+9Y525j7W+F/NcSGjKjWyMmlOvyv4Atb90frDTAyCLTj2Wt5bEqSEn9mubci/MphmkSOgXP3oiFPnmDeKl0jiMWQUM7B8LWaZI/cG/kIxVINyMoKW2SuMfctfCqza6F//M0AnBcuzA8qHVaMxS8VMGlksrbt70VlwjvI/UjCKV1lbcOQl5Lnz6Kh6fEPDiGJEVzZrRqCUI3etvelW1uYbnfYq7GtKCxArQ7z4MG8sAyXulynU8Ek3be1r6REsJ362PHfRGrDNciQ/VjhYVgH/m5KZ1jIQJQkUL+nZGSAmBahfN3t0SEyP91NjsOf9rDKQ3r/my8Fm96suwiqg3Uwfq20p3/wyxxvBk++UlnTPhATSrcfuKTK9EAXbCvopxVeguCeViqWw7myDct/OMC09Q9cYAhCE3/Kpb+tcSu42am6TfXZ3NJbmll6xrL6hNByBlRlf2Dhs6yN2gKh3IenVa3W9PmeYgS8Lnk2GPuzhkKYy9JGH4VxxG/OhuiwopkR+z0XW5wBTYe1cL4obkb8M72MmG2Zp5yd41T ZUCbIeKl DOetB1J0La73QdBUOW/dg8KGkaN4Oqg5RmE6RO63y3mhVDlUb7l17a7vlfLazqLTCLQiaGzHMWDP+jas8/1np6q/7voGJAGUc1g4Mj27taHU/cvVXNd0ZnFzP16PmZVKGtWSSTpEspXXPo8RY9p8CkzzWODkJCc7rMUT9aMmjoUWSAm40jMxqcFX2ohpg9DVDKMbcYqBId30urqPdFtWhfLUa+rPkIYvTaXrEe8GcjKHmXmey02mVbtZW0MA3MipApeX1YPcjG73xlwVzIIpI2cnLUZYDX0FcrtXZp6kJqJiEJtItCX4HLZP7oMyrl2xhGNTKyClMKz/jzVqE7I1Avwpq/r2CYU6wLlFXc32R3nDIa6+1N10FYD4Mnbmh7kOmdFTTbikFCVTzUTqD2LIAaw7tsA== 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: Port kmem_cache_create_rcu() to struct kmem_cache_args. Reviewed-by: Kees Cook Reviewed-by: Jens Axboe Reviewed-by: Mike Rapoport (Microsoft) Reviewed-by: Vlastimil Babka Signed-off-by: Christian Brauner Reviewed-by: Roman Gushchin --- mm/slab_common.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mm/slab_common.c b/mm/slab_common.c index ac0832dac01e..da62ed30f95d 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -481,9 +481,13 @@ struct kmem_cache *kmem_cache_create_rcu(const char *name, unsigned int size, unsigned int freeptr_offset, slab_flags_t flags) { - return do_kmem_cache_create_usercopy(name, size, freeptr_offset, 0, - flags | SLAB_TYPESAFE_BY_RCU, 0, 0, - NULL); + 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);