Message ID | 20240130100247.81460-1-chentao@kylinos.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-44346-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1122960dyb; Tue, 30 Jan 2024 02:33:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVeQNNtI7PF068cJSRNg/U2AMjWuKLlpoHCKFS67E6AZqJ82T9hJCKKtTQ6wOY2eWpj70E X-Received: by 2002:a05:6a00:c85:b0:6df:b9c5:b83c with SMTP id a5-20020a056a000c8500b006dfb9c5b83cmr242090pfv.14.1706610831901; Tue, 30 Jan 2024 02:33:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706610831; cv=pass; d=google.com; s=arc-20160816; b=BRnUzDh4aN5Qs098m1cmEfMdQqvHnKds+2OqzKV8WlMD3WMX5PnyOdfV5+4BjI08m9 VruWdc71pikPTRb6qbm3sOUP9pSn+qRZc9bZ307XNdeS5E7SWnmSpj+AgfJVrYQkEG77 S67bjWE6kJEXcV4jPpvuRH/pEbf/nYgHbqMuzieki+x9EWc3CLt0cjNv3k5HRX0ljvpF rXnz8YC2T9hbzkErynBZ+cu4P8JNY4S8LnhTs6PNOHv3uh/kMa0lJmrxgKA1/BeCvdvo 6VfExONE85sxrUA6mqsTGz3Q9p7J9bAGNJhJVQ5EPk79buJFhb0wrNC/go/NDEqJNuy7 JWZg== 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44346-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id t27-20020a63b25b000000b005d8b2da41fdsi5848251pgo.91.2024.01.30.02.33.51 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 02:33:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44346-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-44346-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44346-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B56EFB290C3 for <ouuuleilei@gmail.com>; Tue, 30 Jan 2024 10:05:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 667B167743; Tue, 30 Jan 2024 10:03:06 +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 <chentao@kylinos.cn>) (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 <chentao@kylinos.cn> To: axboe@kernel.dk, asml.silence@gmail.com Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, Kunwu Chan <chentao@kylinos.cn> 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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789511159895824989 X-GMAIL-MSGID: 1789511159895824989 |
Series |
io_uring: Simplify the allocation of slab caches
|
|
Commit Message
Kunwu Chan
Jan. 30, 2024, 10:02 a.m. UTC
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 <chentao@kylinos.cn>
---
io_uring/io_uring.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Comments
On Tue, 30 Jan 2024 18:02:47 +0800, Kunwu Chan wrote: > 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. > > Applied, thanks! [1/1] io_uring: Simplify the allocation of slab caches commit: 898e3028588e3b6d789774af623d419295c75257 Best regards,
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 = kmem_cache_create("io_buffer", sizeof(struct io_buffer), 0, - SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT, - NULL); + io_buf_cachep = KMEM_CACHE(io_buffer, + SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT); #ifdef CONFIG_SYSCTL register_sysctl_init("kernel", kernel_io_uring_disabled_table);