Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp37032rdh; Tue, 13 Feb 2024 08:41:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEYlH/DUanfW/Yrnn8o8zleQb1j7Yr1rOkeeIIbgNsDMTVOPiyCNMaFnMJNPoUcDL6g2yR X-Received: by 2002:a17:903:1251:b0:1d9:5923:c242 with SMTP id u17-20020a170903125100b001d95923c242mr20371plh.42.1707842467110; Tue, 13 Feb 2024 08:41:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707842467; cv=pass; d=google.com; s=arc-20160816; b=lIOAbuX+1d/KS/GqmptwPGsUpfnaTh8DcLcAfS0GtQq7VZASQH9Ze3FljsTdm0AGuA 5D6xpRJTvmutOiXX/uzPUZ5Vi9jRxJJXDVKp3n7+yaWwbT15v44SMmPYqo3MqyUEKgfy NrR3pqdmDJ8L7pVKONTsNt/QEn+wai6BgTaLJatOXPgPtsyn1L2oNYUHRAB+ORMWe1Ai Ac6W1ZCfMKA9YA3KK4cykkPCk09pmvy6iEvvdBZpHW4caUE6W66bhOezuHSlduV0w4Ke k0Yk0HcT5P3VLa9LPNaAtxlliA0UqOCsHGE6nBO70ABFQu5z040ku1wY6G6hDSzgzmKm BCmA== ARC-Message-Signature: i=2; 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; bh=aWPdujHTJtlcqUqIiRyd5KIodVc/XJyuqIXblEWBwrw=; fh=glDotrErqF75nnTUQHVVhcRK3wxXDbWS0PUunRiLCPY=; b=x4Uq6z0J60N3fcqxEPfVQuglKuGOBJ7gpa5WYntcPPANyN7JpmF/A8/4xuV44w1kwH j+a4Z2O0INVnA3Shx4BjUg/IPjowZrnhqjp2Km/0iUXCy3t8YvmP4b/YLvIjDD+QYKV7 KVAHf31C72XnUR7Qa8j95mkDtDwD7sMbZG7IP/U+6fO+PnoUv+vSIi727I+mBX/bCayp zY6AiIha5kF2qxDXoNLS0CnP7gLcBGkGIP5hac0T/YuYE0ZO3OEiMMyZ3Bxj8rfB/dKV EW+gFCYzEL2lVh88iK4lb0KOXYeZc42dRQQMKCWfbyNrcnYu9OmdWh3rmOJkYyztQ7I6 7IqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mKOzhuXF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63878-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCVSoKOy3EKVlRWKDXVB80nj3CFM7fTkAA1l9xuWEObOoDYKa6BXlhe2NUmwC3RyfZZ+0xJ0SXUgNYlChbH2LEXcWe2wk7LDwpNZ8VyJ1g== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c15-20020a170903234f00b001d757b25122si2285664plh.235.2024.02.13.08.41.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 08:41:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mKOzhuXF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63878-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E5913B24376 for ; Tue, 13 Feb 2024 16:20:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C3F15F87E; Tue, 13 Feb 2024 16:20:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mKOzhuXF" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2ED615F856; Tue, 13 Feb 2024 16:20:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707841208; cv=none; b=GSxdjbJ/99AClbH6f+5UonXqy8JVAkgPg0No4SlzyqqqYfYIeAyspD2ZXPRSdQ+UWC0HW3G3i7RjVlrI3P5sy26qhwaIHKTAJe4rtogIMwOknlZNk60vkbR8TaWWgyG5l6qJux2bTkfOdSaQ6dsMhI3opb5tBfcvCQAo9pvCeJ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707841208; c=relaxed/simple; bh=gtslvFppOKZfPzRmik0crgUkQQcbarTzf8jQux+iYrI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=H1LJkohk3jXzbER9DdeFbbqqa2kCxaVhe8q+8emDopbM+ymER5F36IiLWQq1LfyOIf6kWcGOuXnUHfUhXt2nMFFVIVrrB72UPgym4qAOpGVqB86Onz+4ncAou7ndnCe9byhmKwD/R/TSPqBQvAN/G6m/gyNWscb/KTCcVddXEIQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mKOzhuXF; arc=none smtp.client-ip=10.30.226.201 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> 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: <20240213093713.1753368-15-kernel@pankajraghav.com> 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 > >