Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp312190imm; Thu, 12 Jul 2018 20:18:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdY3UfzCvy8p11NtCVXiSfJ/jmB/VKPC9XGV7w4RlpErNdn66/LYVz8Kcdf5uyY5Z4lEeJH X-Received: by 2002:a63:8548:: with SMTP id u69-v6mr4419947pgd.346.1531451936269; Thu, 12 Jul 2018 20:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531451936; cv=none; d=google.com; s=arc-20160816; b=r+6GETewtpz/lO3O83hzfjdBUwsc0dYUxF5sv7LRaRz8nsyzKWoqQpycfyhW7JcXY8 1UcSkr+PGNmyAt2qaRe0nRvpLGpZQmiK+xaELK6BBumpokKj9D6fb/gtAPOpZVT90waS xWhZXOrMZ6RKik54Ui/ptxlYoiJtASMngj50z1hrGq2SfjG0kK14S7iLoPb1yWQoNMWv DgJxmfa4Zqpy5iE8XWpCuZxsjvSYWtk+lc8IROpz/OZ+ixuIJOsdE8iExQbzhhYN6qLy /vGr1Ml49qZMEtzHOOVQMZAC2dXk/7flVaRwwWoJqCh4DxR9kfHfTgL4XecyCm5jWywI 8amg== 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:arc-authentication-results; bh=+EZqiEETC8W8xBAIH6z/B1mStWKWu5v5hsIO7IYdveY=; b=lvcINSmZTGVElGO4NKs5iF7QJMZ4bO8um2G89K/x/KnuKv2AM2v3JcVQ5dCWMeEIRS jKNZVjAGXH0TJWScC8duWZk4MUtEzOI0+aY7fT0KuLHK5emEzX832uGMl3XmgPGUS5f7 lFC8uOTDVqPplhgr4QSTRcnFsRfjQFGxminy7RyUp0eZCWoqirrY9wHSGvMM4/a5D7/A xFSp7ZNAXOOPMOXXxEbq+ldk3orD5kXqPFIo4UElsy4IcD2+gOiEUTj8c3+zQNE8Cudo lMe6nz0q5wOo/8bl9tUJhfDED0m41H3QwjWZ5of+7JptCAQjYNiIb0OrkSd/TMa65Ur3 KIhw== 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 60-v6si23156371ple.65.2018.07.12.20.18.41; Thu, 12 Jul 2018 20:18:56 -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 S2387888AbeGMDal (ORCPT + 99 others); Thu, 12 Jul 2018 23:30:41 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9617 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387801AbeGMDal (ORCPT ); Thu, 12 Jul 2018 23:30:41 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 7C6E1C7783B68; Fri, 13 Jul 2018 11:17:53 +0800 (CST) Received: from [127.0.0.1] (10.134.22.195) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.382.0; Fri, 13 Jul 2018 11:17:48 +0800 Subject: Re: [PATCH 4/5] f2fs: disable small discard in lfs mode To: Yunlong Song , , , CC: , , , , , References: <1531408170-45758-1-git-send-email-yunlong.song@huawei.com> <1531408170-45758-5-git-send-email-yunlong.song@huawei.com> From: Chao Yu Message-ID: Date: Fri, 13 Jul 2018 11:17:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1531408170-45758-5-git-send-email-yunlong.song@huawei.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 2018/7/12 23:09, Yunlong Song wrote: > In lfs mode, it is better to send the discard of the overall section > each time to avoid missing alignment with flash. Hmm.. I think LFS mode can be used widely on different kind of device instead of just on zoned block device, so let's just keep old implementation here. Thanks, > > Signed-off-by: Yunlong Song > --- > fs/f2fs/segment.c | 3 ++- > fs/f2fs/sysfs.c | 4 ++++ > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > index fd38b61..f6c20e0 100644 > --- a/fs/f2fs/segment.c > +++ b/fs/f2fs/segment.c > @@ -1766,7 +1766,8 @@ static int create_discard_cmd_control(struct f2fs_sb_info *sbi) > atomic_set(&dcc->issing_discard, 0); > atomic_set(&dcc->discard_cmd_cnt, 0); > dcc->nr_discards = 0; > - dcc->max_discards = MAIN_SEGS(sbi) << sbi->log_blocks_per_seg; > + dcc->max_discards = test_opt(sbi, LFS) ? 0 : > + MAIN_SEGS(sbi) << sbi->log_blocks_per_seg; > dcc->undiscard_blks = 0; > dcc->root = RB_ROOT; > dcc->rbtree_check = false; > diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c > index 2e7e611..4b6c457 100644 > --- a/fs/f2fs/sysfs.c > +++ b/fs/f2fs/sysfs.c > @@ -271,6 +271,10 @@ static ssize_t __sbi_store(struct f2fs_attr *a, > return count; > } > > + if (!strcmp(a->attr.name, "max_small_discards") && > + test_opt(sbi, LFS)) > + return -EINVAL; > + > *ui = t; > > if (!strcmp(a->attr.name, "iostat_enable") && *ui == 0) >