From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01C69C433B4 for ; Tue, 11 May 2021 06:42:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2F90610FA for ; Tue, 11 May 2021 06:42:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230400AbhEKGnK (ORCPT ); Tue, 11 May 2021 02:43:10 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:43795 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbhEKGnH (ORCPT ); Tue, 11 May 2021 02:43:07 -0400 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20210511064159epoutp028e7ada2987e8145e47aac81d97695ada~97-7z6_t32013020130epoutp02j for ; Tue, 11 May 2021 06:41:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20210511064159epoutp028e7ada2987e8145e47aac81d97695ada~97-7z6_t32013020130epoutp02j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1620715319; bh=R5Mr8semJgMYJDEcFx4DnQVikV0IeL0CBLCY3OJUJJw=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=UI9H//h7oyIO3jeD+XYLdYQ5DLz02atXS6DF9xBxJNA7F2CrA142AiCKDUDNlmS7z R6i0BFzimMWLW36wAlcQ2ET5xRSu2+S0u8bfQ360t2oamjVyrBK7cOAXmjRQ5Q/JXA itSVoeu8TKQAGSvr8j37Ri9C/LX+jUbdXM9/rn8s= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20210511064158epcas2p40c24e3b85f9db3d14ab90afe607816c6~97-7fgdJq0495604956epcas2p4f; Tue, 11 May 2021 06:41:58 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.40.183]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4FfSyF50TBz4x9QF; Tue, 11 May 2021 06:41:57 +0000 (GMT) X-AuditID: b6c32a47-f4bff700000024d9-6e-609a2734c59a Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 4B.B2.09433.4372A906; Tue, 11 May 2021 15:41:56 +0900 (KST) Mime-Version: 1.0 Subject: RE: Re: [PATCH] f2fs: set file as cold when file defragmentation Reply-To: daejun7.park@samsung.com Sender: Daejun Park From: Daejun Park To: Chao Yu , Jaegeuk Kim , Daejun Park CC: "chao@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-f2fs-devel@lists.sourceforge.net" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20210511064156epcms2p1351480bea36733f2e00022bd295e829e@epcms2p1> Date: Tue, 11 May 2021 15:41:56 +0900 X-CMS-MailID: 20210511064156epcms2p1351480bea36733f2e00022bd295e829e Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y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g+TJq0t7vZ+dPDbmmnLNP6XrPmjNMX0 w5PSxs85FbJheidOflaaIbfjcQSDhADzgS133Xt594rcPf1XYrOo3enfc7blbAnbGZEQ+j+u zy2gZ6qebubDMoEJ7/sVtO+lz2fVlFY1K1Z6e/faik7ZzL6XhlLefmezdfmqqzqWCgsqsRRn JBpqMRcVJwIAhnPsuhcEAAA= DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210429062005epcms2p352ef77f96ab66cbffe0c0ab6c1b62d8a References: <20210429062005epcms2p352ef77f96ab66cbffe0c0ab6c1b62d8a@epcms2p3> <3a0ab201-9546-d523-abc7-79df5f637f14@huawei.com> <6e95edca-4802-7650-4771-5389067935dc@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >On 2021/5/11 13:09, Jaegeuk Kim wrote: >> On 05/11, Chao Yu wrote: >>> On 2021/5/10 22:47, Jaegeuk Kim wrote: >>>> On 05/06, Chao Yu wrote: >>>>> On 2021/5/6 12:46, Jaegeuk Kim wrote: >>>>>> On 05/06, Chao Yu wrote: >>>>>>> On 2021/4/29 14:20, Daejun Park wrote: >>>>>>>> In file defragmentation by ioctl, all data blocks in the file are >>>>>>>> re-written out-of-place. File defragmentation implies user will not update >>>>>>>> and mostly read the file. So before the defragmentation, we set file >>>>>>>> temperature as cold for better block allocation. >>>>>>> >>>>>>> I don't think all fragmented files are cold, e.g. db file. >>>>>> >>>>>> I have a bit different opinion. I think one example would be users want to >>>>>> defragment a file, when the they want to get higher read bandwidth for >>>>> >>>>> Multimedia file was already defined as cold file now via default extension >>>>> list? >>>> >>>> I just gave an example. And default is default. >>>> >>>>> >>>>>> usually multimedia files. That's likely to be cold files. Moreover, I don't >>>>>> think they want to defragment db files which will be fragmented soon? >>>>> >>>>> I guess like db files have less update but more access? >>>> >>>> I think both, and we set it as hot. >>> >>> Then hot and cold bit will set to the same db file after defragmentation? >> >> Do you set cold bit to db files? I mean, generally db is not cold, but hot. > >I never set cold bit to db files, I mean if we defragment db file which >has less update and more access, db file may have bot hot and cold bit. > >To Daejun, may I ask that is Samsung planning to use this defragment ioctl >in products? what's the user scenario? It is just my idea for defragmentation, not Samsung. I think the user will call the defrag ioctl for the files that have been updated. On the other hand, I think FS should be able to support defrag file even when in-place update is applied. What do you think? Thanks, Daejun > >Thanks, > >> >>> >>> Thanks, >>> >>>> >>>>> >>>>> Thanks, >>>>> >>>>>> >>>>>>> >>>>>>> We have separated interface (via f2fs_xattr_advise_handler, e.g. setfattr -n >>>>>>> "system.advise" -v value) to indicate this file is a hot/cold file, so my >>>>>>> suggestion is after file defragmentation, if you think this file is cold, and >>>>>>> use setxattr() to set it as cold. >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>>> >>>>>>>> Signed-off-by: Daejun Park >>>>>>>> --- >>>>>>>> fs/f2fs/file.c | 3 +++ >>>>>>>> 1 file changed, 3 insertions(+) >>>>>>>> >>>>>>>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c >>>>>>>> index d697c8900fa7..dcac965a05fe 100644 >>>>>>>> --- a/fs/f2fs/file.c >>>>>>>> +++ b/fs/f2fs/file.c >>>>>>>> @@ -2669,6 +2669,9 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi, >>>>>>>> map.m_len = pg_end - pg_start; >>>>>>>> total = 0; >>>>>>>> + if (!file_is_cold(inode)) >>>>>>>> + file_set_cold(inode); >>>>>>>> + >>>>>>>> while (map.m_lblk < pg_end) { >>>>>>>> pgoff_t idx; >>>>>>>> int cnt = 0; >>>>>>>> >>>>>> . >>>>>> >>>> . >>>> >> . >> > > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5885C433ED for ; Tue, 11 May 2021 06:42:18 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6DCCB610FA for ; Tue, 11 May 2021 06:42:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6DCCB610FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.92.3) (envelope-from ) id 1lgM5w-0004F6-97; Tue, 11 May 2021 06:42:16 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lgM5u-0004Ez-H0 for linux-f2fs-devel@lists.sourceforge.net; Tue, 11 May 2021 06:42:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:Content-Type:Content-Transfer-Encoding: Date:Message-ID:In-Reply-To:CC:To:From:Sender:Reply-To:Subject:Mime-Version: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=R5Mr8semJgMYJDEcFx4DnQVikV0IeL0CBLCY3OJUJJw=; b=Ha1yahsFlWyoKPrG4YBNeps9XJ lRhwFYEGBBc3O1m9JMPZ6ylSi4ZgszYjxQN8uWe8HQBbXuKkhSkg2Z00ltIKxSd9RdO5clvGAmn7B u3WcAmPKWijGx5HSyR2TYVi1Y1jFA4ms8FEnokoNTUfAYTuJRcfSDMY+AEcMKQ2eCSog=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:Content-Type:Content-Transfer-Encoding:Date:Message-ID: In-Reply-To:CC:To:From:Sender:Reply-To:Subject:Mime-Version:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=R5Mr8semJgMYJDEcFx4DnQVikV0IeL0CBLCY3OJUJJw=; b=c/Y07hol7K5nsMTGAvlBpkAo5Q QLcfshOH/6AUlFPXvbRFekjtb6gi5wt+I5gaE3EytQ1buhpUDhsSRoXbw+Nw7+BaFMb88v7COpDcu Gx4OemyqsRoeDtUviiYaUSC9bfXPqYpnN/Loh9VvYWSUYeG8aMUpMigmWO20IVHNZY9M=; Received: from mailout2.samsung.com ([203.254.224.25]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lgM5p-0000Dy-Hd for linux-f2fs-devel@lists.sourceforge.net; Tue, 11 May 2021 06:42:14 +0000 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20210511064159epoutp022cfb32ccba2cc8ac958a00fe852f0604~97-7z9nSk2148021480epoutp02y for ; Tue, 11 May 2021 06:41:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20210511064159epoutp022cfb32ccba2cc8ac958a00fe852f0604~97-7z9nSk2148021480epoutp02y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1620715319; bh=R5Mr8semJgMYJDEcFx4DnQVikV0IeL0CBLCY3OJUJJw=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=UI9H//h7oyIO3jeD+XYLdYQ5DLz02atXS6DF9xBxJNA7F2CrA142AiCKDUDNlmS7z R6i0BFzimMWLW36wAlcQ2ET5xRSu2+S0u8bfQ360t2oamjVyrBK7cOAXmjRQ5Q/JXA itSVoeu8TKQAGSvr8j37Ri9C/LX+jUbdXM9/rn8s= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20210511064158epcas2p40c24e3b85f9db3d14ab90afe607816c6~97-7fgdJq0495604956epcas2p4f; Tue, 11 May 2021 06:41:58 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.40.183]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4FfSyF50TBz4x9QF; Tue, 11 May 2021 06:41:57 +0000 (GMT) X-AuditID: b6c32a47-f4bff700000024d9-6e-609a2734c59a Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 4B.B2.09433.4372A906; Tue, 11 May 2021 15:41:56 +0900 (KST) Mime-Version: 1.0 From: Daejun Park To: Chao Yu , Jaegeuk Kim , Daejun Park X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20210511064156epcms2p1351480bea36733f2e00022bd295e829e@epcms2p1> Date: Tue, 11 May 2021 15:41:56 +0900 X-CMS-MailID: 20210511064156epcms2p1351480bea36733f2e00022bd295e829e X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAA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Sxs85FbJheidOflaaIbfjcQSDhADzgS133Xt594rcPf1XYrOo3enfc7blbAnbGZEQ+j+u zy2gZ6qebubDMoEJ7/sVtO+lz2fVlFY1K1Z6e/faik7ZzL6XhlLefmezdfmqqzqWCgsqsRRn JBpqMRcVJwIAhnPsuhcEAAA= DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210429062005epcms2p352ef77f96ab66cbffe0c0ab6c1b62d8a References: <20210429062005epcms2p352ef77f96ab66cbffe0c0ab6c1b62d8a@epcms2p3> <3a0ab201-9546-d523-abc7-79df5f637f14@huawei.com> <6e95edca-4802-7650-4771-5389067935dc@huawei.com> X-Headers-End: 1lgM5p-0000Dy-Hd Subject: Re: [f2fs-dev] [PATCH] f2fs: set file as cold when file defragmentation X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: daejun7.park@samsung.com Cc: "linux-kernel@vger.kernel.org" , "linux-f2fs-devel@lists.sourceforge.net" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net >On 2021/5/11 13:09, Jaegeuk Kim wrote: >> On 05/11, Chao Yu wrote: >>> On 2021/5/10 22:47, Jaegeuk Kim wrote: >>>> On 05/06, Chao Yu wrote: >>>>> On 2021/5/6 12:46, Jaegeuk Kim wrote: >>>>>> On 05/06, Chao Yu wrote: >>>>>>> On 2021/4/29 14:20, Daejun Park wrote: >>>>>>>> In file defragmentation by ioctl, all data blocks in the file are >>>>>>>> re-written out-of-place. File defragmentation implies user will not update >>>>>>>> and mostly read the file. So before the defragmentation, we set file >>>>>>>> temperature as cold for better block allocation. >>>>>>> >>>>>>> I don't think all fragmented files are cold, e.g. db file. >>>>>> >>>>>> I have a bit different opinion. I think one example would be users want to >>>>>> defragment a file, when the they want to get higher read bandwidth for >>>>> >>>>> Multimedia file was already defined as cold file now via default extension >>>>> list? >>>> >>>> I just gave an example. And default is default. >>>> >>>>> >>>>>> usually multimedia files. That's likely to be cold files. Moreover, I don't >>>>>> think they want to defragment db files which will be fragmented soon? >>>>> >>>>> I guess like db files have less update but more access? >>>> >>>> I think both, and we set it as hot. >>> >>> Then hot and cold bit will set to the same db file after defragmentation? >> >> Do you set cold bit to db files? I mean, generally db is not cold, but hot. > >I never set cold bit to db files, I mean if we defragment db file which >has less update and more access, db file may have bot hot and cold bit. > >To Daejun, may I ask that is Samsung planning to use this defragment ioctl >in products? what's the user scenario? It is just my idea for defragmentation, not Samsung. I think the user will call the defrag ioctl for the files that have been updated. On the other hand, I think FS should be able to support defrag file even when in-place update is applied. What do you think? Thanks, Daejun > >Thanks, > >> >>> >>> Thanks, >>> >>>> >>>>> >>>>> Thanks, >>>>> >>>>>> >>>>>>> >>>>>>> We have separated interface (via f2fs_xattr_advise_handler, e.g. setfattr -n >>>>>>> "system.advise" -v value) to indicate this file is a hot/cold file, so my >>>>>>> suggestion is after file defragmentation, if you think this file is cold, and >>>>>>> use setxattr() to set it as cold. >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>>> >>>>>>>> Signed-off-by: Daejun Park >>>>>>>> --- >>>>>>>> fs/f2fs/file.c | 3 +++ >>>>>>>> 1 file changed, 3 insertions(+) >>>>>>>> >>>>>>>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c >>>>>>>> index d697c8900fa7..dcac965a05fe 100644 >>>>>>>> --- a/fs/f2fs/file.c >>>>>>>> +++ b/fs/f2fs/file.c >>>>>>>> @@ -2669,6 +2669,9 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi, >>>>>>>> map.m_len = pg_end - pg_start; >>>>>>>> total = 0; >>>>>>>> + if (!file_is_cold(inode)) >>>>>>>> + file_set_cold(inode); >>>>>>>> + >>>>>>>> while (map.m_lblk < pg_end) { >>>>>>>> pgoff_t idx; >>>>>>>> int cnt = 0; >>>>>>>> >>>>>> . >>>>>> >>>> . >>>> >> . >> > > > _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel