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 61A44C3DA7F for ; Mon, 5 Aug 2024 12:46:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D8BCD6B0093; Mon, 5 Aug 2024 08:46:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D14FF6B0095; Mon, 5 Aug 2024 08:46:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B8E746B0098; Mon, 5 Aug 2024 08:46:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 972FE6B0093 for ; Mon, 5 Aug 2024 08:46:23 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 376C3C1C09 for ; Mon, 5 Aug 2024 12:46:23 +0000 (UTC) X-FDA: 82418165046.09.174DA1F Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by imf27.hostedemail.com (Postfix) with ESMTP id 2C58E4001F for ; Mon, 5 Aug 2024 12:46:20 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=Q7XfymlX; dmarc=pass (policy=quarantine) header.from=pankajraghav.com; spf=pass (imf27.hostedemail.com: domain of kernel@pankajraghav.com designates 80.241.56.171 as permitted sender) smtp.mailfrom=kernel@pankajraghav.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722861974; a=rsa-sha256; cv=none; b=sGvQW0L/WjYRfh/BLaITNwKge9OZ65qYpiqI/fUkN2jMPMXSTD+BOgT5oaQHp8yMw9TzCa tPn4Skcv4J/tuQjARj1vYdzCwmzOGQMy1peY8b4sLKKijD4XMJ8mybcE5eZW8TdqtUg9lv AX+r/mra/notIgOhIbXYJLAyn2f4f5U= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=Q7XfymlX; dmarc=pass (policy=quarantine) header.from=pankajraghav.com; spf=pass (imf27.hostedemail.com: domain of kernel@pankajraghav.com designates 80.241.56.171 as permitted sender) smtp.mailfrom=kernel@pankajraghav.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722861974; 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=MYO3adI1+xfD0J8UWHfGOa26AzQibf/gUQhzQh/b8sQ=; b=lirUCq8DHlEwLgrMHd1j7lSUgj3GAmikJNimi3xPPSVPRG9tC+6O8edvLr3ELK9Y9LdAa7 lJ+bQXgO4DjFH1pzz8fgLHSfrAEPoz96BsnLk5E0x+WUkH7GzA4jCVyhJ3QlUWMSCLhUZJ 6fzsOn0vQbS/XvKFekcEsa/Tmj9YM8s= Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (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-201.mailbox.org (Postfix) with ESMTPS id 4Wcx542ZkKz9sSN; Mon, 5 Aug 2024 14:46:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1722861976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MYO3adI1+xfD0J8UWHfGOa26AzQibf/gUQhzQh/b8sQ=; b=Q7XfymlXp8KO8qxjyIcI+IOTYgNPSIa5BCD/ywTWJEjMSyKhhgGaQbsuCk7iW2WK3fijmr Vk1DV21O6iSF8FocoFuh8oC+JHmEE+l0DDmIjwVf8gssU9QFMWK5B1BRcrmRrtj6617f9+ pgkk7L1AaVnZ9FSm9D9g/B7Y+e+nSSYUEnAJkg7Sh00ouYgrGe0BqHfUH7fwXswJzw2dna uGLaDQf90r2+AqcOhx8Oeaypk6y+EFwCsdee8pOk82ZUeRbFtNjHsuVTgll3JtqdD9tRp3 mqNixRZXlJa4TmQRXcgiij8/JeWymUqPQSI0pGPjhB8KtfuCeqfUS8WkOaR79A== Date: Mon, 5 Aug 2024 12:46:08 +0000 From: "Pankaj Raghav (Samsung)" To: "Darrick J. Wong" Cc: david@fromorbit.com, willy@infradead.org, chandan.babu@oracle.com, brauner@kernel.org, akpm@linux-foundation.org, yang@os.amperecomputing.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, john.g.garry@oracle.com, linux-fsdevel@vger.kernel.org, hare@suse.de, p.raghav@samsung.com, mcgrof@kernel.org, gost.dev@samsung.com, cl@os.amperecomputing.com, linux-xfs@vger.kernel.org, ryan.roberts@arm.com, hch@lst.de, Zi Yan Subject: Re: [PATCH v11 10/10] xfs: enable block size larger than page size support Message-ID: <20240805124608.jxtumw47y4zhpie7@quentin> References: <20240726115956.643538-1-kernel@pankajraghav.com> <20240726115956.643538-11-kernel@pankajraghav.com> <20240729164159.GC6352@frogsfrogsfrogs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240729164159.GC6352@frogsfrogsfrogs> X-Rspam-User: X-Rspamd-Queue-Id: 2C58E4001F X-Rspamd-Server: rspam01 X-Stat-Signature: z4t15q4opi1gtbqam4r6w89qok7mtqmq X-HE-Tag: 1722861980-522426 X-HE-Meta: U2FsdGVkX1/j4i/7ezijh8jdvclfkXdWcgSnrk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4NoLDBOjlpXcjFqAMOuXx8sUK2XKIOl6lfeM9VKpVJFruj7i3XRGAs1aXA5Y/FZC2da7QNPzgEoRk4qzfl7xqq5ifk4mOfouH/5kZaLxA9F7QF8yvCmVzQ6F5LAyMOb91kMs4G/HyVRZ8UhEPVmiCS7bUmAvdILI1fjwtd6I3FoMZKmVZSCTdIM4/zBiHteXkq 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 Mon, Jul 29, 2024 at 09:41:59AM -0700, Darrick J. Wong wrote: > On Fri, Jul 26, 2024 at 01:59:56PM +0200, 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. > > > > Signed-off-by: Pankaj Raghav > > Signed-off-by: Luis Chamberlain > > Reviewed-by: Darrick J. Wong > > --- > > fs/xfs/libxfs/xfs_ialloc.c | 5 +++++ > > fs/xfs/libxfs/xfs_shared.h | 3 +++ > > fs/xfs/xfs_icache.c | 6 ++++-- > > fs/xfs/xfs_mount.c | 1 - > > fs/xfs/xfs_super.c | 28 ++++++++++++++++++++-------- > > include/linux/pagemap.h | 13 +++++++++++++ > > 6 files changed, 45 insertions(+), 11 deletions(-) > > > > diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c > > index 0af5b7a33d055..1921b689888b8 100644 > > --- a/fs/xfs/libxfs/xfs_ialloc.c > > +++ b/fs/xfs/libxfs/xfs_ialloc.c > > @@ -3033,6 +3033,11 @@ xfs_ialloc_setup_geometry( > > igeo->ialloc_align = mp->m_dalign; > > else > > igeo->ialloc_align = 0; > > + > > + if (mp->m_sb.sb_blocksize > PAGE_SIZE) > > + igeo->min_folio_order = mp->m_sb.sb_blocklog - PAGE_SHIFT; > > + else > > + igeo->min_folio_order = 0; > > } > > > > /* Compute the location of the root directory inode that is laid out by mkfs. */ > > diff --git a/fs/xfs/libxfs/xfs_shared.h b/fs/xfs/libxfs/xfs_shared.h > > index 2f7413afbf46c..33b84a3a83ff6 100644 > > --- a/fs/xfs/libxfs/xfs_shared.h > > +++ b/fs/xfs/libxfs/xfs_shared.h > > @@ -224,6 +224,9 @@ struct xfs_ino_geometry { > > /* precomputed value for di_flags2 */ > > uint64_t new_diflags2; > > > > + /* minimum folio order of a page cache allocation */ > > + unsigned int min_folio_order; > > + > > }; > > > > #endif /* __XFS_SHARED_H__ */ > > diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c > > index cf629302d48e7..0fcf235e50235 100644 > > --- a/fs/xfs/xfs_icache.c > > +++ b/fs/xfs/xfs_icache.c > > @@ -88,7 +88,8 @@ xfs_inode_alloc( > > > > /* VFS doesn't initialise i_mode! */ > > VFS_I(ip)->i_mode = 0; > > - mapping_set_large_folios(VFS_I(ip)->i_mapping); > > + mapping_set_folio_min_order(VFS_I(ip)->i_mapping, > > + M_IGEO(mp)->min_folio_order); > > > > XFS_STATS_INC(mp, vn_active); > > ASSERT(atomic_read(&ip->i_pincount) == 0); > > @@ -325,7 +326,8 @@ xfs_reinit_inode( > > inode->i_uid = uid; > > inode->i_gid = gid; > > inode->i_state = state; > > - mapping_set_large_folios(inode->i_mapping); > > + mapping_set_folio_min_order(inode->i_mapping, > > + M_IGEO(mp)->min_folio_order); > > return error; > > } > > > > diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c > > index 3949f720b5354..c6933440f8066 100644 > > --- a/fs/xfs/xfs_mount.c > > +++ b/fs/xfs/xfs_mount.c > > @@ -134,7 +134,6 @@ xfs_sb_validate_fsb_count( > > { > > uint64_t max_bytes; > > > > - ASSERT(PAGE_SHIFT >= sbp->sb_blocklog); > > ASSERT(sbp->sb_blocklog >= BBSHIFT); > > > > if (check_shl_overflow(nblocks, sbp->sb_blocklog, &max_bytes)) > > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > > index 27e9f749c4c7f..b2f5a1706c59d 100644 > > --- a/fs/xfs/xfs_super.c > > +++ b/fs/xfs/xfs_super.c > > @@ -1638,16 +1638,28 @@ 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) { > > - xfs_warn(mp, > > - "File system with blocksize %d bytes. " > > - "Only pagesize (%ld) or less will currently work.", > > + size_t max_folio_size = mapping_max_folio_size_supported(); > > + > > + if (!xfs_has_crc(mp)) { > > + xfs_warn(mp, > > +"V4 Filesystem with blocksize %d bytes. Only pagesize (%ld) or less is supported.", > > mp->m_sb.sb_blocksize, PAGE_SIZE); > > - error = -ENOSYS; > > - goto out_free_sb; > > + error = -ENOSYS; > > + goto out_free_sb; > > + } > > + > > + if (mp->m_sb.sb_blocksize > max_folio_size) { > > + xfs_warn(mp, > > +"block size (%u bytes) not supported; Only block size (%ld) or less is supported", > > + mp->m_sb.sb_blocksize, max_folio_size); > > Dumb nit: Please indent ^^^ this second line so that it doesn't start on > the same column as the separate statement below it. > Done :)