Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp231778pxb; Wed, 4 Nov 2020 20:59:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwgGs/TcO140WxqofpArvqDxIHllargv2oj4priw+QYO5pPkqs4k0AkCp+HG5Gyl4NGDuXf X-Received: by 2002:a17:907:42cf:: with SMTP id nz23mr591972ejb.138.1604552387592; Wed, 04 Nov 2020 20:59:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604552387; cv=none; d=google.com; s=arc-20160816; b=n8Zvggo5wYNQx+1eo2hHB5L+mtLTZLW0VEUwnwcaZRelk1uXJWkTM7s5FaCpkN0XK8 SRPBMM6ZDDyyKDC1M21y3hHlk8cF4fA6/qWiOQU33XVoSmQukXd8ltaLbGZaNdIcvi3D AzDtCQL55iH7WL4Pl+Gfh15LV6CHxhFo5/Ej1+MaLjVa+vi09gkoOAR02MBzGmlJlLJ8 XfGmfefDZ/yTaZ3U6jrH+9Mgtc43ZeKl7lemoNZGkkjDWLKU3VxVy90ANIHJaY/xPTn2 zU46CwkDrST6lux97hyjUKKX7Q2yCk9rKd/jTJ47xIsA2yF01B/lSuf4jgTDZaQPK74G 0CSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=RO0x8HnerRhOX8IvLzZSZc0SZWuef+U8mnTfuKmi4Vo=; b=pXpQ+6VXEPBDoY70h6jkogEWll3jINxz6k5pBB2s7qMIb+cQiZabW7n0oOsBf7dFcA tUTohxJxu1KbRztqpREzjheq9WBa4jvHTR9RO/xakJmMuRo+95hQNxHWGQ6dW6Jqj+0t xy3zbgLHO8hi6OcMwdpVvuXBe91HQRwYeqUUY0ME2t7GWqCpWYF9/hmL+KxxEOCC490N 9Lh01gFfr5DfzNBIP43qJL8339Yrkb57dIZ4Y8/LEZIqaGC8tJXADyUbF05VsF+nF0M4 Oil39UTNF5oyeKbI6ilCtAEaLagJfEUgD/PWhSglGwlpxgkPEQYNmdtH4v0y49NqfBIu RjgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k6si367838edr.114.2020.11.04.20.59.25; Wed, 04 Nov 2020 20:59:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732786AbgKEDQC (ORCPT + 99 others); Wed, 4 Nov 2020 22:16:02 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:7459 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731990AbgKEDQC (ORCPT ); Wed, 4 Nov 2020 22:16:02 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4CRTDs4F93zhclL; Thu, 5 Nov 2020 11:15:57 +0800 (CST) Received: from [10.136.114.67] (10.136.114.67) by smtp.huawei.com (10.3.19.212) with Microsoft SMTP Server (TLS) id 14.3.487.0; Thu, 5 Nov 2020 11:15:54 +0800 Subject: Re: [PATCH v2] f2fs: change write_hint for hot/warm nodes To: Jaegeuk Kim , Daejun Park CC: "chao@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-f2fs-devel@lists.sourceforge.net" , yongmyung lee , Jieon Seol , Sang-yoon Oh , Mankyu PARK , Sung-Jun Park , Keoseong Park , SEUNGUK SHIN , Jinyoung CHOI , Jaemyung Lee References: <20201103083832epcms2p6c8b0e4470f1392772317ab2b25256b3d@epcms2p6> <20201103185808.GB1273166@google.com> From: Chao Yu Message-ID: <4be2e157-fbc1-6e2c-cdd7-a32514884754@huawei.com> Date: Thu, 5 Nov 2020 11:15:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20201103185808.GB1273166@google.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.136.114.67] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/11/4 2:58, Jaegeuk Kim wrote: > On 11/03, Daejun Park wrote: >> In the fs-based mode of F2FS, the mapping of hot/warm node to >> WRITE_LIFE_NOT_SET should be changed to WRITE_LIFE_SHORT. >> >> As a result of analyzing the write pattern of f2fs using real workload, >> hot/warm nodes have high update ratio close to hot data.[*] >> However, F2FS passes write hints for hot/warm nodes as WRITE_LIFE_NOT_SET. > > I prefer to keep it as is, since basically node blocks should be separatly > stored from data blocks in different erase blocks in order to match F2FS GC Correct, I missed that the change will break HOT_DATA type and {HOT,WARM}_NODE type data separation in FTL. > and FTL GC units. And, we don't do IPU for node blocks which doesn't make sense > to say *update ratio*. IMO, if fs discard is fast enough, both IPU and OPU will cause original blkaddr in FTL being invalid, we can compare update ratio on {I,O}PU IOs inside FTL; otherwise, we can't. Thanks, > >> >> Furthermore, WRITE_LIFE_NOT_SET is a default value of write hint when it is >> not provided from the file system. >> In storage, write_hint is used to distinguish streams (e.g. NVMe). >> So, the hot/warm node of F2FS is not distinguished from other write_hints, >> which can make the wrong stream seperation. >> >> * Liang, Yu, et al. "An empirical study of F2FS on mobile devices." 2017 >> IEEE 23rd International Conference on Embedded and Real-Time Computing >> Systems and Applications (RTCSA). >> >> Signed-off-by: Daejun Park >> --- >> v2: update documentation and comments >> --- >> Documentation/filesystems/f2fs.rst | 4 ++-- >> fs/f2fs/segment.c | 6 +++--- >> 2 files changed, 5 insertions(+), 5 deletions(-) >> >> diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst >> index b8ee761c9922..afa3da7cfade 100644 >> --- a/Documentation/filesystems/f2fs.rst >> +++ b/Documentation/filesystems/f2fs.rst >> @@ -717,8 +717,8 @@ WRITE_LIFE_LONG " WRITE_LIFE_LONG >> ===================== ======================== =================== >> User F2FS Block >> ===================== ======================== =================== >> - META WRITE_LIFE_MEDIUM; >> - HOT_NODE WRITE_LIFE_NOT_SET >> + META WRITE_LIFE_MEDIUM >> + HOT_NODE WRITE_LIFE_SHORT >> WARM_NODE " >> COLD_NODE WRITE_LIFE_NONE >> ioctl(COLD) COLD_DATA WRITE_LIFE_EXTREME >> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c >> index 1596502f7375..577ab7516c6b 100644 >> --- a/fs/f2fs/segment.c >> +++ b/fs/f2fs/segment.c >> @@ -3160,8 +3160,8 @@ int f2fs_rw_hint_to_seg_type(enum rw_hint hint) >> * >> * User F2FS Block >> * ---- ---- ----- >> - * META WRITE_LIFE_MEDIUM; >> - * HOT_NODE WRITE_LIFE_NOT_SET >> + * META WRITE_LIFE_MEDIUM >> + * HOT_NODE WRITE_LIFE_SHORT >> * WARM_NODE " >> * COLD_NODE WRITE_LIFE_NONE >> * ioctl(COLD) COLD_DATA WRITE_LIFE_EXTREME >> @@ -3208,7 +3208,7 @@ enum rw_hint f2fs_io_type_to_rw_hint(struct f2fs_sb_info *sbi, >> return WRITE_LIFE_EXTREME; >> } else if (type == NODE) { >> if (temp == WARM || temp == HOT) >> - return WRITE_LIFE_NOT_SET; >> + return WRITE_LIFE_SHORT; >> else if (temp == COLD) >> return WRITE_LIFE_NONE; >> } else if (type == META) { >> -- >> 2.25.1 > . >