Message ID | 20240131094323.146659-1-chentao@kylinos.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-46157-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1775498dyb; Wed, 31 Jan 2024 01:44:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXKthb24UCLC3IDL2/7IGVPCfsDZNfu7jzdGiP6ZQUrrfkKnhogf+m7hZDngkC+nklUqP5 X-Received: by 2002:a17:906:c318:b0:a36:6f2f:7628 with SMTP id s24-20020a170906c31800b00a366f2f7628mr970305ejz.2.1706694261243; Wed, 31 Jan 2024 01:44:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706694261; cv=pass; d=google.com; s=arc-20160816; b=Zp+PGqcNivvzZ3j3y38/YD0dQaS4wpNZZJLfXuxgiTpE6DrpLZqpiYh6TjsPmGL04o ZrmnS74SoMpTvFpTi+JeCMlYoxVT3pEytbEtXR0pN5HpYprCAyXEgcGqaNpxWTAGOWeu k99zl5xTp0vav2EgKqvu21galtnhkVZIytw7kVsPrtIao20yi82pXzzplUk4G5AXz8Gk aHTU8hNaExQDZNJmn2Ji1xxi3Xb2050vLHkEiZtpJ2bipt6kx3B/8w8yhciIMBeCHTSc /uhKWC+Mwc8u7zupQO4Cv4meYFQwP5uetB3o0vSXE8Hu/apgjnp2DEJU/ofQnhS//FEO vfHw== 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=7A6r6SERfTNGzoel7P+M8PvnBJ38mQJWZ7qiAhmYqGA=; fh=/TDtfQGn8zN1+cUY9xaQ8cBCvfWtHp2NE97t1PYvXng=; b=iCpuVZmfZXEH3P4O3CNrAK8HWqW8oPrLdt6MOP4H4jdVfYleSWsNnyIHwl3lJy9ZkX g5dxFg+2UAvLOrpX5AYZzOpBe+PuC5Sryj5eVkSvj8rQUaNV15EfF0Bzz4iU9txRre0G y9qfjNIxZCnA/OgbUgHYtQK3sumQ7d0wwimwhUpBaX4IqXkySL/5CbC3M8pjrvfzLZYr ClNLaqPc3rvtEdF8rtzBjfLCRcwKgDDG9cQDbbrjBmVk2Kwqy4MpzdVsgjxOsLPrWoFU 3hoik/m809Ag/Q83TIu+nl2QD0jy4/2qsJgoLBw7M4C5ggYT8anyczqgYaL+rEo7ectU r6BQ==; dara=google.com 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-46157-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46157-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVRCPF1UDRP7fr5uvcK5817Y4Oy5ZDhChmdo9jjbuRu7KdgYQn6UCJmzlHlor89JHQXX1eFxK8MH+PUPQd0VFU6FLRnqQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id xa12-20020a170907b9cc00b00a35a6e584e8si3127171ejc.454.2024.01.31.01.44.20 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 01:44:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46157-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-46157-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46157-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 82C101F2A79D for <ouuuleilei@gmail.com>; Wed, 31 Jan 2024 09:44:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C31769D20; Wed, 31 Jan 2024 09:43:41 +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 E47A369946; Wed, 31 Jan 2024 09:43:34 +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=1706694220; cv=none; b=Hn/o8goL/Fqzc3kXfpb9rWD0zzo93sPS85xgojRfrZ2n64QPFIOF8Oo/MFip0JYkY8lb3KXKJeoT01fQniSkFT+B1JY82DJwzl8r6x29icLkQhdBR2c4WqnVT5jQbFH3gARSWMmuWW2D0/mQ0mPHJfWfX1u+F/deBcoY/zCmkLo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706694220; c=relaxed/simple; bh=WsYGGzm0F3dQ6/wcAMA18RrThIlvQvZG/zk8rYg2uCY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=YP7aBsrkTCNykZglpkgRVlo3wiWhy10WAOcQEhdIWsulQegRCwXau9K5qWyRbwgKCQHA8MUIfllkjnlWIblR+h9sTxlTTiqnDJeOLqCMJkBsNsjxAMtLPlmOqDLTkV4B6MzBDL2sbb1FjPSbpQGElXHrIwMtBv8DvnhP9JXwgIc= 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: 2647e6bb8f1747718792413957e60165-20240131 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:a68bdf03-6d53-48aa-9e37-dffe91fce23d,IP:20, URL:0,TC:0,Content:-5,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACT ION:release,TS:0 X-CID-INFO: VERSION:1.1.35,REQID:a68bdf03-6d53-48aa-9e37-dffe91fce23d,IP:20,UR L:0,TC:0,Content:-5,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:0 X-CID-META: VersionHash:5d391d7,CLOUDID:df9ff57f-4f93-4875-95e7-8c66ea833d57,B ulkID:240131174329P1TI2LZ4,BulkQuantity:0,Recheck:0,SF:66|24|17|19|44|102, TC:nil,Content:0,EDM:-3,IP:-2,URL:0,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_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 2647e6bb8f1747718792413957e60165-20240131 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from <chentao@kylinos.cn>) (Generic MTA) with ESMTP id 260317277; Wed, 31 Jan 2024 17:43:27 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 7216BE000EB9; Wed, 31 Jan 2024 17:43:27 +0800 (CST) X-ns-mid: postfix-65BA163F-267981979 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id 10A4DE000EB9; Wed, 31 Jan 2024 17:43:26 +0800 (CST) From: Kunwu Chan <chentao@kylinos.cn> To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Kunwu Chan <chentao@kylinos.cn> Subject: [PATCH] block: Simplify the allocation of slab caches Date: Wed, 31 Jan 2024 17:43:23 +0800 Message-Id: <20240131094323.146659-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: 1789598641665547621 X-GMAIL-MSGID: 1789598641665547621 |
Series |
block: Simplify the allocation of slab caches
|
|
Commit Message
Kunwu Chan
Jan. 31, 2024, 9:43 a.m. UTC
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>
---
block/blk-core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
On Wed, 31 Jan 2024 17:43:23 +0800, Kunwu Chan wrote: > Use the new KMEM_CACHE() macro instead of direct kmem_cache_create > to simplify the creation of SLAB caches. > > Applied, thanks! [1/1] block: Simplify the allocation of slab caches commit: 48ff13a618b54aabc447659a9016068cf0cae322 Best regards,
diff --git a/block/blk-core.c b/block/blk-core.c index f28859b4a3ef..6898d2e6e3c4 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1224,8 +1224,7 @@ int __init blk_dev_init(void) if (!kblockd_workqueue) panic("Failed to create kblockd\n"); - blk_requestq_cachep = kmem_cache_create("request_queue", - sizeof(struct request_queue), 0, SLAB_PANIC, NULL); + blk_requestq_cachep = KMEM_CACHE(request_queue, SLAB_PANIC); blk_debugfs_root = debugfs_create_dir("block", NULL);