[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190619110836.GC32409@quack2.suse.cz>
Date: Wed, 19 Jun 2019 13:08:36 +0200
From: Jan Kara <jack@...e.cz>
To: jinshui zhang <leozhangjs@...il.com>
Cc: tytso@....edu, adilger.kernel@...ger.ca,
linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org,
zhangjs <zachary@...shancloud.com>
Subject: Re: [PATCH] ext4: make __ext4_get_inode_loc plug
On Mon 17-06-19 23:57:12, jinshui zhang wrote:
> From: zhangjs <zachary@...shancloud.com>
>
> If the task is unplugged when called, the inode_readahead_blks may not be merged,
> these will cause small pieces of io, It should be plugged.
>
> Signed-off-by: zhangjs <zachary@...shancloud.com>
Out of curiosity, on which path do you see __ext4_get_inode_loc() being
called without IO already plugged?
Otherwise the patch looks good to me. You can add:
Reviewed-by: Jan Kara <jack@...e.cz>
Honza
> ---
> fs/ext4/inode.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index c7f77c6..8fe046b 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -4570,6 +4570,7 @@ static int __ext4_get_inode_loc(struct inode *inode,
> struct buffer_head *bh;
> struct super_block *sb = inode->i_sb;
> ext4_fsblk_t block;
> + struct blk_plug plug;
> int inodes_per_block, inode_offset;
>
> iloc->bh = NULL;
> @@ -4654,6 +4655,8 @@ static int __ext4_get_inode_loc(struct inode *inode,
> }
>
> make_io:
> + blk_start_plug(&plug);
> +
> /*
> * If we need to do any I/O, try to pre-readahead extra
> * blocks from the inode table.
> @@ -4688,6 +4691,9 @@ static int __ext4_get_inode_loc(struct inode *inode,
> get_bh(bh);
> bh->b_end_io = end_buffer_read_sync;
> submit_bh(REQ_OP_READ, REQ_META | REQ_PRIO, bh);
> +
> + blk_finish_plug(&plug);
> +
> wait_on_buffer(bh);
> if (!buffer_uptodate(bh)) {
> EXT4_ERROR_INODE_BLOCK(inode, block,
> --
> 1.8.3.1
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists