From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B757C433EF for ; Wed, 12 Jan 2022 02:55:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C3CF96B010E; Tue, 11 Jan 2022 21:55:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BECBC6B010F; Tue, 11 Jan 2022 21:55:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A8D466B0110; Tue, 11 Jan 2022 21:55:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0151.hostedemail.com [216.40.44.151]) by kanga.kvack.org (Postfix) with ESMTP id 9AA546B010E for ; Tue, 11 Jan 2022 21:55:13 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 50144824CA06 for ; Wed, 12 Jan 2022 02:55:13 +0000 (UTC) X-FDA: 79020118506.06.0E60410 Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) by imf19.hostedemail.com (Postfix) with ESMTP id 3798C1A0002 for ; Wed, 12 Jan 2022 02:55:10 +0000 (UTC) Received: by mail-yb1-f179.google.com with SMTP id h14so2413685ybe.12 for ; Tue, 11 Jan 2022 18:55:09 -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=WfgPNxV6CtoBkRKmP0HMtSBVYnPZNU+xAuOjFGtS/5K4D70MHq94S4MjEQ3yJ9FLWi UDzV6lyng6cofMIaht/Y7eHNs9on31FfgfGtpqQ+LCOvXQWCd5A/1AMsb/Pd3l48orxP uraBKPf7G1fmD8rcg9FZ+NftA8BudzuHiFa0bAxUkS3DXkO2uKvl65H9tB0DNfYG8d7z aIUaos805Rs4l+ie/2XkD7Go4zWI6ala9C6+pomw7ESv1WCyyc5OyoxoS7Q6XVlc9NfR jxFsX6gdkm60FgWIYkXHJEHBGNrLQkxnet2ukQ/5S6Qa+JvuB/ULk41WYmH8a1XojhpB xscw== X-Gm-Message-State: AOAM533gilMHgznTO29RVqwcN3ePN5lhb5WpdKMgwd8wNVNG1Ex8mQ2o czH+frBq8WnVtxo8A5skQrvyPTvnL3aIY1lXpt6+wg== 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" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 3798C1A0002 X-Stat-Signature: 9tcijfkb1ansmxoeb6cz6isc4mkb4at4 Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=6ayrnxbc; spf=pass (imf19.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.219.179 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1641956110-865563 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.