From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754861AbcIBShD (ORCPT ); Fri, 2 Sep 2016 14:37:03 -0400 Received: from mail.kernel.org ([198.145.29.136]:55788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753533AbcIBShB (ORCPT ); Fri, 2 Sep 2016 14:37:01 -0400 Date: Fri, 2 Sep 2016 11:36:58 -0700 From: Jaegeuk Kim To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [PATCH] f2fs: merge WRITE bio into previous WRITE_SYNC Message-ID: <20160902183658.GA917@jaegeuk> References: <20160827005358.91477-1-jaegeuk@kernel.org> <10d2270d-6226-a269-c8a4-75bedfd0364c@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10d2270d-6226-a269-c8a4-75bedfd0364c@huawei.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 02, 2016 at 03:33:33PM +0800, Chao Yu wrote: > Hi Jaegeuk, > > On 2016/8/27 8:53, Jaegeuk Kim wrote: > > This can avoid bio splits due to different op_flags. > > I thought about this, but I think this is not a good idea to increase merging > ratio of pages in bio. It breaks the rule of SYNC/ASYNC IO defined by system > which indicate degree of IO emergency, finally, some/more non-emergent IO will > treated as emergent one by IO scheduler, it will interrupt SYNC IOs in block > layer, more seriously, it may make real SYNC IO starvation. I understand your concern. Originally, I tried to avoid breaking a big WRITE_SYNC by a small number of WRITE. And, I thought new WRITE can be piggybacked into previous WRITE_SYNC. IMO, this happens very occassionally since previous pending bio should be WRITE_SYNC while a new request is WRITE. Even if this happens, the piggybacked size would not exceed over bio's max pages. If lots of WRITE come, we won't change at all. Thanks, > > Thanks, > > > > > Signed-off-by: Jaegeuk Kim > > --- > > fs/f2fs/data.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > > index 7c8e219..c7c2022 100644 > > --- a/fs/f2fs/data.c > > +++ b/fs/f2fs/data.c > > @@ -267,6 +267,11 @@ void f2fs_submit_page_mbio(struct f2fs_io_info *fio) > > > > down_write(&io->io_rwsem); > > > > + /* WRITE can be merged into previous WRITE_SYNC */ > > + if (io->bio && io->last_block_in_bio == fio->new_blkaddr - 1 && > > + io->fio.op == fio->op && io->fio.op_flags == WRITE_SYNC) > > + fio->op_flags = WRITE_SYNC; > > + > > if (io->bio && (io->last_block_in_bio != fio->new_blkaddr - 1 || > > (io->fio.op != fio->op || io->fio.op_flags != fio->op_flags))) > > __submit_merged_bio(io); > >