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 D72ECC48260 for ; Tue, 13 Feb 2024 16:20:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 476B98D0011; Tue, 13 Feb 2024 11:20:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D9248D000E; Tue, 13 Feb 2024 11:20:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2523A8D0011; Tue, 13 Feb 2024 11:20:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 0C1948D000E for ; Tue, 13 Feb 2024 11:20:17 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 4BCA7A138A for ; Tue, 13 Feb 2024 16:20:16 +0000 (UTC) X-FDA: 81787292832.15.641B113 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf17.hostedemail.com (Postfix) with ESMTP id A846F4000B for ; Tue, 13 Feb 2024 16:20:12 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mKOzhuXF; spf=pass (imf17.hostedemail.com: domain of djwong@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=djwong@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707841213; a=rsa-sha256; cv=none; b=wsK9UvNu/uAYdbzfowIAbfFPPM+M854bTafTeAS5edTqhSCwSECpJRsGRGXdqK+I0Ha8Us vDZUa2w2lMrUlrVmLRSEZBQZ/65+bicBtJ8HdyxloyO51YRtLJpDTveARr7z/+aeMzZcra rpaPagLOsws6XuumccVGMFV1EC3bkrk= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mKOzhuXF; spf=pass (imf17.hostedemail.com: domain of djwong@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=djwong@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707841213; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aWPdujHTJtlcqUqIiRyd5KIodVc/XJyuqIXblEWBwrw=; b=4RfRtzK/8AusmsQgomq91CftCYrhEleG6bOzoZLYbb0Oqq0z62MF6k/70p5TGCO4rd0VQI xctSROp7mqv2QzbMyXBpSAWgCCMMtUr0VCA0StgFcLFrB4GEO62rzA9/3baWq6SvefKF5Q rqrBSjiS6hhQpyYZH8CQUj/1G/XlvE4= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id A34C1CE1D0A; Tue, 13 Feb 2024 16:20:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8AA0C433C7; Tue, 13 Feb 2024 16:20:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707841207; bh=gtslvFppOKZfPzRmik0crgUkQQcbarTzf8jQux+iYrI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mKOzhuXFkW+ip0VWmWFMZ9X9xKNlSkv53BRhjGo3KjnathEkp3wXBz1RwEwDe3sll HipdSEAULux2Mln4CXRaufvcwlgPXUZO8C8q/OrslYUJa+3InYHD7Kg9RJg4wY9lbH FAbcUR6svShKB45qjgx50o9ktNu/dW0TJRNftgtq81gudCeLQ+nWb152fhiL6ocdkR KiSS52BVlJBiW1caVXhN2fI2PCeXmeWVak7Nojyssh5lDd1n9iFcnKecyFVOrkHHA5 dQtgZSiVYtEnOaWNffOXkc6bpNIUkcmOVftkC/UtNbqWeqTyiVCgqKg3K09USAktQz OB/dKJL4dEFXw== Date: Tue, 13 Feb 2024 08:20:07 -0800 From: "Darrick J. Wong" To: "Pankaj Raghav (Samsung)" Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, mcgrof@kernel.org, gost.dev@samsung.com, akpm@linux-foundation.org, kbusch@kernel.org, chandan.babu@oracle.com, p.raghav@samsung.com, linux-kernel@vger.kernel.org, hare@suse.de, willy@infradead.org, linux-mm@kvack.org, david@fromorbit.com Subject: Re: [RFC v2 14/14] xfs: enable block size larger than page size support Message-ID: <20240213162007.GO6184@frogsfrogsfrogs> References: <20240213093713.1753368-1-kernel@pankajraghav.com> <20240213093713.1753368-15-kernel@pankajraghav.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240213093713.1753368-15-kernel@pankajraghav.com> X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: A846F4000B X-Stat-Signature: c89ybuy5qtn6ue6dysswogmnbq7z9dt1 X-Rspam-User: X-HE-Tag: 1707841212-915667 X-HE-Meta: U2FsdGVkX18HHNA50/I0ynWThpl/tX+DSTa+185P19tT6u3GDf4iUs7elYC5t7kdo3lDMsNvVOHIhsWc8ZTg+Qm36dxdIg0fxg1OpBaxVqWTJO/MqEm1LtB4ywQ59lIR540RDwEuSdrJdI7SIv8TOlisBf8Qg1GpcMUhjodcjUL8bZmodquTYrkA9Ad4yd8uyC+6wXPeiKP0L3ArGvqk24nkr9Qt//3eSqjMl5qNklCPM5Npf4J7OmQuis1Q3zJZtPUR2RCDZ3ScsSR2JAxY0zNGyVmY8lWkD+SLFhbIWtXX2Fcj4Gj5+jzOKCxy5HvJFFgbUMfbME1kHr/wbTGX9givg7ayroLemO6JMHKIf6TynazcpTAg+7sNK3Ia277WUrxl1IkmDuXCi5R5o7QeFCSV5NlCiIZfP/CDs8LWu5+OnI3YgbtIVlNuuD1Z/uSQMZCQiQIyTdy67AZn/FsCiSvct6uTjAMUnVtq8NllaukxQSmwtB4aaAU/lmVvrKMa9+VGVt8yQCEJe6rXfbv4y6LAkkELHhJ1AsGq3Bynrqx1aEQ5f/s0TLy072AoYqjECRevI50cgrGWgd8hCZVigwcq2boEi4p5ZkDfCTovvvaS4sLT7nJlIGBVwuQroq/VHHMhaQUp8SpzduaKPvOtp06+qPlZcKJPkw3CyGn66WBuX2Ag+bClpF7CCvitZapTVfq6KeLwzaUz9xXylP6uxWoD4ROdhYhv2MnRilCP92NoE9EsZtNk6/GCOH7YVjyOtsw9x4RMxMPU9BcAqDySm/44AsC7SGjhoUVLr1P1XBPu4vzSdeB9xTvL13tZoKrew2FfNZZxfIvxRR0vnyBX95mSjLHGZ472jn7p6famOkhVhlEBBT52sDTnypCbt0/IAbkLD5qJ9h18Dx8GZr9dTCikHxvxkN9h63mxdN5FZZZ1w0jz9BWA9PQA+Ecx4IH1E80VytnIH758klH1P5S nPAaAv/7 XriRyGnoFKtqnmlZoIst287nAJVi98GkLMUisXLsS9XaMDpkoWUm0XBokQRbPHpfckgYnQWuCQNaeLMUwe8kC/Gt8e+8ZswsK/IX6mfk37rCm+L9VMsD3byAaAtOPXXIRAfKmDiSrsjxzQEE0w+jk5qoTEhX555pq/tGbadixylIfB4KXZoAw+4niLPFfqT7cGwmhXyXh8MnBsYzZzUI3j8iyhLqr7FfsOA4LA86+3WLBMlgRM5SbyTf/QVEknXW0wveY7QJQsnCQ+M4= 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: List-Subscribe: List-Unsubscribe: On Tue, Feb 13, 2024 at 10:37:13AM +0100, Pankaj Raghav (Samsung) wrote: > From: Pankaj Raghav > > Page cache now has the ability to have a minimum order when allocating > a folio which is a prerequisite to add support for block size > page > size. Enable it in XFS under CONFIG_XFS_LBS. > > Signed-off-by: Luis Chamberlain > Signed-off-by: Pankaj Raghav > --- > fs/xfs/xfs_icache.c | 8 ++++++-- > fs/xfs/xfs_super.c | 8 +++----- > 2 files changed, 9 insertions(+), 7 deletions(-) > > diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c > index dba514a2c84d..9de81caf7ad4 100644 > --- a/fs/xfs/xfs_icache.c > +++ b/fs/xfs/xfs_icache.c > @@ -73,6 +73,7 @@ xfs_inode_alloc( > xfs_ino_t ino) > { > struct xfs_inode *ip; > + int min_order = 0; > > /* > * XXX: If this didn't occur in transactions, we could drop GFP_NOFAIL > @@ -88,7 +89,8 @@ xfs_inode_alloc( > /* VFS doesn't initialise i_mode or i_state! */ > VFS_I(ip)->i_mode = 0; > VFS_I(ip)->i_state = 0; > - mapping_set_large_folios(VFS_I(ip)->i_mapping); > + min_order = max(min_order, ilog2(mp->m_sb.sb_blocksize) - PAGE_SHIFT); > + mapping_set_folio_orders(VFS_I(ip)->i_mapping, min_order, MAX_PAGECACHE_ORDER); > > XFS_STATS_INC(mp, vn_active); > ASSERT(atomic_read(&ip->i_pincount) == 0); > @@ -313,6 +315,7 @@ xfs_reinit_inode( > dev_t dev = inode->i_rdev; > kuid_t uid = inode->i_uid; > kgid_t gid = inode->i_gid; > + int min_order = 0; > > error = inode_init_always(mp->m_super, inode); > > @@ -323,7 +326,8 @@ xfs_reinit_inode( > inode->i_rdev = dev; > inode->i_uid = uid; > inode->i_gid = gid; > - mapping_set_large_folios(inode->i_mapping); > + min_order = max(min_order, ilog2(mp->m_sb.sb_blocksize) - PAGE_SHIFT); > + mapping_set_folio_orders(inode->i_mapping, min_order, MAX_PAGECACHE_ORDER); Twice now I've seen this, which makes me think "refactor this into a single function." But then, this is really just: mapping_set_folio_orders(inode->i_mapping, max(0, inode->i_sb->s_blocksize_bits - PAGE_SHIFT), MAX_PAGECACHE_ORDER); Can we make that a generic inode_set_pagecache_orders helper? > return error; > } > > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > index 5a2512d20bd0..6a3f0f6727eb 100644 > --- a/fs/xfs/xfs_super.c > +++ b/fs/xfs/xfs_super.c > @@ -1625,13 +1625,11 @@ xfs_fs_fill_super( > goto out_free_sb; > } > > - /* > - * Until this is fixed only page-sized or smaller data blocks work. > - */ > - if (mp->m_sb.sb_blocksize > PAGE_SIZE) { > + if (!IS_ENABLED(CONFIG_XFS_LBS) && mp->m_sb.sb_blocksize > PAGE_SIZE) { > xfs_warn(mp, > "File system with blocksize %d bytes. " > - "Only pagesize (%ld) or less will currently work.", > + "Only pagesize (%ld) or less will currently work. " > + "Enable Experimental CONFIG_XFS_LBS for this support", > mp->m_sb.sb_blocksize, PAGE_SIZE); Please log a warning about the EXPERIMENTAL bs>ps feature being used on this mount for the CONFIG_XFS_LBS=y case. --D > error = -ENOSYS; > goto out_free_sb; > -- > 2.43.0 > >