From patchwork Tue Feb 13 09:37:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pankaj Raghav (Samsung)" X-Patchwork-Id: 13554795 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 3217BC48260 for ; Tue, 13 Feb 2024 09:38:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B8F4D8D000D; Tue, 13 Feb 2024 04:38:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B3E978D0001; Tue, 13 Feb 2024 04:38:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 96AC18D000D; Tue, 13 Feb 2024 04:38:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 813358D0001 for ; Tue, 13 Feb 2024 04:38:12 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 592A6C0B11 for ; Tue, 13 Feb 2024 09:38:12 +0000 (UTC) X-FDA: 81786279624.17.87DB127 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) by imf30.hostedemail.com (Postfix) with ESMTP id B824080009 for ; Tue, 13 Feb 2024 09:38:10 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=ENbwnnNB; dmarc=none; spf=pass (imf30.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.151 as permitted sender) smtp.mailfrom=me@pankajraghav.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707817091; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ydvUqzYBcKzyH4ZGo5x0A9m5vNe3qnV9Z0vpVQaGpLg=; b=IL7AzQ2IpddhVIW2EBq33d7syuOUzs0RGGaXk4E4gSEdx9I8H/kyVQMW/Nufg927FoBD/P geW6rpQB7zv/bLkdO+Soz8B/bvnYnYXJ6p7lNMPAbE/CrKsyn4BYTxi5CSeeV7NIY+5mA4 aGXz8uOt3O2VzkEsE1a/WxOZX50gKn8= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=ENbwnnNB; dmarc=none; spf=pass (imf30.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.151 as permitted sender) smtp.mailfrom=me@pankajraghav.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707817091; a=rsa-sha256; cv=none; b=QR4G3TnCx1n50K7Wko0P+GNScteVlyRK10fRS/5n5b9DlN/g+eecnsWuzsKvLhYgHlF0st foe7aTu1K0NYgKcimu/E5LDqO9Lq7SoEHcuvDgQSdE+Y7BeRGYdYQYxeM5OG3zdHskXbVO /3A7FOGPJcnFjlRcNDDv0LJ6numBar0= Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4TYx8H2fChz9sSH; Tue, 13 Feb 2024 10:38:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1707817087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ydvUqzYBcKzyH4ZGo5x0A9m5vNe3qnV9Z0vpVQaGpLg=; b=ENbwnnNBjOlMkTNsWgmN/QeJZ4bByf9vXC2SH9MWslItb5E3wLNJdxS5OYwgUczoQQxGFa jJLfvCUFWE4S4XIaf/gyJsxDpV54gpCGO6Q09Hr3W1Zl8hpSte2SCg/NxBVzt13u5b+rtn u9QhTF7FnDJlW3xsb7G6zptXw5QVnwjAOVIogxhjlYniqe0K1ORrtaGBSqFIq7XIZecY9G asCnrkLcVOePpZAFLxRLQb3P4hXMoiEeVmElnhxfjx+/5h/OFo9SJwBVx77eiPLb+MoeAw aa/PQKwI9st5rNiozYJhatwuGinu3iv/klvwOtrhhlSPwM2BtJQuDhCzDDR5jA== From: "Pankaj Raghav (Samsung)" To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: mcgrof@kernel.org, gost.dev@samsung.com, akpm@linux-foundation.org, kbusch@kernel.org, djwong@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: [RFC v2 14/14] xfs: enable block size larger than page size support Date: Tue, 13 Feb 2024 10:37:13 +0100 Message-ID: <20240213093713.1753368-15-kernel@pankajraghav.com> In-Reply-To: <20240213093713.1753368-1-kernel@pankajraghav.com> References: <20240213093713.1753368-1-kernel@pankajraghav.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: B824080009 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 55kuig4q9x1ztrggxjztz4dkqs5rq61x X-HE-Tag: 1707817090-972831 X-HE-Meta: U2FsdGVkX1+/+x0sVGWz6iq4SiwB4tu0ylDWzPbTCu8dWAxlrXghpHJVcnQqQU/TRaJ4dfyQyrYCUsDuTR4SgmoLTctUMkQzFR2ByWOpeXHo6dzjthtuDAA8fvQXzXoQBfQVCOnJvywrBluF/THqdOLC/flWZrP3wmqvx19Pl48zH5sLX0IwWYtDz9AYI5D5G2sXdyg5uaE2FbRJLIVTMWVSkdyLiP5+VcMWNrqhsenIvx/n96JdqpF7ZpYcFE98BH0KI7q9OFJfxOSZexCkk7raiUSK7ejvWCDNVHj/ky+ipORuezPNAGW0cGYu6q5vxOayCR7oStk+Xnq/EhmLGkyhwEVg5qAF0iy8tG41c6wH2X7xcrh8K4gIVNMfCXrnGlh2Zcn5Tcevsw4Xc6k0JjzoqP8oCD0qVNSqDn2sMa7x03vrFQT2DSlljXo1pGl+18S6H2LmpYBlffxp1vEAlr6WBewABvLfgwhud1xwJ8b5EwmeBwmVCSQmB4Pu0aUv3+WctTK8TBl5+j3fy6n3w506mx6Q1cHFUSg+DPEQcZcw8m7BX+fletcBc68rd2XahOqyptK0GijwDnl/9xiyjbZeTOC2YmN+NFapVEtlfDawr8GyJP/Grmu7hJIx/lURXaJS1Eof72yCULY6hXi+UsfnS21Q785AABFt2bQX9Cr1F5FOlk2l6h+OS1HKuU0SMuIrhJtPDeZds4FoOYEiJ64OFKSijnn+XQpRvD7ZCFgNrDhnEHUXdazA0D3oPY27eqlbbq3FgO7qe6cCQq0YeRrgCTK/w4FsfaZcEAW70l14N1fBqIgG+MXh+9DEdg3dYAntvQoXgm59W0Imouc/6YMn+tfY81pr5OvwYoGgUxAp5d+uLkktViUWvBewbcvJmCu70M6Whye2DgQiZ2p7SI6XZZShH6IE/ZFpo2KQP9lTW6XdSeE0tck4NjBJ4Fai11KBTgPJ8nc9rO3Irq3 ZULcG5Gn 4Waio7LfiapxZos/XNuo9PPj5zBvWuHfli6xD3nfv6G+HlDjPWBMpWdWg18Hit+qdR7Hh 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: 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); 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); error = -ENOSYS; goto out_free_sb;