From patchwork Tue Sep 3 14:20:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 13788785 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 1C2EBCD3439 for ; Tue, 3 Sep 2024 14:22:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 465DB8D0179; Tue, 3 Sep 2024 10:22:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 377048D0151; Tue, 3 Sep 2024 10:22:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 219C48D0179; Tue, 3 Sep 2024 10:22:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id F12608D0151 for ; Tue, 3 Sep 2024 10:22:32 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 9840AC03B9 for ; Tue, 3 Sep 2024 14:22:32 +0000 (UTC) X-FDA: 82523642544.23.A80B4D8 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf23.hostedemail.com (Postfix) with ESMTP id D44AA14000D for ; Tue, 3 Sep 2024 14:22:30 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hGdsgjSh; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf23.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=1725373273; a=rsa-sha256; cv=none; b=4xKwyedCN6A+VeA5DwTw2RcT1ut9OSW4ZdS3m1ipdUGCO+lk8ZiUPOnQ6RFddG82WUSv/O dOS7d05sMo/Ig7AtA3SOzDooQd+eDWJ/E7byoPEMd0rQ0JibT6zi+by368zTc72ncE2vio x4C+kCJvSg/Ox2NKDtMGf1TfZiw45q4= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hGdsgjSh; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf23.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=1725373273; 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=70H4RI2MEzoZOUbJGuPR/tQdQ/7ILOnZjvqPgQ71tCM=; b=TFRoXooyQ4wR5pFzEQVJTkiTQDUZeDz8egf/FfFOwHWGNudHHKLP7cpwZZDig9PT5IDVs2 zqOBonp+12DWYsVqJqPWoL/0x+VOcfjtS51WqiFfu4le7NuaCf+B5CtM+uxymQEPbudgbN vPnflwC+DzrrDWvWedsR8S8dvbSSGUM= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 18B05A43662; Tue, 3 Sep 2024 14:22:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E388C4CEC4; Tue, 3 Sep 2024 14:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725373349; bh=B1znre1e72KpovENRq2WhUqNJBBTL5E5a2ArimpQcWQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hGdsgjShNU2trZTfO0WBjhdzdFWFkHmlXYOn8HDfCT0GXxvKeNgF4wR7j4364QNiY q1wD+/F1glEBVwIUOInyw4qaqmx4U/Oph+rmhif+EMEeXNW9a5ukgf44ThUWBmDYIi s6r+Feb7OUFSWPCiIeWlwCWwlrIDgqGQrCev2KyPGKL2d9Xrh3Kt5i2PDrOFFWYC2p Ps42dhybyCiqsS/P2ys4JCo0fFAdNK5dcBwvyUNllQ2ssvhGcnQjY7A3UMGp33KJlZ 14g0pUVTW37Xs8qGyENRNZfTRhVIZwvxc1frcIpy8vVjZFSQas0GJPOpGCeIHFzX4E 1f1beu4RpQiyw== From: Christian Brauner Date: Tue, 03 Sep 2024 16:20:44 +0200 Subject: [PATCH v2 03/15] slab: port kmem_cache_create() to struct kmem_cache_args MIME-Version: 1.0 Message-Id: <20240903-work-kmem_cache_args-v2-3-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=820; i=brauner@kernel.org; h=from:subject:message-id; bh=B1znre1e72KpovENRq2WhUqNJBBTL5E5a2ArimpQcWQ=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaRdl57930r5SMjm0K8nn3zub9kt13bs1KNlE6zjn196/ CGhZP/b9x2lLAxiXAyyYoosDu0m4XLLeSo2G2VqwMxhZQIZwsDFKQAT2aTByPDq+TzWEP84jutP EhdmX+j96rHG9Zq3e8irf2+2pCxe53Sd4a/Ev+bF1kurI62YuGbzCcysF7Dsqp1xhqWiMWEC607 DC5wA X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: D44AA14000D X-Stat-Signature: bpwkhs93gu5xpjamjqngarmqnh9iwp4o X-Rspam-User: X-HE-Tag: 1725373350-955459 X-HE-Meta: U2FsdGVkX1+9dKy51Hmwb1e1PBSCdYGtjUoKz/SPcnik6dXBjBLXcssQn0jbZEoqw2iSqulEff7hNUy6lG89VODWTyOym+OahRCawkqEU4+vY0bgGh70tbjV+KPPMVlQxCg+8yhc4ugcYPKZPX2VcLHiDm2uca+ngS/gAOBY0Sll4BzH+elXQS1C1MzGgxEXZ+pjiSUUtt7Hg587ximdjQSg61+UK9igJdd7rZY0JM7PY5Oq3ZafDAONtGGSQB6bs1SiHDTQH6HTeiaHVk0aRYqUw46pZf+Lv/2gfI5Cgj6tA9rgBbrU7NWYhIO5EhjA0IIHsveuCt0D20bSvsZJHMnllN5j+8tVilT4G32qPf+vQJjqhQr8EBlSJVTostyIosVPIJ+05xiXeQv+kspg2lTy0dOE1od3XwBW15RxwGV/2LrpsRdLeT++DbpFVqzqb4YIhvddffyUF2znfgyMAGvYwCRITITjcWClyeKVWJN2oqgQx15Qg/nbulqVaWrlsOCC+6hO0usEuEBU5y7SRJTXGQ/+xUlv20R6Dc7EP4KurONJhceAr7KLwbSaidwo7j7DuAf5qKXd7dMP33+tCirPvlhGVzca8Jsm8G6hGj2JUY/43Orgwhshen0NbdqcWk5GO23VVnZ0OzEffgOu0QaEI9bd6Zoz5W61mBMjW0IwuvsPOC+SG/8agevLjT/e+Cat+8ZMGpNw0vJa46UZpUs6JsXZm0kSUtbpxZQp53y+3nc/5wEQo6eXmd8Q5wQVnCPS1cQfddgaGQgJk/G5kclcS0WenZkKavhs/vs9StWVB7+EL49/psrGX93dsIha2obRNU538/yNt5ygPVZlIUYTI6/NYMFPshLzJQI7vOAySbTQebjvBmMfmly30xzoXXY7rWXedmv8azqh6QELWfeoZ7rAo3jSxbhzMdMofF0PllQEoSX5OKpyBiwMJmwc4vgg1aNJ+NG/UnKaXPg +W+QCWOl sdw2DCfxgXu/WaYgTZOe+DDjKw7lsLb/bKxcgN0G0spEcl/cau/bFys1iY99D0MP25fVH0+6sGjj0HMrU34QXkYkI2OanzWAnSFXKw/iZAr9MrCKt6iNRK1cy7YkN1lZ1/xyaTzJb2ALb2F5gq6TmlnC6R9JJY88TvAQtVH/Vb3VuBv3yNihR0UHL3u0vhpXH/hUB0h9d8bgdmCubt/+XsE3WzkHTrK7mqYc6zXmVNR+bgd9/gFR1xafT4cXcBgqOGb+e5SzFJ9NSnPPN9LSkrH72kI3I0aD0wG9/vnorL+OC1ZY= 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() to struct kmem_cache_args. Signed-off-by: Christian Brauner Reviewed-by: Mike Rapoport (Microsoft) --- mm/slab_common.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mm/slab_common.c b/mm/slab_common.c index 0f13c045b8d1..ac0832dac01e 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -439,8 +439,12 @@ struct kmem_cache * kmem_cache_create(const char *name, unsigned int size, unsigned int align, slab_flags_t flags, void (*ctor)(void *)) { - return do_kmem_cache_create_usercopy(name, size, UINT_MAX, align, flags, - 0, 0, ctor); + struct kmem_cache_args kmem_args = { + .align = align, + .ctor = ctor, + }; + + return __kmem_cache_create_args(name, size, &kmem_args, flags); } EXPORT_SYMBOL(kmem_cache_create);