Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31C1AC433FE for ; Wed, 12 Jan 2022 02:55:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348974AbiALCzL (ORCPT ); Tue, 11 Jan 2022 21:55:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348961AbiALCzK (ORCPT ); Tue, 11 Jan 2022 21:55:10 -0500 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61CE7C061751 for ; Tue, 11 Jan 2022 18:55:10 -0800 (PST) Received: by mail-yb1-xb2f.google.com with SMTP id m6so2455433ybc.9 for ; Tue, 11 Jan 2022 18:55:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DjG0MxzMFp+mXx/fhnGFPP77MfipZrWjEmzToKHDYMs=; b=6ayrnxbcnFPPUmYvOduF6Pq8fL2AVcsSL/nubUFKSkA7/WgCyNwQdZQdDzMwsZ4Iu0 OXroeHV85F09Q6q2lr0/5r/gpbOga2pzMo6oV1EFUARsGfTa7BYSHl4xZ5wzJL6CIduH iT6L6X2WXlOe27ZoL3BpfdmLF0LpMmSfe49ksQFPud2lkCL/06AcTkpTmknzS5a+8rbI kPfm6lvx1fQEUzj3n84koZ6w71PtBk2WY7ahFYrFnZaAJulE3yCNpyVKFLjDhM6Mj1TJ QsbPEC7V7dg1O7Y+iEtXb9UGx4ExjcJRz9aecVvHlJMyUxUym4J32jZsUqWkt9dpnHPY FKnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DjG0MxzMFp+mXx/fhnGFPP77MfipZrWjEmzToKHDYMs=; b=hFRulI4NTenEyf/ydW9QZBcS6ARNhbRRSffMPXtjX8xUgs2JEIjO1GMCmSwAspuzyr vtV5ekwX3aRcpJ4ooKpS7v5gjODdva5WMcR4jrtZAdk4+Z1N+R6zqmMr0JTbMHCi5LL8 yeqqxrRZ2DLT2rEgcTsdJuf0a+7UCwEZizHl8dssFt6cJriDd8n7C2Dr5ah22B3rc0+4 +Gb8PPAjt+QaTq6nQi3E307BF7uYxDgsLAHzzcftrmutNUCI0PJ7W+JFs0D7QVYTMcf0 hvg1JApxhi1khYhB7pGNKFhstlmulHRnE7o0/CDtCmgN6F+styaxo5tMICv3NsI2s1te BZlQ== X-Gm-Message-State: AOAM531CU/RIPOefIGFG16Cm1M5A8/bSahmS9x9KZRclQOvbEo1XW0rl RzqSCBpuAOInz5t0FgbNgxEmttbWUyuVPV1CfXaZRQ== X-Google-Smtp-Source: ABdhPJwHIWCaocHbRKCDyMX3VTIF7z/62FPkM6VJ/tLncpXUrm6uc9D4GQFcLEa7fX824hQsBn3XLLVsBaDv2Ms1ps4= X-Received: by 2002:a25:abcb:: with SMTP id v69mr10514951ybi.317.1641956109479; Tue, 11 Jan 2022 18:55:09 -0800 (PST) MIME-Version: 1.0 References: <20211220085649.8196-1-songmuchun@bytedance.com> <20211220085649.8196-4-songmuchun@bytedance.com> In-Reply-To: From: Muchun Song Date: Wed, 12 Jan 2022 10:54:32 +0800 Message-ID: Subject: Re: [PATCH v5 03/16] fs: introduce alloc_inode_sb() to allocate filesystems specific inode To: Roman Gushchin Cc: Matthew Wilcox , Andrew Morton , Johannes Weiner , Michal Hocko , Vladimir Davydov , Shakeel Butt , Yang Shi , Alex Shi , Wei Yang , Dave Chinner , trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, jaegeuk@kernel.org, chao@kernel.org, Kari Argillander , linux-fsdevel , LKML , Linux Memory Management List , linux-nfs@vger.kernel.org, Qi Zheng , Xiongchun duan , Fam Zheng , Muchun Song Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 12, 2022 at 2:55 AM Roman Gushchin wrote: > > On Mon, Dec 20, 2021 at 04:56:36PM +0800, Muchun Song wrote: > > The allocated inode cache is supposed to be added to its memcg list_lru > > which should be allocated as well in advance. That can be done by > > kmem_cache_alloc_lru() which allocates object and list_lru. The file > > systems is main user of it. So introduce alloc_inode_sb() to allocate > > file system specific inodes and set up the inode reclaim context > > properly. The file system is supposed to use alloc_inode_sb() to > > allocate inodes. In the later patches, we will convert all users to the > > new API. > > > > Signed-off-by: Muchun Song > > --- > > Documentation/filesystems/porting.rst | 5 +++++ > > fs/inode.c | 2 +- > > include/linux/fs.h | 11 +++++++++++ > > 3 files changed, 17 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/filesystems/porting.rst b/Documentation/filesystems/porting.rst > > index bf19fd6b86e7..c9c157d7b7bb 100644 > > --- a/Documentation/filesystems/porting.rst > > +++ b/Documentation/filesystems/porting.rst > > @@ -45,6 +45,11 @@ typically between calling iget_locked() and unlocking the inode. > > > > At some point that will become mandatory. > > > > +**mandatory** > > + > > +The foo_inode_info should always be allocated through alloc_inode_sb() rather > > +than kmem_cache_alloc() or kmalloc() related. > > I'd add a couple of words on why it has to be allocated this way. Will do. > > + > > --- > > Reviewed-by: Roman Gushchin Thanks.