Message ID | 20240220073646.102033-2-chentao@kylinos.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-72545-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp261356dyc; Tue, 20 Feb 2024 00:26:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVogaONh4e/eCswBCipgm71ShNJwhehv/u6QDg4+KCZNj6UiSoVhnAee86XX7gyWA+ROvz8HUPNPpNiv79yma6iC/k0IQ== X-Google-Smtp-Source: AGHT+IElCBfrEbt9CKPbmjJ45tw36iIr1Yn1eYqejq5rJkH1/4WZiNXd1WGlVdSihWMgAfiqp/58 X-Received: by 2002:a05:6808:1987:b0:3c1:67e5:90fb with SMTP id bj7-20020a056808198700b003c167e590fbmr726242oib.50.1708417574365; Tue, 20 Feb 2024 00:26:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708417574; cv=pass; d=google.com; s=arc-20160816; b=jqBv5CEPk9qWdkNHICm39YsxrXwiWV4C9InoIJo/t+Ax2JNLYfojN2Rz3/MD/hukoY jmxNKEfsRtSerCDDwY483ETS/0pyt9R4fO9xKdprLSReYjf0/+ayE0FsFpOiK1Rd7Rsu EniCgndzCkKgjZzA754vN6e5YNI77IR2z3gkcVwo80L+nASeVHdHUHW3mPIE0kZ1yqo1 QfBGKQgJaFoILietvj5B2X+7D+PP44Nn48UqxvEaUbuxW+Ike91Px64zI24hXwgoT/C4 eibm71JOSvNzOuIYgTCexFDD+PMDzmcixX6UFc9WPxVrAw8zDbniLDcmRJmHW2k0S1vx JpTw== 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:references:in-reply-to:message-id :date:subject:cc:to:from; bh=0lribtFqUysLbyEnjkjllNi1guygumft79zgdIQK4jc=; fh=wev17V6zO4SsTygeysrUJquweJVSB4bTv6PRUfTqFGg=; b=voWSI0+H+YleUYc3BZZsRqk2tFUKIHD5J5saFyhE8IK+lFX387cm2VjtdyBIIdzgkY w+TPRlzTlOU7AHbgXKiM4HNCgMkd3dXitV3saehX6VISXasGbB9q3mAVvw/QLsP9LXjM /io4HoKShwMRwXaPTTOfSFFvXqG2juojTEc1d3WH5T+6ZjJvmYfC8b1qxKq5c04N2+a5 qylsGgLTgCi0LiMzEcGZK5xr5QMA7WjGsRBgLJb1fCUvwz0gKkzZWJRqhbSB80DEzUPu R4SOM1549asxyV1GowbVWsjY2b+MlZZujdbjUGMVQALaVEhmvDVfd1FPLb06TCh8zpah 8N1g==; 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-72545-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72545-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h20-20020ac85154000000b0042e28dea973si727845qtn.171.2024.02.20.00.26.14 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 00:26:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72545-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-72545-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72545-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 235FE1C20AF3 for <ouuuleilei@gmail.com>; Tue, 20 Feb 2024 08:26:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63D365E3AF; Tue, 20 Feb 2024 08:25:07 +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 CF1605C8E9; Tue, 20 Feb 2024 08:24:59 +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=1708417505; cv=none; b=oGlozK5egtY4bGBWsO0nkZ2aEz68fv7XHqbVVCkc932eBxWCFfBF3I1NjxK3bacOhyUFNeECCsyZLaut2LH3/1JGHVAdjVWHwiv9m8a1EqsdD2pIsptNXxkpLvHe2Eogi5V4SyNx4IfgtekfMVtEIGrIqYbxTyaJ9DAQDBUgvqU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708417505; c=relaxed/simple; bh=aGMZvL1E+Kg3YalVE1lVohFSTudazOHSLjbToygnCs0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YN2LDKeeIXU2HWGx+TR/qqtoUUaJgB6h/GawHbKXc6VE1b8AwvyoOH/h8BhUItEiPPBMza/n/ugnQVzmsGpxIshwI+dUiLR+qPF23flTZoIi8x534EIU/xdLtBGfDAzj5uC/FtQsgJ7ShdhacoXOj970uvtbYntSFRTLvu1FE+k= 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: 76a16fe503ca45c88fb8ea4a64c05306-20240220 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:87b0dffe-d672-4843-b988-436162f7c16f,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:87b0dffe-d672-4843-b988-436162f7c16f,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:d9f8fcfe-c16b-4159-a099-3b9d0558e447,B ulkID:240220153655JDMHATEQ,BulkQuantity:0,Recheck:0,SF:44|66|38|24|17|19|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,CO L: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: 76a16fe503ca45c88fb8ea4a64c05306-20240220 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from <chentao@kylinos.cn>) (Generic MTA) with ESMTP id 1016564439; Tue, 20 Feb 2024 15:36:52 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 85748E000EBC; Tue, 20 Feb 2024 15:36:52 +0800 (CST) X-ns-mid: postfix-65D45693-91819618 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id 1C4B1E000EBD; Tue, 20 Feb 2024 15:36:51 +0800 (CST) From: Kunwu Chan <chentao@kylinos.cn> To: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jiri@resnulli.us, Kunwu Chan <chentao@kylinos.cn>, Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Subject: [PATCH net-next v2 1/5] net: kcm: Simplify the allocation of slab caches Date: Tue, 20 Feb 2024 15:36:42 +0800 Message-Id: <20240220073646.102033-2-chentao@kylinos.cn> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240220073646.102033-1-chentao@kylinos.cn> References: <20240220073646.102033-1-chentao@kylinos.cn> 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: 1791405666015107781 X-GMAIL-MSGID: 1791405666015107781 |
Series |
Use KMEM_CACHE instead of kmem_cache_create
|
|
Commit Message
Kunwu Chan
Feb. 20, 2024, 7:36 a.m. UTC
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. And change cache name from 'kcm_mux_cache' to 'kcm_mux', 'kcm_psock_cache' to 'kcm_psock'. Signed-off-by: Kunwu Chan <chentao@kylinos.cn> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> --- net/kcm/kcmsock.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c index 1184d40167b8..bdc3e58a9b2b 100644 --- a/net/kcm/kcmsock.c +++ b/net/kcm/kcmsock.c @@ -1877,15 +1877,11 @@ static int __init kcm_init(void) { int err = -ENOMEM; - kcm_muxp = kmem_cache_create("kcm_mux_cache", - sizeof(struct kcm_mux), 0, - SLAB_HWCACHE_ALIGN, NULL); + kcm_muxp = KMEM_CACHE(kcm_mux, SLAB_HWCACHE_ALIGN); if (!kcm_muxp) goto fail; - kcm_psockp = kmem_cache_create("kcm_psock_cache", - sizeof(struct kcm_psock), 0, - SLAB_HWCACHE_ALIGN, NULL); + kcm_psockp = KMEM_CACHE(kcm_psock, SLAB_HWCACHE_ALIGN); if (!kcm_psockp) goto fail;