Re: [f2fs-dev] [PATCH v5 01/10] fs: Expose helper to check if a directory needs casefolding

2023-08-12 Thread Matthew Wilcox
On Sat, Aug 12, 2023 at 07:06:47PM -0400, Theodore Ts'o wrote: > One could say that this is an insane threat model, but the syzbot team > thinks that this can be used to break out of a kernel lockdown after a > UEFI secure boot. Which is fine, except I don't think I've been able > to get any compa

Re: [f2fs-dev] [PATCH 22/29] xfs: comment page allocation for nowait case in xfs_buf_find_insert()

2023-08-25 Thread Matthew Wilcox
On Fri, Aug 25, 2023 at 09:54:24PM +0800, Hao Xu wrote: > @@ -633,6 +633,8 @@ xfs_buf_find_insert( >* allocate the memory from the heap to minimise memory usage. If we >* can't get heap memory for these small buffers, we fall back to using >* the page allocator. > + * x

Re: [f2fs-dev] [PATCH 12/29] xfs: enforce GFP_NOIO implicitly during nowait time update

2023-08-25 Thread Matthew Wilcox
On Fri, Aug 25, 2023 at 09:54:14PM +0800, Hao Xu wrote: > +++ b/fs/xfs/xfs_iops.c > @@ -1037,6 +1037,8 @@ xfs_vn_update_time( > int log_flags = XFS_ILOG_TIMESTAMP; > struct xfs_trans*tp; > int error; > + int o

Re: [f2fs-dev] [PATCH 02/11] xfs: add NOWAIT semantics for readdir

2023-08-27 Thread Matthew Wilcox
On Sun, Aug 27, 2023 at 09:28:26PM +0800, Hao Xu wrote: > +++ b/fs/xfs/libxfs/xfs_da_btree.c > @@ -2643,16 +2643,32 @@ xfs_da_read_buf( > struct xfs_buf_map map, *mapp = ↦ > int nmap = 1; > int error; > + int buf

Re: [f2fs-dev] [PATCH 04/11] vfs: add a vfs helper for io_uring file pos lock

2023-08-27 Thread Matthew Wilcox
On Sun, Aug 27, 2023 at 09:28:28PM +0800, Hao Xu wrote: > +++ b/include/linux/file.h > @@ -81,6 +81,8 @@ static inline void fdput_pos(struct fd f) > fdput(f); > } > > +extern int file_pos_lock_nowait(struct file *file, bool nowait); No extern on function declarations. __

Re: [f2fs-dev] [PATCH 09/11] vfs: error out -EAGAIN if atime needs to be updated

2023-08-27 Thread Matthew Wilcox
On Sun, Aug 27, 2023 at 09:28:33PM +0800, Hao Xu wrote: > From: Hao Xu > > To enforce nowait semantics, error out -EAGAIN if atime needs to be > updated. Squash this into patch 6. Otherwise patch 6 makes no sense. ___ Linux-f2fs-devel mailing list L

Re: [f2fs-dev] [PATCH 07/11] vfs: add nowait parameter for file_accessed()

2023-08-27 Thread Matthew Wilcox
On Sun, Aug 27, 2023 at 09:28:31PM +0800, Hao Xu wrote: > From: Hao Xu > > Add a boolean parameter for file_accessed() to support nowait semantics. > Currently it is true only with io_uring as its initial caller. So why do we need to do this as part of this series? Apparently it hasn't caused a

Re: [f2fs-dev] [PATCH 07/11] vfs: add nowait parameter for file_accessed()

2023-08-29 Thread Matthew Wilcox
On Tue, Aug 29, 2023 at 03:46:13PM +0800, Hao Xu wrote: > On 8/28/23 05:32, Matthew Wilcox wrote: > > On Sun, Aug 27, 2023 at 09:28:31PM +0800, Hao Xu wrote: > > > From: Hao Xu > > > > > > Add a boolean parameter for file_accessed() to support nowait semant

Re: [f2fs-dev] [PATCH 02/11] xfs: add NOWAIT semantics for readdir

2023-08-29 Thread Matthew Wilcox
On Tue, Aug 29, 2023 at 03:41:43PM +0800, Hao Xu wrote: > On 8/28/23 04:44, Matthew Wilcox wrote: > > > @@ -391,10 +401,17 @@ xfs_dir2_leaf_getdents( > > > bp = NULL; > > > } > > >

Re: [f2fs-dev] [PATCH v2] f2fs: add support for an i_version counter

2023-11-30 Thread Matthew Wilcox
On Thu, Nov 30, 2023 at 02:04:09AM -0700, Yangtao Li wrote: > NFSv4 mandates a change attribute to avoid problems with timestamp > granularity, which Linux implements using the i_version counter. This is > particularly important when the underlying filesystem is fast. > > BTW introduce a new mount

Re: [f2fs-dev] [PATCH] f2fs: Support enhanced hot/cold data separation for f2fs

2024-01-25 Thread Matthew Wilcox
On Wed, Dec 07, 2022 at 12:51:13PM -0800, Luis Chamberlain wrote: > On Wed, Nov 30, 2022 at 03:18:41PM +0000, Matthew Wilcox wrote: > > From a filesystem point of view, you need to ensure that you handle folios > > larger than PAGE_SIZE correctly. The easiest way is to spread

Re: [f2fs-dev] [PATCH] f2fs: Support enhanced hot/cold data separation for f2fs

2024-01-26 Thread Matthew Wilcox
On Thu, Jan 25, 2024 at 12:54:47PM -0800, Luis Chamberlain wrote: > On Thu, Jan 25, 2024 at 08:47:39PM +0000, Matthew Wilcox wrote: > > On Wed, Dec 07, 2022 at 12:51:13PM -0800, Luis Chamberlain wrote: > > > Me and Pankaj are very interested in helping on this front. And so we

Re: [f2fs-dev] [PATCH v16 0/9] Cache insensitive cleanup for ext4/f2fs

2024-04-05 Thread Matthew Wilcox
On Fri, Apr 05, 2024 at 03:13:23PM +0300, Eugen Hristev wrote: > Hello, > > I am trying to respin the series here : > https://www.spinics.net/lists/linux-ext4/msg85081.html The subject here is "Cache insensitive cleanup for ext4/f2fs". Cache insensitive means something entirely different https://

Re: [f2fs-dev] [PATCH v2 3/8] f2fs: drop usage of page_index

2024-04-23 Thread Matthew Wilcox
On Wed, Apr 24, 2024 at 01:03:34AM +0800, Kairui Song wrote: > @@ -4086,8 +4086,7 @@ void f2fs_clear_page_cache_dirty_tag(struct page *page) > unsigned long flags; > > xa_lock_irqsave(&mapping->i_pages, flags); > - __xa_clear_mark(&mapping->i_pages, page_index(page), > -

Re: [PATCH 6/6] mm: Remove page_mapping()

2024-04-24 Thread Matthew Wilcox
On Wed, Apr 24, 2024 at 04:34:23PM -0700, Andrew Morton wrote: > For some reason, > > mm/hugetlb.c: In function 'hugetlb_page_mapping_lock_write': > mm/hugetlb.c:2164:41: error: implicit declaration of function 'page_mapping'; > did you mean 'page_mapped'? [-Werror=implicit-function-declaration]

Re: [f2fs-dev] [PATCH] f2fs: get rid of buffer_head use

2024-06-06 Thread Matthew Wilcox
On Thu, Jun 06, 2024 at 05:50:37PM +0800, Chao Yu wrote: > For later folio conversion. What tree is this against? > @@ -3957,32 +3976,32 @@ static int read_raw_super_block(struct f2fs_sb_info > *sbi, > return -ENOMEM; > > for (block = 0; block < 2; block++) { > -

Re: [f2fs-dev] [PATCH v2] f2fs: get rid of buffer_head use

2024-06-07 Thread Matthew Wilcox
On Fri, Jun 07, 2024 at 06:18:29PM +0800, Chao Yu wrote: > @@ -1990,6 +1989,12 @@ static inline struct f2fs_super_block > *F2FS_RAW_SUPER(struct f2fs_sb_info *sbi) > return (struct f2fs_super_block *)(sbi->raw_super); > } > > +static inline struct f2fs_super_block *F2FS_SUPER_BLOCK(struct

Re: [f2fs-dev] [PATCH v2] f2fs: get rid of buffer_head use

2024-06-07 Thread Matthew Wilcox
On Fri, Jun 07, 2024 at 10:10:52PM +0800, Chao Yu wrote: > On 2024/6/7 21:33, Matthew Wilcox wrote: > > On Fri, Jun 07, 2024 at 06:18:29PM +0800, Chao Yu wrote: > > > @@ -1990,6 +1989,12 @@ static inline struct f2fs_super_block > > > *F2FS_RAW_SUP

[f2fs-dev] [6.12] Conversion of aops->write_end to use a folio

2024-07-10 Thread Matthew Wilcox
For the 6.12 merge window, I intend to submit a patch series loosely similar to the one you can find at http://git.infradead.org/?p=users/willy/pagecache.git;a=shortlog;h=refs/heads/write-end (aka git://git.infradead.org/users/willy/pagecache.git write-end) This is split into a few pieces: - D

[f2fs-dev] State of removing page->index

2024-07-22 Thread Matthew Wilcox
My project for the next few weeks is removing page->index. The last patch in the series is mostly: +++ b/include/linux/mm_types.h @@ -103,7 +103,7 @@ struct page { /* See page-flags.h for PAGE_MAPPING_FLAGS */ struct address_space *mapping;

Re: [f2fs-dev] [linux-next:master] [fs] cdc4ad36a8: kernel_BUG_at_include/linux/page-flags.h

2024-08-06 Thread Matthew Wilcox
On Tue, Aug 06, 2024 at 10:26:17PM +0800, kernel test robot wrote: > kernel test robot noticed "kernel_BUG_at_include/linux/page-flags.h" on: > > commit: cdc4ad36a871b7ac43fcc6b2891058d332ce60ce ("fs: Convert > aops->write_begin to take a folio") > https://git.kernel.org/cgit/linux/kernel/git/nex

Re: [f2fs-dev] [PATCH 01/14] btrfs: convert clear_page_extent_mapped() to take a folio

2024-08-21 Thread Matthew Wilcox
On Thu, Aug 22, 2024 at 09:37:01AM +0800, Li Zetao wrote: > -void clear_page_extent_mapped(struct page *page) > +void clear_page_extent_mapped(struct folio *folio) Rename it to clear_folio_extent_mapped()? ___ Linux-f2fs-devel mailing list Linux-f2fs-

Re: [f2fs-dev] [PATCH 02/14] btrfs: convert get_next_extent_buffer() to take a folio

2024-08-21 Thread Matthew Wilcox
On Thu, Aug 22, 2024 at 09:37:02AM +0800, Li Zetao wrote: > static struct extent_buffer *get_next_extent_buffer( > - const struct btrfs_fs_info *fs_info, struct page *page, u64 > bytenr) > + const struct btrfs_fs_info *fs_info, struct folio *folio, u64 > bytenr) > { >

Re: [f2fs-dev] [PATCH 05/14] btrfs: convert read_key_bytes() to take a folio

2024-08-21 Thread Matthew Wilcox
On Thu, Aug 22, 2024 at 09:37:05AM +0800, Li Zetao wrote: > @@ -762,7 +762,7 @@ static struct page *btrfs_read_merkle_tree_page(struct > inode *inode, >* [ inode objectid, BTRFS_MERKLE_ITEM_KEY, offset in bytes ] >*/ > ret = read_key_bytes(BTRFS_I(inode), BTRFS_VERITY_MERKLE_

Re: [f2fs-dev] [PATCH 02/14] btrfs: convert get_next_extent_buffer() to take a folio

2024-08-22 Thread Matthew Wilcox
On Thu, Aug 22, 2024 at 08:28:09PM +0930, Qu Wenruo wrote: > 在 2024/8/22 12:35, Matthew Wilcox 写道: > > > - while (cur < page_start + PAGE_SIZE) { > > > + while (cur < folio_start + PAGE_SIZE) { > > > > Presumably we want to support large folios in btrfs at

Re: [f2fs-dev] [PATCH 02/14] btrfs: convert get_next_extent_buffer() to take a folio

2024-08-23 Thread Matthew Wilcox
On Fri, Aug 23, 2024 at 11:43:41AM +0930, Qu Wenruo wrote: > 在 2024/8/23 07:55, Qu Wenruo 写道: > > 在 2024/8/22 21:37, Matthew Wilcox 写道: > > > On Thu, Aug 22, 2024 at 08:28:09PM +0930, Qu Wenruo wrote: > > > > But what will happen if some writes happened to that lar

Re: [f2fs-dev] [PATCH 02/14] btrfs: convert get_next_extent_buffer() to take a folio

2024-08-26 Thread Matthew Wilcox
On Mon, Aug 26, 2024 at 10:13:01AM -0400, Josef Bacik wrote: > On Fri, Aug 23, 2024 at 04:38:27PM +0100, Matthew Wilcox wrote: > > On Fri, Aug 23, 2024 at 11:43:41AM +0930, Qu Wenruo wrote: > > > 在 2024/8/23 07:55, Qu Wenruo 写道: > > > > 在 2024/8/22 21:37, Matthew Wi

Re: [f2fs-dev] [syzbot] BUG: unable to handle kernel NULL pointer dereference in set_page_dirty

2022-08-29 Thread Matthew Wilcox
On Mon, Aug 29, 2022 at 10:52:57AM -0700, Jaegeuk Kim wrote: > On 08/25, Andrew Morton wrote: > > (cc fsf2 developers) > > > > On Thu, 25 Aug 2022 08:29:32 -0700 syzbot > > wrote: > > > > > Hello, > > > > > > syzbot found the following issue on: > > > > > > HEAD commit:a41a877bc12d Merge

Re: [f2fs-dev] [PATCH v3 02/23] filemap: Added filemap_get_folios_tag()

2022-10-24 Thread Matthew Wilcox
On Mon, Oct 17, 2022 at 01:24:30PM -0700, Vishal Moola (Oracle) wrote: > This is the equivalent of find_get_pages_range_tag(), except for folios > instead of pages. > > One noteable difference is filemap_get_folios_tag() does not take in a > maximum pages argument. It instead tries to fill a folio

Re: [f2fs-dev] [PATCH v3 01/23] pagemap: Add filemap_grab_folio()

2022-10-24 Thread Matthew Wilcox
es_range_tag(). I'm still not loving the name, but it does have historical precedent and I can't think of a better one. Reviewed-by: Matthew Wilcox (Oracle) ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists

Re: [f2fs-dev] [PATCH v3 03/23] filemap: Convert __filemap_fdatawait_range() to use filemap_get_folios_tag()

2022-10-24 Thread Matthew Wilcox
initely say that it removes 50 bytes of text and two calls to compound_head(). And that way, this patch justifies its existance by itself ;-) > Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Matthew Wilcox (Oracle) ___ Linux-f2fs-devel mail

Re: [f2fs-dev] [PATCH v3 04/23] page-writeback: Convert write_cache_pages() to use filemap_get_folios_tag()

2022-10-24 Thread Matthew Wilcox
rt for large folios to this function. > Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Matthew Wilcox (Oracle) ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH 04/23] page-writeback: Convert write_cache_pages() to use filemap_get_folios_tag()

2022-11-04 Thread Matthew Wilcox
On Wed, Oct 19, 2022 at 08:01:52AM +1100, Dave Chinner wrote: > On Thu, Sep 01, 2022 at 03:01:19PM -0700, Vishal Moola (Oracle) wrote: > > @@ -2313,17 +2313,18 @@ int write_cache_pages(struct address_space *mapping, > > while (!done && (index <= end)) { > > int i; > > > > -

Re: [f2fs-dev] [PATCH 04/23] page-writeback: Convert write_cache_pages() to use filemap_get_folios_tag()

2022-11-04 Thread Matthew Wilcox
On Fri, Nov 04, 2022 at 11:32:35AM +1100, Dave Chinner wrote: > At minimum, it needs to be documented, though I'd much prefer that > we explicitly duplicate write_cache_pages() as write_cache_folios() > with a callback that takes a folio and change the code to be fully > multi-page folio safe. Then

Re: [f2fs-dev] [PATCH] f2fs: support fault injection for flush submission error

2022-11-09 Thread Matthew Wilcox
On Thu, Nov 10, 2022 at 02:35:49AM +0800, Yangtao Li wrote: > +++ b/fs/f2fs/segment.c > @@ -486,7 +486,17 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi, bool > from_bg) > static int __submit_flush_wait(struct f2fs_sb_info *sbi, > struct block_device *bdev) > {

Re: [f2fs-dev] [PATCH v2] f2fs: support fault injection for flush submission error

2022-11-10 Thread Matthew Wilcox
On Thu, Nov 10, 2022 at 11:25:22AM +0800, Yangtao Li wrote: > Since we now support read, write, and discard in FAULT_INJECT, > let's add support for flush. But _why_? There is a verifiable thing that didn't happen to the data if the read/write/discard fails. If flush fails ... how do you know? W

Re: [f2fs-dev] [PATCH 1/5] fs: ext4: initialize fsdata in pagecache_write()

2022-11-21 Thread Matthew Wilcox
On Mon, Nov 21, 2022 at 11:48:40AM -0800, Andrew Morton wrote: > On Mon, 21 Nov 2022 12:21:30 +0100 Alexander Potapenko > wrote: > > > When aops->write_begin() does not initialize fsdata, KMSAN reports > > an error passing the latter to aops->write_end(). > > > > Fix this by unconditionally ini

Re: [f2fs-dev] [PATCH v3 14/23] f2fs: Convert f2fs_write_cache_pages() to use filemap_get_folios_tag()

2022-11-29 Thread Matthew Wilcox
On Mon, Nov 14, 2022 at 03:02:34PM +0800, Chao Yu wrote: > On 2022/10/18 4:24, Vishal Moola (Oracle) wrote: > > Converted the function to use a folio_batch instead of pagevec. This is in > > preparation for the removal of find_get_pages_range_tag(). > > > > Also modified f2fs_all_cluster_page_read

Re: [f2fs-dev] [PATCH] f2fs: Support enhanced hot/cold data separation for f2fs

2022-11-30 Thread Matthew Wilcox
On Wed, Nov 30, 2022 at 08:48:04PM +0800, Yangtao Li wrote: > Hi, > > > Thanks for reviewing this. I think the real solution to this is > > that f2fs should be using large folios. That way, the page cache > > will keep track of dirtiness on a per-folio basis, and if your folios > > are at least

Re: [f2fs-dev] [RFC PATCH] f2fs: Convert f2fs_write_cache_pages() to use filemap_get_folios_tag()

2022-12-15 Thread Matthew Wilcox
On Thu, Dec 15, 2022 at 09:48:41AM +0800, Chao Yu wrote: > On 2022/12/13 3:13, Vishal Moola (Oracle) wrote: > > +add_more: > > + pages[nr_pages] = folio_page(folio,idx); > > + folio_ref_inc(folio); > > It looks if CONFIG_LRU_GEN is not set, folio_ref_inc() does

Re: [f2fs-dev] [RFC PATCH] f2fs: Convert f2fs_write_cache_pages() to use filemap_get_folios_tag()

2023-01-03 Thread Matthew Wilcox
On Thu, Dec 15, 2022 at 11:02:24AM -0800, Jaegeuk Kim wrote: > On 12/12, Vishal Moola (Oracle) wrote: > > @@ -2994,13 +2998,38 @@ static int f2fs_write_cache_pages(struct > > address_space *mapping, > > tag_pages_for_writeback(mapping, index, end); > > done_index = index; > > w

Re: [f2fs-dev] [PATCH] fscrypt: Copy the memcg information to the ciphertext page

2023-01-29 Thread Matthew Wilcox
On Sun, Jan 29, 2023 at 10:10:35AM -0800, Eric Biggers wrote: > On Sun, Jan 29, 2023 at 12:18:51PM +0000, Matthew Wilcox (Oracle) wrote: > > Both f2fs and ext4 end up passing the ciphertext page to > > wbc_account_cgroup_owner(). At the moment, the ciphertext page appears >

Re: [f2fs-dev] [PATCH] f2fs: get out of a repeat loop when getting a locked data page

2023-03-27 Thread Matthew Wilcox
On Mon, Mar 27, 2023 at 08:30:33AM -0700, Jaegeuk Kim wrote: > On 03/26, Chao Yu wrote: > > On 2023/3/24 5:39, Jaegeuk Kim wrote: > > > https://bugzilla.kernel.org/show_bug.cgi?id=216050 > > > > > > Somehow we're getting a page which has a different mapping. > > > Let's avoid the infinite loop. >

Re: [f2fs-dev] [PATCH 03/17] fs: rename and move block_page_mkwrite_return

2023-04-24 Thread Matthew Wilcox
On Mon, Apr 24, 2023 at 07:49:12AM +0200, Christoph Hellwig wrote: > block_page_mkwrite_return is neither block nor mkwrite specific, and > should not be under CONFIG_BLOCK. Move it to mm.h and rename it to > errno_to_vmfault. Could you move it about 300 lines down and put it near vmf_error() so

Re: [f2fs-dev] [PATCH 17/17] fs: add CONFIG_BUFFER_HEAD

2023-04-28 Thread Matthew Wilcox
On Fri, Apr 28, 2023 at 05:11:57PM -0700, Luis Chamberlain wrote: > [ 11.245248] BUG: kernel NULL pointer dereference, address: > [ 11.254581] #PF: supervisor read access in kernel mode > [ 11.257387] #PF: error_code(0x) - not-present page > [ 11.260921] PGD 0 P4D 0 > [

Re: [f2fs-dev] [PATCH 17/17] fs: add CONFIG_BUFFER_HEAD

2023-05-01 Thread Matthew Wilcox
On Sun, Apr 30, 2023 at 08:14:03PM -0700, Luis Chamberlain wrote: > On Sat, Apr 29, 2023 at 02:20:17AM +0100, Matthew Wilcox wrote: > > > [ 11.322212] Call Trace: > > > [ 11.323224] > > > [ 11.324146] iomap_readpage_iter+0x96/0x300 > > > [

Re: [f2fs-dev] [PATCH 08/13] iomap: assign current->backing_dev_info in iomap_file_buffered_write

2023-05-22 Thread Matthew Wilcox
On Mon, May 22, 2023 at 06:06:27PM -0700, Darrick J. Wong wrote: > On Fri, May 19, 2023 at 11:35:16AM +0200, Christoph Hellwig wrote: > > Move the assignment to current->backing_dev_info from the callers into > > iomap_file_buffered_write to reduce boiler plate code and reduce the > > scope to just

Re: [f2fs-dev] [PATCH 16/17] block: use iomap for writes to block devices

2023-05-24 Thread Matthew Wilcox
On Wed, May 24, 2023 at 08:27:13AM +1000, Dave Chinner wrote: > On Fri, May 19, 2023 at 04:22:01PM +0200, Hannes Reinecke wrote: > > I'm hitting this during booting: > > [5.016324] > > [5.030256] iomap_iter+0x11a/0x350 > > [5.030264] iomap_readahead+0x1eb/0x2c0 > > [5.030272] r

Re: [f2fs-dev] f2fs async buffered write patch

2023-06-26 Thread Matthew Wilcox
e fixed. > and the generic_perform_write method is still used. So it seems > >  reasonable to make IOCB_NOWAIT be handled correctly by the > >  generic_perform_write function. This means that we need to modify No. Use the modern infrastructure. >  several places mentioned by

Re: [f2fs-dev] [PATCH 01/32] block: Provide blkdev_get_handle_* functions

2023-07-04 Thread Matthew Wilcox
On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > +struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode, > + void *holder, const struct blk_holder_ops *hops) > +{ > + struct bdev_handle *handle = kmalloc(sizeof(struct bdev_handle), > +

Re: [f2fs-dev] [PATCH 01/32] block: Provide blkdev_get_handle_* functions

2023-07-04 Thread Matthew Wilcox
On Tue, Jul 04, 2023 at 07:06:26AM -0700, Bart Van Assche wrote: > On 7/4/23 05:21, Jan Kara wrote: > > +struct bdev_handle { > > + struct block_device *bdev; > > + void *holder; > > +}; > > Please explain in the patch description why a holder pointer is introduced > in struct bdev_handle and

Re: [f2fs-dev] [PATCH] fs: introduce is_dot_dotdot helper for cleanup

2019-12-02 Thread Matthew Wilcox
On Tue, Dec 03, 2019 at 10:07:41AM +0800, Tiezhu Yang wrote: > On 12/03/2019 04:03 AM, Matthew Wilcox wrote: > > On Mon, Dec 02, 2019 at 06:10:13PM +0800, Tiezhu Yang wrote: > > > There exists many similar and duplicate codes to check "." and "..", > >

Re: [f2fs-dev] [PATCH v2] fs: introduce is_dot_dotdot helper for cleanup

2019-12-03 Thread Matthew Wilcox
On Tue, Dec 03, 2019 at 08:56:50PM +0800, Tiezhu Yang wrote: > There exists many similar and duplicate codes to check "." and "..", > so introduce is_dot_dotdot helper to make the code more clean. > > Signed-off-by: Tiezhu Yang > --- > > v2: > - use the better performance implementation of is_

Re: [f2fs-dev] [PATCH v2] fs: introduce is_dot_dotdot helper for cleanup

2019-12-04 Thread Matthew Wilcox
On Thu, Dec 05, 2019 at 08:56:07AM +0800, Tiezhu Yang wrote: > > And, as I asked twice in the last round of review, did you benchmark > > this change? > > Before sending this v2 patch, I have done the test used with your test > program and already pointed out the following implementation is better

Re: [f2fs-dev] [PATCH v3] fs: introduce is_dot_dotdot helper for cleanup

2019-12-08 Thread Matthew Wilcox
On Sun, Dec 08, 2019 at 03:41:44AM +, Al Viro wrote: > On Sat, Dec 07, 2019 at 07:35:48PM +0800, Tiezhu Yang wrote: > > There exists many similar and duplicate codes to check "." and "..", > > so introduce is_dot_dotdot helper to make the code more clean. > > Umm... No objections, in principl

Re: [f2fs-dev] [PATCH v4] fs: introduce is_dot_or_dotdot helper for cleanup

2019-12-10 Thread Matthew Wilcox
On Tue, Dec 10, 2019 at 08:10:01PM +0800, Tiezhu Yang wrote: > There exists many similar and duplicate codes to check "." and "..", > so introduce is_dot_or_dotdot helper to make the code more clean. > > Signed-off-by: Tiezhu Yang Rev

Re: [f2fs-dev] [PATCH v5] fs: introduce is_dot_or_dotdot helper for cleanup

2019-12-11 Thread Matthew Wilcox
On Wed, Dec 11, 2019 at 03:17:11PM +0800, Gao Xiang wrote: > > static inline bool is_dot_or_dotdot(const unsigned char *name, size_t len) > > { > > if (len >= 1 && unlikely(name[0] == '.')) { > > > And I suggest drop "unlikely" here since files start with prefix > '.' (plus specical ".",

Re: [f2fs-dev] [PATCH v4] fs: introduce is_dot_or_dotdot helper for cleanup

2019-12-12 Thread Matthew Wilcox
On Tue, Dec 10, 2019 at 11:19:13AM -0800, Eric Biggers wrote: > > +static inline bool is_dot_or_dotdot(const unsigned char *name, size_t len) > > +{ > > + if (unlikely(name[0] == '.')) { > > + if (len < 2 || (len == 2 && name[1] == '.')) > > + return true; > > + } >

Re: [f2fs-dev] [PATCH v3] fs: Fix page_mkwrite off-by-one errors

2019-12-18 Thread Matthew Wilcox
On Wed, Dec 18, 2019 at 10:52:16AM -0800, Darrick J. Wong wrote: > > @@ -9016,13 +9016,11 @@ vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf) > > ret = VM_FAULT_NOPAGE; /* make the VM retry the fault */ > > again: > > lock_page(page); > > - size = i_size_read(inode); > > > > - if

Re: [f2fs-dev] [PATCH] f2fs: introduce DEFAULT_IO_TIMEOUT_JIFFIES

2019-12-31 Thread Matthew Wilcox
On Mon, Dec 23, 2019 at 09:41:02AM +0100, Geert Uytterhoeven wrote: > Hi, > > CC linux-fsdevel > > On Mon, Dec 23, 2019 at 5:01 AM Chao Yu wrote: > > As Geert Uytterhoeven reported: > > > > for parameter HZ/50 in congestion_wait(BLK_RW_ASYNC, HZ/50); > > > > On some platforms, HZ can be less tha

[f2fs-dev] [PATCH 03/12] readahead: Put pages in cache earlier

2020-01-24 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" At allocation time, put the pages in the cache unless we're using ->readpages. Signed-off-by: Matthew Wilcox (Oracle) Cc: linux-bt...@vger.kernel.org Cc: linux-er...@lists.ozlabs.org Cc: linux-e...@vger.kernel.org Cc: linux-f2fs-devel@lists.

[f2fs-dev] [PATCH 10/12] f2fs: Convert from readpages to readahead

2020-01-24 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in f2fs Signed-off-by: Matthew Wilcox (Oracle) Cc: linux-f2fs-devel@lists.sourceforge.net --- fs/f2fs/data.c | 33 + include/trace/events/f2fs.h | 6 +++--- 2 files c

[f2fs-dev] [PATCH 00/12] Change readahead API

2020-01-24 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This series adds a readahead address_space operation to eventually replace the readpages operation. The key difference is that pages are added to the page cache as they are allocated (and then looked up by the filesystem) instead of passing them on a l

[f2fs-dev] [PATCH 04/12] mm: Add readahead address space operation

2020-01-24 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This replaces ->readpages with a saner interface: - Return the number of pages not read instead of an ignored error code. - Pages are already in the page cache when ->readahead is called. - Implementation looks up the pages in the page

Re: [f2fs-dev] [PATCH 03/12] readahead: Put pages in cache earlier

2020-01-25 Thread Matthew Wilcox
On Fri, Jan 24, 2020 at 05:35:44PM -0800, Matthew Wilcox wrote: > @@ -192,8 +194,18 @@ unsigned long __do_page_cache_readahead(struct > address_space *mapping, > page = __page_cache_alloc(gfp_mask); > if (!page) > break; >

Re: [f2fs-dev] [PATCH 04/12] mm: Add readahead address space operation

2020-01-30 Thread Matthew Wilcox
On Wed, Jan 29, 2020 at 11:24:56AM +1100, Dave Chinner wrote: > On Fri, Jan 24, 2020 at 05:35:45PM -0800, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > This replaces ->readpages with a saner interface: > > - Return the number of pa

Re: [f2fs-dev] [PATCH 04/12] mm: Add readahead address space operation

2020-01-31 Thread Matthew Wilcox
On Fri, Jan 24, 2020 at 07:57:40PM -0800, Randy Dunlap wrote: > > +``readahead`` > > + called by the VM to read pages associated with the address_space > > + object. The pages are consecutive in the page cache and are > > +locked. The implementation should decrement the page refcount

[f2fs-dev] [PATCH] f2fs: Make f2fs_readpages readable again

2020-02-01 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Remove the horrendous ifdeffery by slipping an IS_ENABLED into f2fs_compressed_file(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/f2fs/data.c | 6 -- fs/f2fs/f2fs.h | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/f2f

[f2fs-dev] [PATCH v4 00/12] Change readahead API

2020-02-01 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" I would particularly value feedback on this from the gfs2 and ocfs2 maintainers. They have non-trivial changes, and a review on patch 5 would be greatly appreciated. This series adds a readahead address_space operation to eventually replace the

[f2fs-dev] [PATCH v4 04/12] mm: Add readahead address space operation

2020-02-01 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This replaces ->readpages with a saner interface: - Return the number of pages not read instead of an ignored error code. - Pages are already in the page cache when ->readahead is called. - Implementation looks up the pages in the page

[f2fs-dev] [PATCH v4 03/12] readahead: Put pages in cache earlier

2020-02-01 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" At allocation time, put the pages in the cache unless we're using ->readpages. Signed-off-by: Matthew Wilcox (Oracle) Cc: linux-bt...@vger.kernel.org Cc: linux-er...@lists.ozlabs.org Cc: linux-e...@vger.kernel.org Cc: linux-f2fs-devel@lists.

[f2fs-dev] [PATCH v4 10/12] f2fs: Convert from readpages to readahead

2020-02-01 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in f2fs Signed-off-by: Matthew Wilcox (Oracle) Cc: linux-f2fs-devel@lists.sourceforge.net --- fs/f2fs/data.c | 35 ++- fs/f2fs/f2fs.h | 5 ++--- fs/f2f

[f2fs-dev] [PATCH v2] f2fs: Make f2fs_readpages readable again

2020-02-02 Thread Matthew Wilcox
Remove the horrendous ifdeffery by slipping an IS_ENABLED into f2fs_compressed_file(). Signed-off-by: Matthew Wilcox (Oracle) --- v2: Fix compilation by adding more dummy functions fs/f2fs/data.c | 6 -- fs/f2fs/f2fs.h | 10 +- 2 files changed, 9 insertions(+), 7 deletions

Re: [f2fs-dev] [PATCH v4 00/12] Change readahead API

2020-02-04 Thread Matthew Wilcox
On Tue, Feb 04, 2020 at 04:32:27PM +0100, David Sterba wrote: > On Sat, Feb 01, 2020 at 07:12:28AM -0800, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > I would particularly value feedback on this from the gfs2 and ocfs2 > > maintainers.

Re: [f2fs-dev] [PATCH v2] f2fs: Make f2fs_readpages readable again

2020-02-04 Thread Matthew Wilcox
On Wed, Feb 05, 2020 at 09:58:29AM +0800, Chao Yu wrote: > On 2020/2/3 11:39, Matthew Wilcox wrote: > > > > Remove the horrendous ifdeffery by slipping an IS_ENABLED into > > f2fs_compressed_file(). > > I'd like to suggest to use > > if

[f2fs-dev] [PATCH v5 12/13] fuse: Convert from readpages to readahead

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in fuse. Switching away from the read_cache_pages() helper gets rid of an implicit call to put_page(), so we can get rid of the get_page() call in fuse_readpages_fill(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/f

[f2fs-dev] [PATCH v5 03/13] mm: Put readahead pages in cache earlier

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" At allocation time, put the pages in the cache unless we're using ->readpages. Signed-off-by: Matthew Wilcox (Oracle) --- mm/readahead.c | 66 -- 1 file changed, 42 insertions(+), 24 deletions(-

[f2fs-dev] [PATCH v5 05/13] mm: Add page_cache_readahead_limit

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" ext4 and f2fs have duplicated the guts of the readahead code so they can read past i_size. Instead, separate out the guts of the readahead code so they can call it directly. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ext4/verity.c

[f2fs-dev] [PATCH v5 04/13] mm: Add readahead address space operation

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This replaces ->readpages with a saner interface: - Return void instead of an ignored error code. - Pages are already in the page cache when ->readahead is called. - Implementation looks up the pages in the page cache instead of having

[f2fs-dev] [PATCH v5 01/13] mm: Fix the return type of __do_page_cache_readahead

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" ra_submit() which is a wrapper around __do_page_cache_readahead() already returns an unsigned long, and the 'nr_to_read' parameter is an unsigned long, so fix __do_page_cache_readahead() to return an unsigned long, even though I'm prett

[f2fs-dev] [PATCH v5 09/13] erofs: Convert compressed files from readpages to readahead

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs. Signed-off-by: Matthew Wilcox (Oracle) --- fs/erofs/zdata.c | 29 + 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 17

[f2fs-dev] [PATCH v5 11/13] f2fs: Convert from readpages to readahead

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in f2fs Signed-off-by: Matthew Wilcox (Oracle) --- fs/f2fs/data.c | 50 +++-- fs/f2fs/f2fs.h | 5 ++-- include/trace/events/f2fs.h | 6 ++--- 3 files c

[f2fs-dev] [PATCH v5 00/13] Change readahead API

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This series adds a readahead address_space operation to eventually replace the readpages operation. The key difference is that pages are added to the page cache as they are allocated (and then looked up by the filesystem) instead of passing them on a l

[f2fs-dev] [PATCH v5 10/13] ext4: Convert from readpages to readahead

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in ext4 Signed-off-by: Matthew Wilcox (Oracle) --- fs/ext4/ext4.h | 3 +-- fs/ext4/inode.c| 23 ++- fs/ext4/readpage.c | 22 -- 3 files changed, 19 insertions(+), 29

[f2fs-dev] [PATCH v5 07/13] btrfs: Convert from readpages to readahead

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in btrfs. Add a readahead_for_each_batch() iterator to optimise the loop in the XArray. Signed-off-by: Matthew Wilcox (Oracle) --- fs/btrfs/extent_io.c| 48 ++--- fs/btrfs/e

[f2fs-dev] [PATCH v5 06/13] fs: Convert mpage_readpages to mpage_readahead

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Implement the new readahead aop and convert all callers (block_dev, exfat, ext2, fat, gfs2, hpfs, isofs, jfs, nilfs2, ocfs2, omfs, qnx6, reiserfs & udf). The callers are all trivial except for GFS2 & OCFS2. Signed-off-by: Matthew Wilcox (Ora

[f2fs-dev] [PATCH v5 02/13] mm: Ignore return value of ->readpages

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" We used to assign the return value to a variable, which we then ignored. Remove the pretence of caring. Signed-off-by: Matthew Wilcox (Oracle) --- mm/readahead.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mm/readah

[f2fs-dev] [PATCH v5 08/13] erofs: Convert uncompressed files from readpages to readahead

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs Signed-off-by: Matthew Wilcox (Oracle) --- fs/erofs/data.c | 39 +--- fs/erofs/zdata.c | 2 +- include/trace/events/erofs.h | 6 +++--- 3 files c

[f2fs-dev] [PATCH v5 13/13] iomap: Convert from readpages to readahead

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in iomap. Convert XFS and ZoneFS to use it. Signed-off-by: Matthew Wilcox (Oracle) --- fs/iomap/buffered-io.c | 101 - fs/iomap/trace.h | 2 +- fs/xfs/xfs_aops.c

Re: [f2fs-dev] [PATCH v5 01/13] mm: Fix the return type of __do_page_cache_readahead

2020-02-11 Thread Matthew Wilcox
On Tue, Feb 11, 2020 at 08:19:14AM +, Johannes Thumshirn wrote: > On 11/02/2020 02:05, Matthew Wilcox wrote: > > even though I'm pretty sure we're not going to readahead more than 2^32 > > pages ever. > > And 640K is more memory than anyone will ever need

Re: [f2fs-dev] [PATCH v5 04/13] mm: Add readahead address space operation

2020-02-11 Thread Matthew Wilcox
On Tue, Feb 11, 2020 at 03:52:30PM +1100, Dave Chinner wrote: > > +struct readahead_control { > > + struct file *file; > > + struct address_space *mapping; > > +/* private: use the readahead_* accessors instead */ > > + pgoff_t start; > > + unsigned int nr_pages; > > + unsigned int batch_

Re: [f2fs-dev] [PATCH 00/12] Change readahead API

2020-02-13 Thread Matthew Wilcox
On Wed, Feb 12, 2020 at 08:38:52PM -0800, Andrew Morton wrote: > On Fri, 24 Jan 2020 17:35:41 -0800 Matthew Wilcox wrote: > > > From: "Matthew Wilcox (Oracle)" > > > > This series adds a readahead address_space operation to eventually > > replace the rea

Re: [f2fs-dev] [PATCH v5 01/13] mm: Fix the return type of __do_page_cache_readahead

2020-02-13 Thread Matthew Wilcox
On Thu, Feb 13, 2020 at 07:19:53PM -0800, John Hubbard wrote: > On 2/10/20 5:03 PM, Matthew Wilcox wrote: > > @@ -161,7 +161,7 @@ unsigned int __do_page_cache_readahead(struct > > address_space *mapping, > > unsigned long end_index;/* The last page we want to read

Re: [f2fs-dev] [PATCH v5 01/13] mm: Fix the return type of __do_page_cache_readahead

2020-02-14 Thread Matthew Wilcox
On Mon, Feb 10, 2020 at 05:03:36PM -0800, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > ra_submit() which is a wrapper around __do_page_cache_readahead() already > returns an unsigned long, and the 'nr_to_read' parameter is an unsigned > long, so

Re: [f2fs-dev] [PATCH v5 04/13] mm: Add readahead address space operation

2020-02-14 Thread Matthew Wilcox
On Thu, Feb 13, 2020 at 09:36:25PM -0800, John Hubbard wrote: > > +static inline struct page *readahead_page(struct readahead_control *rac) > > +{ > > + struct page *page; > > + > > + if (!rac->nr_pages) > > + return NULL; > > + > > + page = xa_load(&rac->mapping->i_pages, rac->star

Re: [f2fs-dev] [PATCH v5 03/13] mm: Put readahead pages in cache earlier

2020-02-14 Thread Matthew Wilcox
On Thu, Feb 13, 2020 at 07:36:38PM -0800, John Hubbard wrote: > I see two distinct things happening in this patch, and I think they want to > each be > in their own patch: > > 1) A significant refactoring of the page loop, and > > 2) Changing the place where the page is added to the page cache.

[f2fs-dev] [PATCH v6 12/19] erofs: Convert uncompressed files from readpages to readahead

2020-02-17 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs Signed-off-by: Matthew Wilcox (Oracle) --- fs/erofs/data.c | 39 +--- fs/erofs/zdata.c | 2 +- include/trace/events/erofs.h | 6 +++--- 3 files c

[f2fs-dev] [PATCH v6 09/19] mm: Add page_cache_readahead_limit

2020-02-17 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" ext4 and f2fs have duplicated the guts of the readahead code so they can read past i_size. Instead, separate out the guts of the readahead code so they can call it directly. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ext4/verity.c

[f2fs-dev] [PATCH v6 08/16] fs: Convert mpage_readpages to mpage_readahead

2020-02-17 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Implement the new readahead aop and convert all callers (block_dev, exfat, ext2, fat, gfs2, hpfs, isofs, jfs, nilfs2, ocfs2, omfs, qnx6, reiserfs & udf). The callers are all trivial except for GFS2 & OCFS2. Signed-off-by: Matthew Wilcox (Or

[f2fs-dev] [PATCH v6 07/16] mm: Add page_cache_readahead_limit

2020-02-17 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" ext4 and f2fs have duplicated the guts of the readahead code so they can read past i_size. Instead, separate out the guts of the readahead code so they can call it directly. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ext4/verity.c

  1   2   3   4   5   6   7   8   9   10   >