Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp906846rdb; Tue, 30 Jan 2024 02:06:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3GIX0Q8oJlOetPRfw3TURwxIbKLmGKckAAyAA9CNSCPfyuMHnDcPPBbs92Bx/CH0sTaj+ X-Received: by 2002:a05:622a:15:b0:42a:600c:2d84 with SMTP id x21-20020a05622a001500b0042a600c2d84mr10642564qtw.38.1706609179951; Tue, 30 Jan 2024 02:06:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706609179; cv=pass; d=google.com; s=arc-20160816; b=bs0SFWNptAounO2kl3+SW/i2tUlUUF/nLR3JoJVCxSbbydLYgOLwF9r7CQoudqJUy2 tcDATv5B7WtNYnUeQrxKWlGVfN4XMzrcoWb7oviZznuthKchLk+XeBFnC2vdFYLg2uY2 xJVivcjY9Olkp4lQtBymicOV8gMYMrEeDKJiBkRWbohB431ZuS/ueNufxYtOg3VOk8Yr 158k67xBj2r1gBjxUOYzaaE0dZIWlOFRB3GzefR9uw13TvLz4HQImR22cLiwor/s9dCF eFgNKLc2ixYjfKRfIasbd6cGIkmaQlxxQTYVvt0xEyiBGeZCrbRsjSfJGMcZCZ947L11 ejCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=3DQjtD39hfKGylvKykMHvPERuNIO4wbNDJq6hoQKBS8=; fh=/omPZ8i7CSNJQ4/E3dqAMHYVgZ29BBzWokFNFeVbY+I=; b=TxednVz9WpX0bwZALjYahOp0+6BXZxEYAFfGpQj17WehxMsF8TdC1jTUmqm6gjVPQe 1OJFxK6e5BLotGuLUMTcl0q3tbXMO9OV5nG/0NsGS8WwCRPMwz/QuKbecy6+bbi8tRAs pU4tRoCChXcDV/82sBP9AWJZ81+T9DL/bDZGZkCiyaHiC0WjCbcDuJ49zUBzx20E2XfV gveh6A3poEyrQ90SHrlqXbeaclM1W8jw3QCspou/Fuieo2HpnsVdL8wHCNMBp5DHbl+F TF8OZ1deti+Nu+BejMAPwtQlgBg7T8fQTymNrVSBnGCY5RdKmVN7mVp2G/H86dkbE3s1 iY6Q== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-44346-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44346-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g14-20020ac85d4e000000b0042ab03605aesi2298766qtx.801.2024.01.30.02.06.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 02:06:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44346-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-44346-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44346-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 321C21C272C3 for ; Tue, 30 Jan 2024 10:05:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D71F67728; Tue, 30 Jan 2024 10:03:05 +0000 (UTC) Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF85F60BBB; Tue, 30 Jan 2024 10:02:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608984; cv=none; b=Lz+t/vwqCJvD+Su3Jo32MjKDsC5FphQ0mcSM9hOjP+k6GPytIYe8OhxFiF3GHhrCabhGQJSwPiwbWEjRfbWl1u01iEaVSjMVMSIuEyfWvbDkOyftSkpJc302MHl9HNStEGdoh87npda829DzHZsi5LC6WJ8hR9bcbKzv1kNGFkQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608984; c=relaxed/simple; bh=chGWEln/xl2IgQzp0pg8bGFsb7zFOeDgHEalUKmpMWc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=eXkhhrDnCFGaTPPBGqWpQrCOZJRD3S8zeyPlWqQ1Zzfwt1FKMgrKqRsd5gcg3e+A6DFdA92WZ0Uv8hteleMBxBv4kTFzoPXcYRWB86Ssdrk7TQvbueeOyFc/hZZwX1llHOUDHcp7V5Vbv/x29IJ7VTvNhVaG9dSUGwSnGpjT+/8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: ece618e1cf814360862a7ff9215f02dc-20240130 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:aae264a8-4af7-494a-b93d-e5201429f6f8,IP:10, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-5 X-CID-INFO: VERSION:1.1.35,REQID:aae264a8-4af7-494a-b93d-e5201429f6f8,IP:10,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:5d391d7,CLOUDID:8777ea7f-4f93-4875-95e7-8c66ea833d57,B ulkID:240130180251FTY18M0A,BulkQuantity:0,Recheck:0,SF:66|38|24|17|19|44|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil ,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_ULN,TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD, TF_CID_SPAM_FSI X-UUID: ece618e1cf814360862a7ff9215f02dc-20240130 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1033402814; Tue, 30 Jan 2024 18:02:50 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 06041E000EB9; Tue, 30 Jan 2024 18:02:50 +0800 (CST) X-ns-mid: postfix-65B8C949-7875361294 Received: from kernel.. (unknown [172.20.15.213]) by mail.kylinos.cn (NSMail) with ESMTPA id 79CF4E000EB9; Tue, 30 Jan 2024 18:02:49 +0800 (CST) From: Kunwu Chan To: axboe@kernel.dk, asml.silence@gmail.com Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, Kunwu Chan Subject: [PATCH] io_uring: Simplify the allocation of slab caches Date: Tue, 30 Jan 2024 18:02:47 +0800 Message-Id: <20240130100247.81460-1-chentao@kylinos.cn> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable commit 0a31bd5f2bbb ("KMEM_CACHE(): simplify slab cache creation") introduces a new macro. Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Kunwu Chan --- io_uring/io_uring.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index cd9a137ad6ce..9a810b1169f2 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -4175,9 +4175,8 @@ static int __init io_uring_init(void) SLAB_ACCOUNT | SLAB_TYPESAFE_BY_RCU, offsetof(struct io_kiocb, cmd.data), sizeof_field(struct io_kiocb, cmd.data), NULL); - io_buf_cachep =3D kmem_cache_create("io_buffer", sizeof(struct io_buffe= r), 0, - SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT, - NULL); + io_buf_cachep =3D KMEM_CACHE(io_buffer, + SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT); =20 #ifdef CONFIG_SYSCTL register_sysctl_init("kernel", kernel_io_uring_disabled_table); --=20 2.39.2