Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6102321yba; Tue, 14 May 2019 01:32:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYtlxNChR4Mi+StwQ4w+y0DuHYQB9MX7+4cYaOXM20EvHyItK4oEQabyIqFs+SrfZJsB6W X-Received: by 2002:a17:902:28c9:: with SMTP id f67mr17278960plb.190.1557822748389; Tue, 14 May 2019 01:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557822748; cv=none; d=google.com; s=arc-20160816; b=jkkDjAD3xlGlwIgQ9r5sKvYPiD4pFINSs5xJGcHNuATxYDtdG/WtCowXDreM4PMHM+ lgxPXDL64z+RbJqOrWM8Ybmwxl2M2YVg1kV9ckGv8WlSr3Hwsxv3gYxnkQmyEZnoxd0j Pa0fwh6kh6gFDz+gt8Y+h9AQK91b4q/Sy0ZGMlGU485Ams/EfRaTslY/+mE84EfR8kpl C5GxUullrIaDgvAqZNMuSRjVSNDVpBpyOoSmobXvhvpj9YH4BxTp6X4ocalK16EpmlJl B2CcLL83B2XMOUlAqypqO6LOnld5ACMZPXH/LTqOrGC7nuMCB4C5blVzS2/ycFTw4BzR Uabg== 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=4LrLvz1Z9J0C4WoXLTfiJ0w5Pet2zJRsNNaLL3ujWrE=; b=zdUuNAyAv9so9BjpLTJlrWmjq1lfHEMRa0/41Os7XAcIT7KXw2fIrFbepoKk75+ZSg D58Q4ddL41fDKcZNo8+eece3teRJAEisCrcZG0hfcOyRKP8/gOfPSYmyRzWsbQI/YGez sMb+4SwSxRlPgUENXyj5WK7IaNVmAor4aRyJV/fm/KMCPPVHdIRQkLclNa/PTq5vpVwO KIvAXbCgCAbcDNXKIvGpc8oW8GknnJ/ImmFJiC9UwqqtdXI5xpq2CLMLKKr6Yinb8nn5 hKFVpwIz/a1BcgngRhreuyW8bumCoZl5JlPjAarwCg5dDyOPcVWg8k2YLQiIS7JGylKy C1Rw== 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 q86si19969146pfi.197.2019.05.14.01.32.13; Tue, 14 May 2019 01:32:28 -0700 (PDT) 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 S1726487AbfENI34 (ORCPT + 99 others); Tue, 14 May 2019 04:29:56 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:3009 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726109AbfENI34 (ORCPT ); Tue, 14 May 2019 04:29:56 -0400 Received: from DGGEMM402-HUB.china.huawei.com (unknown [172.30.72.55]) by Forcepoint Email with ESMTP id 2A642CAC562BAF98E832; Tue, 14 May 2019 16:29:54 +0800 (CST) Received: from dggeme763-chm.china.huawei.com (10.3.19.109) by DGGEMM402-HUB.china.huawei.com (10.3.20.210) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 14 May 2019 16:29:53 +0800 Received: from [10.134.22.195] (10.134.22.195) by dggeme763-chm.china.huawei.com (10.3.19.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Tue, 14 May 2019 16:29:53 +0800 Subject: Re: [f2fs-dev] [PATCH] f2fs: issue discard commands proactively in high fs utilization To: Ju Hyung Park , Jaegeuk Kim , Chao Yu CC: , References: <20180529205048.39694-1-jaegeuk@kernel.org> From: Chao Yu Message-ID: <73fc6da8-7b89-3b02-8856-bd6876c50259@huawei.com> Date: Tue, 14 May 2019 16:29:32 +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: Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-ClientProxiedBy: dggeme711-chm.china.huawei.com (10.1.199.107) To dggeme763-chm.china.huawei.com (10.3.19.109) 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/5/14 13:39, Ju Hyung Park wrote: > On Wed, May 30, 2018 at 5:51 AM Jaegeuk Kim wrote: >> >> In the high utilization like over 80%, we don't expect huge # of large discard >> commands, but do many small pending discards which affects FTL GCs a lot. >> Let's issue them in that case. >> >> Signed-off-by: Jaegeuk Kim >> --- >> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c >> index 6e40e536dae0..8c1f7a6bf178 100644 >> --- a/fs/f2fs/segment.c >> +++ b/fs/f2fs/segment.c >> @@ -915,6 +915,38 @@ static void __check_sit_bitmap(struct f2fs_sb_info *sbi, >> + dpolicy->max_interval = DEF_MIN_DISCARD_ISSUE_TIME; > > Isn't this way too aggressive? > > Discard thread will wake up on 50ms interval just because the user has > used 80% of space. > 60,000ms vs 50ms is too much of a stark difference. > > I feel something like 10 seconds(10,000ms) could be a much more > reasonable choice than this. Hmm.. I agree that current hard code method is not flexible enough, and I proposed below patch last year to adjust interval according to space usage, it looks Jaegeuk partially agreed with that, and pointed out we need to distinguish low/high-end storage to decide interval. And also you point out that btrfs introduces mount option "ssd" to let user give the device type, and we can distinguish with that. :P https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/commit/?h=f2fs-dev&id=009f548e37ca5d9b4cad9e3c15c2164c53eff1df But I pended below patch based on Jaegeuk's and your idea due to other work... https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/commit/?h=f2fs-dev&id=47a992c12398c98e739e3eedc2743824459df943 Thanks, > > Thanks. > > > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel > . >