Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1592587rdb; Tue, 20 Feb 2024 00:25:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXiV7exUTuaT9/ggBAMf6/MtAnWRXG//XSV26BoyK29AaiUi9LIXgc9uIFGd5ionT6T8AVnZXyaKGe/8aDeuc7YkULLKTEh7AFKc9aWiQ== X-Google-Smtp-Source: AGHT+IGrFsj/HZgvZzPINMe7BSL/sV9QRW8t9a1KPff8YC9Jvx4xm9lJE3ETLuYIbywPCCkKvewi X-Received: by 2002:a05:620a:2a15:b0:787:7add:116e with SMTP id o21-20020a05620a2a1500b007877add116emr527102qkp.33.1708417543475; Tue, 20 Feb 2024 00:25:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708417543; cv=pass; d=google.com; s=arc-20160816; b=psbXbJ3f/5viZ3nApsMyt7XWU2E//mmw/qBxRnLmKIUGKK1HY9sWVNE3adwK56rYU7 oHEar+ywElgfumxQLv4ku1fho1bsZ8E39Lui1S+e23UjijoK0VMyMnnaMN/KmrOJ4a2E MxL7wYAJplaZ5tfu4AuzkJapMA4NYH5jJhOFOrqS+msK/cPOfpuHKTP/MeikzNMC4UCq OeVBvL+Ac7hnN0FGGf907yPfdHBiYsZEh+UpMxNWR/rY+74xXphOpeouQ+nowmSJ03a4 jZ7SEvZcTzOiXblMd6TpdrBKq+NGRnDIDx0MkERGMOad+NqlI4R2bx854vSYvIq5OAkH lP7g== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72545-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f3-20020ae9ea03000000b0078770fb0835si2390920qkg.542.2024.02.20.00.25.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 00:25:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72545-linux.lists.archive=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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72545-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 8F7A31C210D0 for ; Tue, 20 Feb 2024 08:25:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECCFA5D46F; Tue, 20 Feb 2024 08:25: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 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 ) (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 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 , Michal Swiatkowski 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Reviewed-by: Michal Swiatkowski --- 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 =3D -ENOMEM; =20 - kcm_muxp =3D kmem_cache_create("kcm_mux_cache", - sizeof(struct kcm_mux), 0, - SLAB_HWCACHE_ALIGN, NULL); + kcm_muxp =3D KMEM_CACHE(kcm_mux, SLAB_HWCACHE_ALIGN); if (!kcm_muxp) goto fail; =20 - kcm_psockp =3D kmem_cache_create("kcm_psock_cache", - sizeof(struct kcm_psock), 0, - SLAB_HWCACHE_ALIGN, NULL); + kcm_psockp =3D KMEM_CACHE(kcm_psock, SLAB_HWCACHE_ALIGN); if (!kcm_psockp) goto fail; =20 --=20 2.39.2