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 A1800C4345F for ; Fri, 26 Apr 2024 15:18:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2A6DF6B008C; Fri, 26 Apr 2024 11:18:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2575D6B00A0; Fri, 26 Apr 2024 11:18:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 11F426B00A1; Fri, 26 Apr 2024 11:18:29 -0400 (EDT) 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 E7E416B008C for ; Fri, 26 Apr 2024 11:18:28 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A58A3A1384 for ; Fri, 26 Apr 2024 15:18:28 +0000 (UTC) X-FDA: 82052039496.18.0EB2F5B Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf23.hostedemail.com (Postfix) with ESMTP id 66DC914000E for ; Fri, 26 Apr 2024 15:18:26 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ZMDFW7a9; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf23.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=1714144707; 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=Xn3eD5QZWPpon0HdbqZb9EHriEFeMALjGm3O2wlmxz0=; b=VcGWOpKZY1PevqaMPaC4vHeN2Ea/lqvHiWFSiS8EDtdQFYYg/6d7NRSumdhYIligRz7xzq PoaPHN7rUIro6+wLbYDtDFd+J8vP4UChMdsRAF+XVytmOyMST7+wJx4/y1MRZP13n1rIke hYKOybVKmH+8e08dYuGdo3VJSU9L/p0= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ZMDFW7a9; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf23.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=1714144707; a=rsa-sha256; cv=none; b=PbI/syyv+aH0IrT8jFCXFqAYqs0Y1ZFKTiyHSGWaO/4kQIWrW+v4K4HRNsJ/H0kqdw2ktb sd1zFEe70bz4DUdXahChUIiH4snueHGJ2lSeHn1eK0YHuGefPE80HCKo7wHEoiZLBZ1YZZ 0tWTF0OCtYEfFIfujNwoV2FXiygkTqE= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C8384CE1B9A; Fri, 26 Apr 2024 15:18:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D90E0C113CD; Fri, 26 Apr 2024 15:18:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714144703; bh=n/v/uLUsQ15WCp2AaJraFNUgoWERD2hobl8xT3E8igw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZMDFW7a9U3o7Y2hUgw/ZUJRmT1py9N3cjjpicuoDHITq/LtsjWsdlwII4Ntim06KA hbCJnkgI5gv0K0vANuxdpOy9wzDEUDGmmZQkrn/BwMbNe2FCTY+uaTGtfkR7tIr+Go FvdZH5oi/tK77B3PChSAKg3Z8Ag7E5NAdU7LHLX7qDifRncH2ISkesFkgf/ZVmL3fZ u+GYlfPu2fw6FDgPp8I2ItSe8swU9yEBeVQwKeCr3YpgR21LaGPVgKQiiRnL+QCT+K H1/4vCZVYw8jX0TUVa5J6Q8Ju/qsXGsxyNxRpHokjThgG8OK2a9I1LqBbsZyfHXzgd BcYNLQobOtPhw== Date: Fri, 26 Apr 2024 08:18:22 -0700 From: "Darrick J. Wong" To: "Pankaj Raghav (Samsung)" Cc: willy@infradead.org, brauner@kernel.org, david@fromorbit.com, chandan.babu@oracle.com, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, hare@suse.de, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, mcgrof@kernel.org, gost.dev@samsung.com, p.raghav@samsung.com Subject: Re: [PATCH v4 11/11] xfs: enable block size larger than page size support Message-ID: <20240426151822.GG360919@frogsfrogsfrogs> References: <20240425113746.335530-1-kernel@pankajraghav.com> <20240425113746.335530-12-kernel@pankajraghav.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240425113746.335530-12-kernel@pankajraghav.com> X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 66DC914000E X-Rspam-User: X-Stat-Signature: hkfkumb8tnbapg7naf543nuan6t8p5gg X-HE-Tag: 1714144706-834345 X-HE-Meta: U2FsdGVkX19FmWWa6sotuepLv1n+ROy0V36YvUG0+2j/sd1STa5lnPkPu5938xjlgzAZ36K6t0nRo7Ugr16alxTdT/7tRyzfIVjpwJXkQGWo+czqUduS8O8tqacKSu7soxz8T5/qdqebTV3/CMB7RQu75Qy8AqiMciNP8DbxomnoHWBflO6Jg0V3Se54KURTgqUCuyWgsH6js/bXZZX0jRK8gZGgfSgtLt6JLEkQll1wKojFPvec6dds/JsE9QbB0uu2WlVHku6tBASxSX6NCWnkY7iciw0djrbGnNy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ack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Apr 25, 2024 at 01:37:46PM +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 Seems reasonable... Reviewed-by: Darrick J. Wong --D > --- > 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 | 10 ++-------- > 5 files changed, 14 insertions(+), 11 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c > index e5ac3e5430c4..60005feb0015 100644 > --- a/fs/xfs/libxfs/xfs_ialloc.c > +++ b/fs/xfs/libxfs/xfs_ialloc.c > @@ -2975,6 +2975,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 dfd61fa8332e..7d3abd182322 100644 > --- a/fs/xfs/libxfs/xfs_shared.h > +++ b/fs/xfs/libxfs/xfs_shared.h > @@ -229,6 +229,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 74f1812b03cb..a2629e00de41 100644 > --- a/fs/xfs/xfs_icache.c > +++ b/fs/xfs/xfs_icache.c > @@ -89,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); > + 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); > @@ -324,7 +325,8 @@ xfs_reinit_inode( > inode->i_rdev = dev; > inode->i_uid = uid; > inode->i_gid = gid; > - 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 56d71282972a..a451302aa258 100644 > --- a/fs/xfs/xfs_mount.c > +++ b/fs/xfs/xfs_mount.c > @@ -131,7 +131,6 @@ xfs_sb_validate_fsb_count( > xfs_sb_t *sbp, > uint64_t nblocks) > { > - ASSERT(PAGE_SHIFT >= sbp->sb_blocklog); > ASSERT(sbp->sb_blocklog >= BBSHIFT); > uint64_t max_index; > uint64_t max_bytes; > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > index bce020374c5e..db3b82c2c381 100644 > --- a/fs/xfs/xfs_super.c > +++ b/fs/xfs/xfs_super.c > @@ -1623,16 +1623,10 @@ 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.", > - mp->m_sb.sb_blocksize, PAGE_SIZE); > - error = -ENOSYS; > - goto out_free_sb; > +"EXPERIMENTAL: Filesystem with Large Block Size (%d bytes) enabled.", > + mp->m_sb.sb_blocksize); > } > > /* Ensure this filesystem fits in the page cache limits */ > -- > 2.34.1 > >