Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp361270rdb; Tue, 16 Jan 2024 02:38:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IEN0x0yIJwaOZtU2sjvnOVMEjrJrlgp/WsZ/cOBZqxEYF24IkRAK+7P5/RbEUobnWpx8/1y X-Received: by 2002:a05:6214:260c:b0:67f:ba7e:8b3a with SMTP id gu12-20020a056214260c00b0067fba7e8b3amr10777285qvb.105.1705401536955; Tue, 16 Jan 2024 02:38:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705401536; cv=none; d=google.com; s=arc-20160816; b=Y4gXNtsPlLEvC10VdqmG8HpX3btw+iLG+O2V0oIGlccLYjxvusd7cDn/7j4ZAKl+7p gdLhbpCy5ziRCuqT/uPVmhpjQYILK4nzUO6F1mAyFlCosqBMo9thE/QdzYAjBwgLF3Pd 7bQcvNNumlpyDBJmaZ0uLvdd9CR42ExTfvDRWz8hdu+KRwrCFpVXqIOJMT4mMowEKr1h ofouCGHPwommFMYlBT8FMNuuG+sWoCle05Z4D6Edl0hsXFECauxV8x8zTYmYuVlTNJBv aZy6u4Pt0PpkSxBpaL3IWo9+/jn1DehLDqWlRWRnh+Uwk4pMDg74e6TyOw6wW/H1B1jK rQtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=XsQ+QDzc+dLNKivH9YysIOMA0F3Q91RojSCj5RO994Q=; fh=TQ0XpW5W06OcHkTnkDTrZtEh3hMPFz5eYq6DwJ3XWrM=; b=eAZ4dgR3xdAs+zt/FC0/abhQF2moNsiPdUPiqr9ZaCcENaAsvLS0ZNer0K+OajMlnY 0uH8ZyRhnGVRyfVqRYtyEnoSmpb0QIuEQlbZvxUxcWgMraV7J5C0Zcv8o/w6FMpbRMn+ FcNUvfDzlRAk4ritFxwMNAAFmMquVL6Uj/VpeTO9v8UKVu/VLVgPbv1CkgSByR80VZ8Y YhdQpUpP+vVmr41hSqWlAL2DHulJtYp/p/oPVLbpJtJBUUANdRMfIUglsf0gIKUaOCM9 jO9FINmg8WuZ2HPTLPbxd3mm7YtHQAcDIhAdO4hCth5lXDt+A0uff2BSjfcAuQnzNOqF Dc1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=T4iXctF+; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=T4iXctF+; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel+bounces-27257-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27257-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v11-20020a0ce1cb000000b0067a395ef2d3si9627012qvl.70.2024.01.16.02.38.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 02:38:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27257-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=T4iXctF+; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=T4iXctF+; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel+bounces-27257-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27257-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 B29591C22E4E for ; Tue, 16 Jan 2024 10:38:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CAA6F13AE6; Tue, 16 Jan 2024 10:38:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="T4iXctF+"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="9Flumjhr"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="T4iXctF+"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="9Flumjhr" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 726B213AC0; Tue, 16 Jan 2024 10:38:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 45EB3220F7; Tue, 16 Jan 2024 10:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1705401523; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XsQ+QDzc+dLNKivH9YysIOMA0F3Q91RojSCj5RO994Q=; b=T4iXctF+el0onzrMKQkvhu2I97CzCmnTvafVPBHkTOlEadIbBiW9sP2fdAXiyTzGVucyLp wjZlX0LhA9oNIkd+JVbvw1/aXw3TpezhRgleGsWVEV04eT4CQjR3eabnxKhBzcXLjsyA7+ Qa/3BP9wZlQ0ZcTNMT/+UkSgnBaph9s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1705401523; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XsQ+QDzc+dLNKivH9YysIOMA0F3Q91RojSCj5RO994Q=; b=9FlumjhrocENccD//Kz+pMPHhuppwUvUMvn3YXaz7etoTVMBLyuHeTakz31/Xe5JOgr2Ht 3M1ZITvfC5xW71AQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1705401523; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XsQ+QDzc+dLNKivH9YysIOMA0F3Q91RojSCj5RO994Q=; b=T4iXctF+el0onzrMKQkvhu2I97CzCmnTvafVPBHkTOlEadIbBiW9sP2fdAXiyTzGVucyLp wjZlX0LhA9oNIkd+JVbvw1/aXw3TpezhRgleGsWVEV04eT4CQjR3eabnxKhBzcXLjsyA7+ Qa/3BP9wZlQ0ZcTNMT/+UkSgnBaph9s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1705401523; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XsQ+QDzc+dLNKivH9YysIOMA0F3Q91RojSCj5RO994Q=; b=9FlumjhrocENccD//Kz+pMPHhuppwUvUMvn3YXaz7etoTVMBLyuHeTakz31/Xe5JOgr2Ht 3M1ZITvfC5xW71AQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3870413751; Tue, 16 Jan 2024 10:38:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id CiXEDbNcpmUPKgAAD6G6ig (envelope-from ); Tue, 16 Jan 2024 10:38:43 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id C3E16A0803; Tue, 16 Jan 2024 11:38:42 +0100 (CET) Date: Tue, 16 Jan 2024 11:38:42 +0100 From: Jan Kara To: Kunwu Chan Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] buffer: Use KMEM_CACHE instead of kmem_cache_create() Message-ID: <20240116103842.g2dxbqno2owkuaqt@quack3> References: <20240116091137.92375-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; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240116091137.92375-1-chentao@kylinos.cn> X-Spam-Level: Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=T4iXctF+; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=9Flumjhr X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; RCVD_DKIM_ARC_DNSWL_HI(-1.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.cz:+]; MX_GOOD(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[kylinos.cn:email,suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_IN_DNSWL_HI(-1.00)[2a07:de40:b281:106:10:150:64:167:received,2a07:de40:b281:104:10:150:64:97:from]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[29.65%] X-Spam-Score: -3.01 X-Rspamd-Queue-Id: 45EB3220F7 X-Spam-Flag: NO On Tue 16-01-24 17:11:37, 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 Sure. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/buffer.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/fs/buffer.c b/fs/buffer.c > index d3bcf601d3e5..9c8156cce9b7 100644 > --- a/fs/buffer.c > +++ b/fs/buffer.c > @@ -3121,12 +3121,8 @@ void __init buffer_init(void) > unsigned long nrpages; > int ret; > > - bh_cachep = kmem_cache_create("buffer_head", > - sizeof(struct buffer_head), 0, > - (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| > - SLAB_MEM_SPREAD), > - NULL); > - > + bh_cachep = KMEM_CACHE(buffer_head, > + SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD); > /* > * Limit the bh occupancy to 10% of ZONE_NORMAL > */ > -- > 2.39.2 > -- Jan Kara SUSE Labs, CR