Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1012532rdb; Mon, 19 Feb 2024 00:58:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWyqKZ5oemAGpEJkL0EVqVaK188o33sQ7BgJZv4oN4NCMOB1y9wFKaWpgBhGR/t9OSTmcvMNSeu9kesZlm8hB9hi3DVeVqBxSmif5q+zQ== X-Google-Smtp-Source: AGHT+IF3BDuoRxmoYDz4YhmkJ737UvFH6rQbb0ENnJyWTE4iOiJxfMN+JZG+fcV9euVijcf9hd5Z X-Received: by 2002:a05:620a:2904:b0:786:d37e:82de with SMTP id m4-20020a05620a290400b00786d37e82demr15848530qkp.54.1708333084689; Mon, 19 Feb 2024 00:58:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708333084; cv=pass; d=google.com; s=arc-20160816; b=VOETB9fxNsOPdQVqxgckJk7gCVr8srViqYqcgQLkM4/yBAuiUwiuu3wDpzfi9ZOsiS BvgIdj2HR/qbOY/2aLNniVq+t58PHOgf+cVGiyTLreRkM+D854R9s0eodG57zNwK18c0 5l6N1ejizO2u73VuBG/hexi71FGooZ0gtqn8q8S2hBm8O/68vw5Q+fTvCHNbYwGy6Rzv K+ZmVr07GysEjPseRDkjf5ECCQKgjKQa0Wy2OF2sxCn/vz9psjZTptWa+8aEwVFDV4Od pYjd9aLWtUbj3wTedE2CHdQpEKv8whJizmwNnQrDl3F6HCpYrv711ogI7BzcuTKzz23M DfVQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=xHWY3x6x0mE8b1gUgP9JXepiM4ESG1H217wd5PdlbH4=; fh=ZUsoa0YyHXLQlHH93ielUFg8wnAie+VT8hwP4zLqjcw=; b=eMP5hyStqb5H26edfIIx908L19niUaHe9FbkmRANombNnKo30Z5F3edYDt8Byt/zlX lE43Y4CWcXgYjbykJMucOpZJ1ws6YUc8ASW2asWzDOKEQrqm/LHXfRDFE3H2WMN3P3ly vvxbElh8gvpW3GVXCdItcY35f0XFdwdbNWVXoRhIthsGU640SfqwIo2OS2BxhtstuWtm HVlgiLoJcblBiC+aJFSQ5q5uFU5lmFKU0VH4zCfarOaEt2u5aT5QpdD6trYBmtAcr01X T5aOj54BbXbHSVfcdLkyi6P7QP1gPjeHv6YitjeDgp4u025fq6O4cDJCKKGH+jX15nPI qaDQ==; 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-70980-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70980-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 a16-20020a05620a02f000b007858aef7ad5si5664175qko.81.2024.02.19.00.58.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 00:58:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70980-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-70980-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70980-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 712FF1C2249D for ; Mon, 19 Feb 2024 08:58:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BABEF2233E; Mon, 19 Feb 2024 08:57:57 +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 582E02209E; Mon, 19 Feb 2024 08:57:51 +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=1708333077; cv=none; b=GEPPqth59abAeewCfHrLPIQDT+vRhVAeH1ZLmZak64gF2aFw4L9QD9LicH8CCFdyvEG6Dh3KIx5D+FFHa7F74ClGKNFDzPg0lBAQw0ac7kGfm0913RBNv4cEBnvEF3DUKvFWQ7cPEusW5NCz677Evu4caZevvigO2ZKd6kGnx4U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708333077; c=relaxed/simple; bh=AET0VbPi7tnBZVJicQf1CS/4zQwiOWTBxN2Xtilmy6o=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tc3HE05CT3gcUeU3Xd0oyZJ8oLFkEXVZ9bKZtHkjzaveZ4PNaAqBfY/1+JfKN7geCtbmgoEl+6qRITsjXejq7wyIpG3i/IvhHFLnu3tm7gLgQ1ryPUMqzAj+7FU0uBXAXFRuyYA412clBkRqmvGf6TuQ+82zRaFSiVKxbL4Xvkg= 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: a27d5500c6c44550a1d72c18dad94312-20240219 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:e79eded5-457c-4673-8f77-adae0cb2019e,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:e79eded5-457c-4673-8f77-adae0cb2019e,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:01b7748f-e2c0-40b0-a8fe-7c7e47299109,B ulkID:240219165238P8MQKDBO,BulkQuantity:0,Recheck:0,SF:19|44|64|66|38|24|1 7|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_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI,TF_CID_SPAM_SNR X-UUID: a27d5500c6c44550a1d72c18dad94312-20240219 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 114299905; Mon, 19 Feb 2024 16:52:37 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id D1297E000EBC; Mon, 19 Feb 2024 16:52:36 +0800 (CST) X-ns-mid: postfix-65D316D4-787504167 Received: from [172.20.15.254] (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id DF1D7E000EBC; Mon, 19 Feb 2024 16:52:34 +0800 (CST) Message-ID: Date: Mon, 19 Feb 2024 16:52:34 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] zonefs: Simplify the allocation of slab caches in zonefs_init_inodecache To: Damien Le Moal , naohiro.aota@wdc.com, jth@kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240205081022.433945-1-chentao@kylinos.cn> <4af4be6e-2c58-4c14-ad2d-eb3f8101a0c1@kernel.org> Content-Language: en-US From: Kunwu Chan In-Reply-To: <4af4be6e-2c58-4c14-ad2d-eb3f8101a0c1@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for the reply. On 2024/2/9 12:06, Damien Le Moal wrote: > On 2/5/24 17:10, Kunwu Chan wrote: >> Use the new KMEM_CACHE() macro instead of direct kmem_cache_create >> to simplify the creation of SLAB caches. >> >> Signed-off-by: Kunwu Chan >> --- >> fs/zonefs/super.c | 6 ++---- >> 1 file changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c >> index 93971742613a..9b578e7007e9 100644 >> --- a/fs/zonefs/super.c >> +++ b/fs/zonefs/super.c >> @@ -1387,10 +1387,8 @@ static struct file_system_type zonefs_type = { >> >> static int __init zonefs_init_inodecache(void) >> { >> - zonefs_inode_cachep = kmem_cache_create("zonefs_inode_cache", >> - sizeof(struct zonefs_inode_info), 0, >> - (SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD | SLAB_ACCOUNT), >> - NULL); >> + zonefs_inode_cachep = KMEM_CACHE(zonefs_inode_info, >> + SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD | SLAB_ACCOUNT); >> if (zonefs_inode_cachep == NULL) >> return -ENOMEM; >> return 0; > > I do not really see a meaningful simplification here. Using kmem_cache_create() The main reason is 'it hides all the 0 or NULL parameters'. > directly is not *that* complicated... Also, this changes the name of the cache > from "zonefs_inode_cache" to "zonefs_inode_info". Cache name is used in /proc/slabinfo to identify this cache. > Thank again for taking the time to review and reply. -- Thanks, Kunwu