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 8949EC3DA4A for ; Mon, 15 Jul 2024 16:46:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F1B336B0093; Mon, 15 Jul 2024 12:46:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA3CE6B0095; Mon, 15 Jul 2024 12:46:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1D176B0096; Mon, 15 Jul 2024 12:46:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B12926B0093 for ; Mon, 15 Jul 2024 12:46:41 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C92EF4164A for ; Mon, 15 Jul 2024 16:46:40 +0000 (UTC) X-FDA: 82342565760.24.247F635 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf09.hostedemail.com (Postfix) with ESMTP id 68DD1140021 for ; Mon, 15 Jul 2024 16:46:37 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=fdLW+j6Y; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of djwong@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=djwong@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721061967; a=rsa-sha256; cv=none; b=tTB9XCynNvdft2TFAHzBf2XVY8t6KHzhHYizrdzJDjSH7JdBfBV45vLiaR6UhMqW647XwJ 6D+9QPXSZL79/wR3h1boz7wU8bMO2YvA6qZsAyfPnsX6DBXq/A+/YTsfdJNtfzG5m0pJO5 /zv5obS1m+tgBL7u99vZ/jj/VJ+opf0= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=fdLW+j6Y; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of djwong@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=djwong@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721061967; 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=srFJrPYewq0B1mf5g7JFAhihZQHsDRbTNxUBD07+rFs=; b=RCERMU7F5zCzklzQAfmoIERMJk7CRrVOLsHr1MYRaj4KjkcV7FBnFL/ASJm/pnNeyU2SYP +H4GSfhd6fyuCDLHd0vqbdknGFLQEkz9Gm4D1FFZNGph8VYSpWnYfoOHO+plCtzC+H8Tvv B20mBNfDJ+fshN8leDaKoXcXNsTletM= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id CCB90CE1122; Mon, 15 Jul 2024 16:46:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2C15C32782; Mon, 15 Jul 2024 16:46:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721061993; bh=CKsM6X/ILuteI/53RzhvTkmwmrJCL208UsIV57Va2XI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fdLW+j6Y+Ki7ty31Vru/uvWcM/bxoTE4hvdOxHnGU07Kdd2OSMBKVf9ECGreERRqs Zi9Ek+1I4cz2tW2Vx//6jjeOgwNXNwUQ0EFxlvKz0bTEKwZvHpdp9M6X1YhDg3XWOB RKiY4IJADKm3BBoqvlFqU0/xk9ZKv5e9/lAEeGf3Se5PZ7lbaGCPHZUdGi9fSABPG8 BwBKcbHj0IE6e/xujl5RVkZj4wxa6lUjkgWRxDLityGAWyPpsY2d4gMBbILfX6arRW wx/iUL/JppWzfd7b8kmn2WjqbtFaWhc/X2nyXlhBBT7PqoyESqdN7GsUgqKkpHn3Xz USjUiKDmoaENg== Date: Mon, 15 Jul 2024 09:46:32 -0700 From: "Darrick J. Wong" To: "Pankaj Raghav (Samsung)" Cc: david@fromorbit.com, willy@infradead.org, chandan.babu@oracle.com, brauner@kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, yang@os.amperecomputing.com, 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 v10 10/10] xfs: enable block size larger than page size support Message-ID: <20240715164632.GV612460@frogsfrogsfrogs> References: <20240715094457.452836-1-kernel@pankajraghav.com> <20240715094457.452836-11-kernel@pankajraghav.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240715094457.452836-11-kernel@pankajraghav.com> X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 68DD1140021 X-Stat-Signature: 9s8fdixnugcmmacdsqywmeasx3wd3xca X-Rspam-User: X-HE-Tag: 1721061997-212837 X-HE-Meta: U2FsdGVkX19L1HjniuRKBGo3D/HvbvwYXu6OrhtCmVIIJhMsxyZPmeaWvm1Tlm+8R71NFykTF+kgK1kBwgVDhrIo+odU/MY3nHwWcjflaieWvtc0zbE0BiBG2dnjkJIgO2JBc9YGOnmt+4NJ8CYvvfj7kGqdg99r863q7+BBdjJpveq7rwN2a1t56ZnzCmGTj8rorpCdYkh6rFQ8Jfe3y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-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 15, 2024 at 11:44:57AM +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 > --- > 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 | 30 ++++++++++++++++++++++-------- > 5 files changed, 34 insertions(+), 11 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c > index 14c81f227c5bb..1e76431d75a4b 100644 > --- a/fs/xfs/libxfs/xfs_ialloc.c > +++ b/fs/xfs/libxfs/xfs_ialloc.c > @@ -3019,6 +3019,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 34f104ed372c0..e67a1c7cc0b02 100644 > --- a/fs/xfs/libxfs/xfs_shared.h > +++ b/fs/xfs/libxfs/xfs_shared.h > @@ -231,6 +231,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..3c455ef588d48 100644 > --- a/fs/xfs/xfs_super.c > +++ b/fs/xfs/xfs_super.c > @@ -1638,16 +1638,30 @@ 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; maximum folio size supported in "\ > +"the page cache is (%ld bytes). Check MAX_PAGECACHE_ORDER (%d)", > + mp->m_sb.sb_blocksize, max_folio_size, > + MAX_PAGECACHE_ORDER); > + error = -ENOSYS; > + goto out_free_sb; Nit: Continuation lines should be indented, not lined up with the next statement: xfs_warn(mp, "block size (%u bytes) not supported; maximum folio size supported in "\ "the page cache is (%ld bytes). Check MAX_PAGECACHE_ORDER (%d)", mp->m_sb.sb_blocksize, max_folio_size, MAX_PAGECACHE_ORDER); error = -ENOSYS; goto out_free_sb; With that fixed, Reviewed-by: Darrick J. Wong --D > + } > + > + xfs_warn(mp, > +"EXPERIMENTAL: V5 Filesystem with Large Block Size (%d bytes) enabled.", > + mp->m_sb.sb_blocksize); > } > > /* Ensure this filesystem fits in the page cache limits */ > -- > 2.44.1 > >