Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4805567imj; Wed, 13 Feb 2019 01:08:13 -0800 (PST) X-Google-Smtp-Source: AHgI3IYbczM3wnCT1UW3q1bNmEsd7T+LQds7TpqtlspGa+mz2zUG02ROYB5gi5b2E6xVZTAS5ys3 X-Received: by 2002:a63:e451:: with SMTP id i17mr7906546pgk.413.1550048892896; Wed, 13 Feb 2019 01:08:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550048892; cv=none; d=google.com; s=arc-20160816; b=seVkXqBUoOF20klcupMEjIfqRF+G85bDAT+d6lPlNPy8GZiBvHPj4aHaUyyq3s6yiJ QD6x1+fI/4mxvdXvu7kZppK34MYW+wKfVJvh+L1OhfbtHHd/lLC+C13ogs+5htuarnbA 3yzN2hCldnr2oEIDVqaVrYRdTXjWuatNFj3oC5I3O34IfXphuVXM9rNY1Hxz5Pb75wVZ NXw3ND/eLJ50sTLERafJhXhwusHBXuN+/U7yzcxX9raoESeY9z9h+fyYXJlOhGJe4rmU dTe+vYE9MU7iz8UZhUb85WAGpxkj8SSpTni3Nd9fAl8zynVgGnSqg5j+111t8/lxsgX8 s0Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=D8oMSAYz+at1dMKRyUUy99Yth7ozjnOoOIGrIX1gjV8=; b=m8h6r/IXmmKrKqKgcyimQ46dspyoy6n6VC4agpjE/zTo/S85aOAd2xsjLVCpEl0FNt yyJrogWSPcpWg+JUAHxTlzQ1sZSM4myuPmslmNrlxJwsdOtiuxCIawuy3PRnOxMvRNwu ghXNotKAFixcK9I+Ld8qvZW27HERiip/D2v8W9vMylLCTHH4OzgbKHGJqOKquPD6GYfI yTA/IHoN7bH7cosrzDp4hIzxs12w3w1QxnMQtF3zgsRoajX358jId3Rw34rvJ65gP6XL ejzaDEg+vnLVQz7oZsbhXUIz64l+u1uVDD8qYNc1SBtRIMveXLB+BwQQqyOTb+rjfnsy PCTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b26si15018966pgl.539.2019.02.13.01.07.53; Wed, 13 Feb 2019 01:08:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732568AbfBMD0C (ORCPT + 99 others); Tue, 12 Feb 2019 22:26:02 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:3194 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727346AbfBMD0B (ORCPT ); Tue, 12 Feb 2019 22:26:01 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 0739BD5FABF699796367; Wed, 13 Feb 2019 11:26:00 +0800 (CST) Received: from [127.0.0.1] (10.134.22.195) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.408.0; Wed, 13 Feb 2019 11:25:55 +0800 Subject: Re: [f2fs-dev] [PATCH 2/7] f2fs: add quick mode of checkpoint=disable for QA To: Jaegeuk Kim , Chao Yu CC: , References: <20190128234717.77225-1-jaegeuk@kernel.org> <20190128234717.77225-2-jaegeuk@kernel.org> <2221688e-4dfc-71d5-81c6-3cf12d18e64a@kernel.org> <20190204165559.GA15646@jaegeuk-macbookpro.roam.corp.google.com> From: Chao Yu Message-ID: <10954e88-9ad1-7eb3-6bde-2004c6384e19@huawei.com> Date: Wed, 13 Feb 2019 11:26:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190204165559.GA15646@jaegeuk-macbookpro.roam.corp.google.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/2/5 0:55, Jaegeuk Kim wrote: > On 02/01, Chao Yu wrote: >> On 2019-1-29 7:47, Jaegeuk Kim wrote: >>> This mode returns mount() quickly with EAGAIN. We can trigger this by >>> shutdown(F2FS_GOING_DOWN_NEED_FSCK). >> >> Is the purpose of this patch making mount failed more quickly due to giving less >> GC time in f2fs_disable_checkpoint(), so we can expect that the total test time >> can be reduce? > > Yup. Got you. :) Reviewed-by: Chao Yu Thanks, > >> >> Thanks, >> >>> >>> Signed-off-by: Jaegeuk Kim >>> --- >>> fs/f2fs/checkpoint.c | 5 +++++ >>> fs/f2fs/f2fs.h | 2 ++ >>> fs/f2fs/file.c | 6 +++--- >>> fs/f2fs/segment.c | 3 +++ >>> fs/f2fs/super.c | 5 +++++ >>> include/linux/f2fs_fs.h | 1 + >>> 6 files changed, 19 insertions(+), 3 deletions(-) >>> >>> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c >>> index f955cd3e0677..622dca707752 100644 >>> --- a/fs/f2fs/checkpoint.c >>> +++ b/fs/f2fs/checkpoint.c >>> @@ -1259,6 +1259,11 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) >>> else >>> __clear_ckpt_flags(ckpt, CP_DISABLED_FLAG); >>> >>> + if (is_sbi_flag_set(sbi, SBI_CP_DISABLED_QUICK)) >>> + __set_ckpt_flags(ckpt, CP_DISABLED_QUICK_FLAG); >>> + else >>> + __clear_ckpt_flags(ckpt, CP_DISABLED_QUICK_FLAG); >>> + >>> if (is_sbi_flag_set(sbi, SBI_QUOTA_SKIP_FLUSH)) >>> __set_ckpt_flags(ckpt, CP_QUOTA_NEED_FSCK_FLAG); >>> else >>> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h >>> index 6b6ec5600089..fe95abb05d40 100644 >>> --- a/fs/f2fs/f2fs.h >>> +++ b/fs/f2fs/f2fs.h >>> @@ -191,6 +191,7 @@ enum { >>> #define DEF_CP_INTERVAL 60 /* 60 secs */ >>> #define DEF_IDLE_INTERVAL 5 /* 5 secs */ >>> #define DEF_DISABLE_INTERVAL 5 /* 5 secs */ >>> +#define DEF_DISABLE_QUICK_INTERVAL 1 /* 1 secs */ >>> #define DEF_UMOUNT_DISCARD_TIMEOUT 5 /* 5 secs */ >>> >>> struct cp_control { >>> @@ -1101,6 +1102,7 @@ enum { >>> SBI_IS_SHUTDOWN, /* shutdown by ioctl */ >>> SBI_IS_RECOVERED, /* recovered orphan/data */ >>> SBI_CP_DISABLED, /* CP was disabled last mount */ >>> + SBI_CP_DISABLED_QUICK, /* CP was disabled quickly */ >>> SBI_QUOTA_NEED_FLUSH, /* need to flush quota info in CP */ >>> SBI_QUOTA_SKIP_FLUSH, /* skip flushing quota in current CP */ >>> SBI_QUOTA_NEED_REPAIR, /* quota file may be corrupted */ >>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c >>> index 0d461321edfc..fe6f92fbba38 100644 >>> --- a/fs/f2fs/file.c >>> +++ b/fs/f2fs/file.c >>> @@ -1972,11 +1972,11 @@ static int f2fs_ioc_shutdown(struct file *filp, unsigned long arg) >>> break; >>> case F2FS_GOING_DOWN_NEED_FSCK: >>> set_sbi_flag(sbi, SBI_NEED_FSCK); >>> + set_sbi_flag(sbi, SBI_CP_DISABLED_QUICK); >>> + set_sbi_flag(sbi, SBI_IS_DIRTY); >>> /* do checkpoint only */ >>> ret = f2fs_sync_fs(sb, 1); >>> - if (ret) >>> - goto out; >>> - break; >>> + goto out; >>> default: >>> ret = -EINVAL; >>> goto out; >>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c >>> index 5b2b9be6f28d..342b720fb4db 100644 >>> --- a/fs/f2fs/segment.c >>> +++ b/fs/f2fs/segment.c >>> @@ -868,6 +868,9 @@ int f2fs_disable_cp_again(struct f2fs_sb_info *sbi) >>> >>> if (holes[DATA] > ovp || holes[NODE] > ovp) >>> return -EAGAIN; >>> + if (is_sbi_flag_set(sbi, SBI_CP_DISABLED_QUICK) && >>> + dirty_segments(sbi) > overprovision_segments(sbi)) >>> + return -EAGAIN; >>> return 0; >>> } >>> >>> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c >>> index 24efd76ca151..5e1f8573a17f 100644 >>> --- a/fs/f2fs/super.c >>> +++ b/fs/f2fs/super.c >>> @@ -3205,6 +3205,10 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) >>> >>> if (__is_set_ckpt_flags(F2FS_CKPT(sbi), CP_QUOTA_NEED_FSCK_FLAG)) >>> set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR); >>> + if (__is_set_ckpt_flags(F2FS_CKPT(sbi), CP_DISABLED_QUICK_FLAG)) { >>> + set_sbi_flag(sbi, SBI_CP_DISABLED_QUICK); >>> + sbi->interval_time[DISABLE_TIME] = DEF_DISABLE_QUICK_INTERVAL; >>> + } >>> >>> /* Initialize device list */ >>> err = f2fs_scan_devices(sbi); >>> @@ -3392,6 +3396,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) >>> cur_cp_version(F2FS_CKPT(sbi))); >>> f2fs_update_time(sbi, CP_TIME); >>> f2fs_update_time(sbi, REQ_TIME); >>> + clear_sbi_flag(sbi, SBI_CP_DISABLED_QUICK); >>> return 0; >>> >>> free_meta: >>> diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h >>> index d7711048ef93..d6befe1f9dc7 100644 >>> --- a/include/linux/f2fs_fs.h >>> +++ b/include/linux/f2fs_fs.h >>> @@ -116,6 +116,7 @@ struct f2fs_super_block { >>> /* >>> * For checkpoint >>> */ >>> +#define CP_DISABLED_QUICK_FLAG 0x00002000 >>> #define CP_DISABLED_FLAG 0x00001000 >>> #define CP_QUOTA_NEED_FSCK_FLAG 0x00000800 >>> #define CP_LARGE_NAT_BITMAP_FLAG 0x00000400 >>> > > > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel > > . >