From patchwork Wed Sep 4 10:21:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 13790357 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 0A088CA0ED3 for ; Wed, 4 Sep 2024 10:22:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 936BE8D0245; Wed, 4 Sep 2024 06:22:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F29F8D0242; Wed, 4 Sep 2024 06:22:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 760DC8D0245; Wed, 4 Sep 2024 06:22:10 -0400 (EDT) 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 574378D0242 for ; Wed, 4 Sep 2024 06:22:10 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id CC07216107E for ; Wed, 4 Sep 2024 10:22:09 +0000 (UTC) X-FDA: 82526665578.16.EAFF4C3 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf13.hostedemail.com (Postfix) with ESMTP id 1A3A520014 for ; Wed, 4 Sep 2024 10:22:07 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Fr54x1ND; spf=pass (imf13.hostedemail.com: domain of brauner@kernel.org designates 147.75.193.91 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=1725445280; 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=dmbb6gLW12yG1qxWdtUGDk/ThB2vBNcttkyZZ0/1B9Y=; b=aWc6UCOW7wVNh5gk6L+e9VeJ8FO74MwzFc+dMZK+qS/fJNacSwc2EETNtEj61O6BVcc+Um T9YfB/tIl9P7e86/C82lQhzkTbLd1ScpRQVtLox9pm+2689NMtHeo53urH4MnEE30/7zoF 7pK/SZiKaRZ5EtSWxuZrjWZ1AkMX5Ic= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Fr54x1ND; spf=pass (imf13.hostedemail.com: domain of brauner@kernel.org designates 147.75.193.91 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=1725445280; a=rsa-sha256; cv=none; b=BSe0YhwCyzAveq1gPwLknB40uP+zfLKSZ9Mng5Ad+Qbmy6t40Gl9GeNA743jFRM/J4Hxtk C9xAB303Wsb7iXxaHiNIpk5ARGcRLYP0FcGsqm/0wcMGxixDR3EKFWJ5OIgWvzPAOZbsNo T9nuYDJIlbW+DMlOhJaNmGj71OJKYro= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 4C1FBA40D7D; Wed, 4 Sep 2024 10:22:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3B2FC4CECA; Wed, 4 Sep 2024 10:22:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725445327; bh=PzF+2+t3y9QvUaK7XGtoJxZCJ/C5QzrTNKeCBjRAdK8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Fr54x1ND6hGLkeb2A+9fO433Az2ZzEZSs5uo+FsIlP5Rw2c5k2FFT8CkidVw9waS0 w7VCYJqFVwFep3ul/BzzO5m1crxq1AiiijoEUK9ir5la6ndOW8jydEEDMNalFx4fbJ 5tm+i+5GCM2/3bMDIFNMRNQSQdRbw8OL5axjA3I2mXDhjNrNVQdUkCrOboSZx0Mg5I FokxkNFZmpuxIUo5vu27G5LISDln8afLXkDB809xn+aw5LfGyV6VVIRiml77B9FxWq T0gOE7uAzLjDGMpykeHfbEWYNRdoq7cO+fPIT4gfPh5JBnTMu6uNXWErgihqRQcbVE bxzsSnzCnTYfA== From: Christian Brauner Date: Wed, 04 Sep 2024 12:21:09 +0200 Subject: [PATCH v3 04/17] slab: port kmem_cache_create_rcu() to struct kmem_cache_args MIME-Version: 1.0 Message-Id: <20240904-work-kmem_cache_args-v3-4-05db2179a8c2@kernel.org> References: <20240904-work-kmem_cache_args-v3-0-05db2179a8c2@kernel.org> In-Reply-To: <20240904-work-kmem_cache_args-v3-0-05db2179a8c2@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=1036; i=brauner@kernel.org; h=from:subject:message-id; bh=PzF+2+t3y9QvUaK7XGtoJxZCJ/C5QzrTNKeCBjRAdK8=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaTdMNm1Se/tBhcrk60f62veG7IUPfrovW+R6MMvMkZr7 xkn+f3+2lHKwiDGxSArpsji0G4SLrecp2KzUaYGzBxWJpAhDFycAjCRresZGVZfuV3EN+lIY7Zv nejLMMEIbQedvUoXnpmtd1omvz0y/B0jw6e5HyJSY5waTD/eWWn7ce3MCg/f1Q6nuDpd735I06x +zQ0A X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 1A3A520014 X-Stat-Signature: zqhhzr51r1zpzsmrrwpnbseyxjk5ipbo X-HE-Tag: 1725445327-647059 X-HE-Meta: U2FsdGVkX1+RrkXlTMLMXIcGLtKrjDhfYZVFFguv1ooQEbE6YINjwpVGphnKPdoUKbRbsrgYyHQ5hidWuW6NVzMnnRtKO3K1EoPuIP7xUW8TAhR6FZ2dWTKAWMyO0o7+WvEftV+XL8ERbxK3m2YipAQHWbyVHkxvk6EHd4a4gBwzbhJD1k7YNUM02jyARRlNEOAILDMr5Rd046dmFULpKq8hwVkZgceML5Fw7IsHfr56gyWVZQQsc44OKsHdV1INdWZLP1jiwDWQVKTbWob6S5zEtWCOgKS4kUUA2Ct5quK+n3DS9zt4QWBNWlFeiMJqHhJOHG4MYnZWmhJqE7d4ui0pFztpzuvgxEehKsYeSk+4lsqnCZ1yKgx3TjHTHfEMHNYjZzxh0GXrrKa0HrSTss9eAteZDlS4/aNAWq8lnVvTbbL4n0A3LmyilKY5n/MJOdyh0YTSlaPligIiLJLH3NxH1Z0a6WwPO61dPRj11ca0qtXvr/EaDkTpykzMevLb1Vm3ZOkN+lXOdphsjyCzkXEV+tyUu6a8hZuVEg0aNDV9vaiH+vGInIiZGvLpcx5zIrt9vtc4DtbOG4zEGfMqLq1W+NQ37haebnopx5wePDmrs8wns8Fx2EwnvcXBgJnwJOF+NYtshylfaSVcLXnymEaNEJafkPO1QVBfyqYkvSOROCe0jbaUt3ZBuOo9CHwgRNMI7HqvhUuSiPTqf+2ZQgasJCHLa3n0R4hnoMgVOudiCv+USBukeqSN0w7IHQG3iQzzeQHaBgzpqvZNfSxH+ehhecygXDKbhNStNwBHpLTEqvom1V49CU1mmjeBMYkMiNbiOKNbGWe0nU+4E2QUKxUhHriIWUKzR7XrcFHHA8A6+iGIG6/1sKsOb02TPz18nkB5i8lHAQMvb68cJyL96p+khHG2jcvOLLGid/rNbKW2AFC6UgfiHkq33hXo/xOii+g9/FhTeNstmjrLGdJ xu0fU0ya wGDq63/TM5VysSEIiNTJULuLMBrJRRaaEXXA4IK90AV6A50twqKLJBfWZbxQrsL5S93jEucZr1Eh1IZiC41BOyeRFetW4Thgo2siu1jk73aE4n63ajRTygEuVLkRyiO6U/UikU1lqD+02GYpB/4OsdAaSbjr9bPRjlBlsZSvJSGfVYnknjoVsXOYXSicL6G4Lgr7VZ0I9KGkvfu1xmSrlWwUvf2Ha1jlwEVP/xcSWyG2r4pEf3XR1WykJlRcjitEp1/hzxXMwx/LYY+U6OknrH9abjgIRkrvKo1/higAAs9rY2UISav+M4/ZtVCz6uoG3Ew9UioT0KNHKPBzGOjoN7Zt1lcuWm8Etv9H7JoFiRoCxZNI= 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: Mike Rapoport (Microsoft) Reviewed-by: Vlastimil Babka Signed-off-by: Christian Brauner --- 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);