[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4xsntqfuxy3xiezmztf26qytijdfi3zwxjjgvkpsmxnumkpsf5@2gr4h36mti3g>
Date: Mon, 10 Nov 2025 10:48:36 +0100
From: Jan Kara <jack@...e.cz>
To: libaokun@...weicloud.com
Cc: linux-ext4@...r.kernel.org, tytso@....edu, adilger.kernel@...ger.ca,
jack@...e.cz, linux-kernel@...r.kernel.org, kernel@...kajraghav.com,
mcgrof@...nel.org, ebiggers@...nel.org, willy@...radead.org, yi.zhang@...wei.com,
yangerkun@...wei.com, chengzhihao1@...wei.com, libaokun1@...wei.com
Subject: Re: [PATCH v2 21/24] ext4: make data=journal support large block size
On Fri 07-11-25 22:42:46, libaokun@...weicloud.com wrote:
> From: Baokun Li <libaokun1@...wei.com>
>
> Currently, ext4_set_inode_mapping_order() does not set max folio order
> for files with the data journalling flag. For files that already have
> large folios enabled, ext4_inode_journal_mode() ignores the data
> journalling flag once max folio order is set.
>
> This is not because data journalling cannot work with large folios, but
> because credit estimates will go through the roof if there are too many
> blocks per folio.
>
> Since the real constraint is blocks-per-folio, to support data=journal
> under LBS, we now set max folio order to be equal to min folio order for
> files with the journalling flag. When LBS is disabled, the max folio order
> remains unset as before.
>
> Additionally, the max_order check in ext4_inode_journal_mode() is removed,
> and mapping order is reset in ext4_change_inode_journal_flag().
>
> Suggested-by: Jan Kara <jack@...e.cz>
> Signed-off-by: Baokun Li <libaokun1@...wei.com>
...
> @@ -6585,6 +6590,7 @@ int ext4_change_inode_journal_flag(struct inode *inode, int val)
> ext4_clear_inode_flag(inode, EXT4_INODE_JOURNAL_DATA);
> }
> ext4_set_aops(inode);
> + ext4_set_inode_mapping_order(inode);
>
> jbd2_journal_unlock_updates(journal);
> ext4_writepages_up_write(inode->i_sb, alloc_ctx);
I think more needs to be done here because this way we could leave folios
in the page cache that would be now larger than max order. To simplify the
logic I'd make filemap_write_and_wait() call in
ext4_change_inode_journal_flag() unconditional and add there
truncate_pagecache() call to evict all the page cache before we switch the
inode journalling mode.
Honza
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists