Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1459318rwb; Wed, 9 Nov 2022 18:48:37 -0800 (PST) X-Google-Smtp-Source: AMsMyM7m9yikYYUwFuf3MqKyjy3lUPvADnqfEUc/SrkGkQc15joYhTGOF2+SQ/CgfBmHJQ2ShSGM X-Received: by 2002:a50:951c:0:b0:461:9d22:348d with SMTP id u28-20020a50951c000000b004619d22348dmr1440739eda.76.1668048516899; Wed, 09 Nov 2022 18:48:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668048516; cv=none; d=google.com; s=arc-20160816; b=VlCjXw1f0n1J/fBnQMG/Sg9TEA64l81S9Uumq3XeAazyymada2Ou2DArnrrQFyVtKy FyvvXUhzB+k7eFRN3wc/fi2qTroqVIjPaiYNVzsvtnunb4upiN4q2jS/ztT3nC5A85Ce os/MnZTjicIzV4XjGw+4WClw4Ud8Uxkp2xzk94VtbuO6YEsxVbEaoes3kXYfDeslOFIx D+Bg5xrPBVe9HCFpJqHhyz+48NSwLANxYQORlVHagZyvCI1tBqbN962zJlBJbDvU9T8u uJ4FvRZ+OBfLkBom+YKc5+k6TvCnXN5CEZl+C2+MVG3zgsP7rzUbHDMlacd+8mJmm4Lp TcCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cTc/KSBuskxtu5l8CHNwsRhx/NF/SjTTlD3QxcMUFFY=; b=SRPWymLfUqceX+G7ASjXJZ5cnqPmJE0r2nK3A58hGbpKQAj7v30UqRwR+GrCzi2SS3 lKHIV5DRn6jzXfTVEETfC1f+OG4JKA+uMEVHnddDljxLNXT7c6gLcjKNYHcc1bXNiE58 Fql8ZNHWbRXiqTbbqyzbuUoJSgJ5tsU2BDg8LWYyL2R+re00WHZxjLE20Qj5pJ8A1hax DsQ5sNl1ujWijFs5ZZ0tZId9TNnThTyrI3GoGILWHuC5taMe054u8p9qzXepZ5uHFKAX HNq53Mg0FEItOtp/MyIcQjIW+64Cp9OWJ9fpY4eNdyk0STFaKpKBtO9WPw7a95FGhX6u 3WYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FBM5IOLE; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y22-20020a170906449600b007ae87dde2c7si2582487ejo.830.2022.11.09.18.48.02; Wed, 09 Nov 2022 18:48:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FBM5IOLE; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232174AbiKJCrl (ORCPT + 99 others); Wed, 9 Nov 2022 21:47:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231987AbiKJCrk (ORCPT ); Wed, 9 Nov 2022 21:47:40 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6D1318383 for ; Wed, 9 Nov 2022 18:47:38 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7E7F0B82053 for ; Thu, 10 Nov 2022 02:47:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEE06C433D6; Thu, 10 Nov 2022 02:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668048456; bh=L+Uqwg2wLhfKrfuCf6FbvGQZAKxTgEfUj9wJB4PzXXw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FBM5IOLE2ZPXniO8G7k/hUvYrz57P8WS7q1GO3oQBos1hZ7aWH/iMJ1b1w03KqgH1 L2XYaOHSTFNQ2RqbNhoXqZ1l5du6dyvu5rYG5AJIFzaOaNRSYbIyvpLCmihB+feq9z J0GMbDQCvQZaFEge9ZxeSAEmFOWIF7VsdWrlxVqV9LpudXq0Zczx254BYjsfbtedqk wbqS36St1lueJxtpMF6Npf4iRUWC7J1wuGLqJlS/gNMhmc+y9edvBGYYztPRCUfhGR a0Q+ehTpSyyEgZLHRgQoGXLhrJ786II8bCkkh9XxAYTmE9Np666jgwvImgPJtAFQh6 CMYPgI9VXt2bg== Date: Wed, 9 Nov 2022 18:47:34 -0800 From: Eric Biggers To: JunChao Sun Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz Subject: Re: [PATCH] ext4: replace kmem_cache_create with KMEM_CACHE Message-ID: References: <20221109153822.80250-1-sunjunchao2870@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Nov 10, 2022 at 08:53:26AM +0800, JunChao Sun wrote: > Yeah, maybe we should remove the SLAB_RECLAIM_ACCOUNT flag for static > slab, and 16828088f9e51815 ("ext4: use KMEM_CACHE instead of > kmem_cache_create") have done so. But should we remove > SLAB_RECLAIM_ACCOUNT in this patch or belong to a separate patch? I'd just keep the slab flags the same in this patch. If any flags do need to be changed, that should be a separate patch. I think SLAB_RECLAIM_ACCOUNT is meant for for things that are directly reclaimable, such as struct ext4_inode_info. Inodes are evictable, and when that happens, the corresponding struct ext4_inode_info gets freed. bio_post_read_ctx_cache probably should use SLAB_TEMPORARY instead, since it is only used for temporary structures during I/O. That being said, SLAB_TEMPORARY is currently #define'd to SLAB_RECLAIM_ACCOUNT, so currently it makes no difference in practice... - Eric