Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp855301rdb; Fri, 2 Feb 2024 06:13:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGXPvxvxL7xCqpslpnjAwkf1j27l8bV8J0B1Sd9WBJAp8rbVIy/EVJOlPcKRfZ1+SieLIm0 X-Received: by 2002:a17:906:e0b:b0:a36:73c0:d204 with SMTP id l11-20020a1709060e0b00b00a3673c0d204mr4079651eji.50.1706883218546; Fri, 02 Feb 2024 06:13:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706883218; cv=pass; d=google.com; s=arc-20160816; b=dhURWO7WIdEmDXfZ2qi0NwyVilbqZDm4HcwgGOqyJb3gVl0BImKbwPEWmVe7wI+0eV wvRwAh1Wcf62p2++JW8Ecf8juLjbZP2z3vf/cix0CC2vCN1piu4aeJPjZMlqGHdVZPHt ssXPM5Fgdz+m2WkyM40o3XRAQEulk4DCw8szP2+5yY7619H2IZsudixzPHvdiUe8pRK0 NQG8DshAZA6XPN+a3fw3B6Bdwv2DwVvnwx+5/JSV/ZjP2z6HjYncyq/aoWrBew0kR1c4 VydGRf9t2AxuLklXm+ueFPQaR+J9r5+PWE+rmLOERjoTRMno/Is3zfHj4Ro1Qy02nSBG Em6g== 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:dkim-signature; bh=Kyb11mpWZpH4YtnbyfMVFqYQ8LuQ/k68oU8pYlRkDos=; fh=J9Iom7jN0FNPaP6W0YN+FEJDULV79T5PEJEl8GTGmm8=; b=CkOD8wloi5STNUeH3RZBDxc/C2kmTL+2GXYdH0p/n9HN/QtkZva4xVBNUb5yQ8T+ix Qrg9bjioB0IOC3/4+Vhr+TeUyZPsIdu9XD9d8iidrUatJVFGmD0gS7Vw5jtp7VpT0MR1 +/3C4gnSmx8hfGU2KxPvOqNPxiIBx394gLwxEtssVY1TRaNhoPmpyDAM+I4WO4+R/l8J wBwOWfnoLhrIOgof3pzG30T+ppQXdYMosi4zjkKZCEXNS3JdRaRddRYKEFfVxOfN6wpr SDoHoiqL/avCaosPArXjrzxTUnyNKi8op2I5j3jV3fFxjfSS5zbLKsOrE3O/nrkcNbyN zqcQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RlPlTYKq; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-49929-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49929-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCVJc/rhMrNwnMZfS4uIRnwG6dcr024s3i6cPaArkrTk3O55uCbUEDA4jpVh1020H3nOJB9LXL29LGyteBJee2OMRUYIM5p3fH1QHGalpA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c13-20020a17090603cd00b00a3707b9c3f8si611062eja.795.2024.02.02.06.13.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 06:13:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49929-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RlPlTYKq; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-49929-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49929-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 4EB631F26B71 for ; Fri, 2 Feb 2024 14:13:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE10D13E226; Fri, 2 Feb 2024 14:13:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RlPlTYKq" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 763F613E20B for ; Fri, 2 Feb 2024 14:13:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706883214; cv=none; b=Oq3RHhmNw8/RLftZGlmStrEE1fufa4Q0OJJ3jJR1WIOZqfHZ0zsZ5b5T7jVcFAEBH5Tn2wxE+bokLm+HzuIkgX4nXGn6QYJP2amNDl4xlw06fT2vB3UQkVEeqhhBLae012SOdMjNjK3wFXLAJ9uuJdFdDlOLnVVPHjlQUUdlkdg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706883214; c=relaxed/simple; bh=aIO6FgmURKrdOF4ruReg1GtNa/bXXSe3uycsd+RcgnQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Xkdjy3tGCZzsVxSiXZZteeaIRpUZJMjCxMhpHYP3+Xgls7mfzX0TczLTWqVJKYMPpO4UH6bLAbPeTdS0EGaR/PadC2jRNa0skT3EPD8w0FaAj2EDCwwXq6XWM8sNV5wTc2FTae9wRSfngxs3Jk4z8+qQ8fs3EquiMUr2/5VCAZs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=RlPlTYKq; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706883211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Kyb11mpWZpH4YtnbyfMVFqYQ8LuQ/k68oU8pYlRkDos=; b=RlPlTYKqoYeSjXhOVWhR1k4mzI1aQdMx4+u464GIIBKoV8HFl1TrwFYyvoJ3QTxfYkWFHB sX9qSCGsXDNo+/96gwPIYRBzSydek9EkCU6jDC4v4526QfRj/5qbYBfo9bqzc9FOL8BM2y fW6mXJ3/Zm7HZn2jffnGx+TRsm3nLBc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-21-vISL8_zhNE6gd2-JfbE3jg-1; Fri, 02 Feb 2024 09:13:25 -0500 X-MC-Unique: vISL8_zhNE6gd2-JfbE3jg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8BB8085A58B; Fri, 2 Feb 2024 14:13:24 +0000 (UTC) Received: from [192.168.37.1] (ovpn-0-9.rdu2.redhat.com [10.22.0.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0D799492BE2; Fri, 2 Feb 2024 14:13:22 +0000 (UTC) From: Benjamin Coddington To: Kunwu Chan Cc: chuck.lever@oracle.com, jlayton@kernel.org, neilb@suse.de, kolga@netapp.com, Dai.Ngo@oracle.com, tom@talpey.com, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nfsd: Simplify the allocation of slab caches in nfsd_drc_slab_create Date: Fri, 02 Feb 2024 09:13:21 -0500 Message-ID: <94F7DA15-6D4C-4205-9A23-E4593A4A2312@redhat.com> In-Reply-To: <20240201081935.200031-1-chentao@kylinos.cn> References: <20240201081935.200031-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-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 On 1 Feb 2024, at 3:19, Kunwu Chan wrote: > Use the new KMEM_CACHE() macro instead of direct kmem_cache_create > to simplify the creation of SLAB caches. > Make the code cleaner and more readable. > > Signed-off-by: Kunwu Chan > --- > fs/nfsd/nfscache.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c > index 5c1a4a0aa605..64ce0cc22197 100644 > --- a/fs/nfsd/nfscache.c > +++ b/fs/nfsd/nfscache.c > @@ -166,8 +166,7 @@ nfsd_reply_cache_free(struct nfsd_drc_bucket *b, st= ruct nfsd_cacherep *rp, > > int nfsd_drc_slab_create(void) > { > - drc_slab =3D kmem_cache_create("nfsd_drc", > - sizeof(struct nfsd_cacherep), 0, 0, NULL); > + drc_slab =3D KMEM_CACHE(nfsd_cacherep, 0); > return drc_slab ? 0: -ENOMEM; > } > > -- = > 2.39.2 I don't agree that the code is cleaner or more readable like this. I rea= lly dislike having to parse through the extra "simplification" to see what's actually being called and sent. Just my .02 worth. Ben