From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033095AbdAEITK (ORCPT ); Thu, 5 Jan 2017 03:19:10 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:9120 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938138AbdAEISS (ORCPT ); Thu, 5 Jan 2017 03:18:18 -0500 Subject: Re: [f2fs-dev] [PATCH 08/10] f2fs: relax async discard commands more To: Jaegeuk Kim , , , References: <20161230185117.3832-1-jaegeuk@kernel.org> <20161230185117.3832-8-jaegeuk@kernel.org> From: Chao Yu Message-ID: <1bf8505d-2ac4-e635-685d-287bab6ad0e2@huawei.com> Date: Thu, 5 Jan 2017 16:17:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.586E013D.0414,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: b6d2ec6fcd78111f929d78b1ca540366 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jaegeuk, I can see patch named ("f2fs: call f2fs_wait_all_discard_bio for an error case") was merged in dev-test, but I think it's no needed to change error case handling like this since f2fs_wait_all_discard_bio should always be called after clear_prefree_segments. Thanks, On 2017/1/5 11:19, Chao Yu wrote: > On 2017/1/4 17:29, Chao Yu wrote: >> On 2016/12/31 2:51, Jaegeuk Kim wrote: >>> This patch relaxes async discard commands to avoid waiting its end_io during >>> checkpoint. >>> Instead of waiting them during checkpoint, it will be done when actually reusing >>> them. >>> >>> Test on initial partition of nvme drive. >>> >>> # time fstrim /mnt/test >>> >>> Before : 6.158s >>> After : 4.822s >>> >>> Signed-off-by: Jaegeuk Kim >> >> Reviewed-by: Chao Yu >> >> One comment below, > > I still have a comment on this patch. > >>> -void f2fs_wait_all_discard_bio(struct f2fs_sb_info *sbi) >>> +/* This should be covered by global mutex, &sit_i->sentry_lock */ >>> +void f2fs_wait_discard_bio(struct f2fs_sb_info *sbi, unsigned int segno) >>> { >>> struct list_head *wait_list = &(SM_I(sbi)->wait_list); >>> struct bio_entry *be, *tmp; >>> @@ -646,7 +650,15 @@ void f2fs_wait_all_discard_bio(struct f2fs_sb_info *sbi) >>> struct bio *bio = be->bio; >>> int err; >>> >>> - wait_for_completion_io(&be->event); >>> + if (!completion_done(&be->event)) { >>> + if ((be->start_segno >= segno && >>> + be->end_segno <= segno) || >> >> segno >= be->start_segno && segno < be->end_segno ? > > Can you check this? > > Thanks, >