From: Jaegeuk Kim <jaegeuk@kernel.org> To: Chao Yu <yuchao0@huawei.com> Cc: daejun7.park@samsung.com, "chao@kernel.org" <chao@kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux-f2fs-devel@lists.sourceforge.net" <linux-f2fs-devel@lists.sourceforge.net> Subject: Re: [PATCH] f2fs: set file as cold when file defragmentation Date: Mon, 10 May 2021 22:09:04 -0700 [thread overview] Message-ID: <YJoRcIpW1g/OgHZn@google.com> (raw) In-Reply-To: <6e95edca-4802-7650-4771-5389067935dc@huawei.com> 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. > > 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 <daejun7.park@samsung.com> > > > > > > --- > > > > > > 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; > > > > > > > > > > . > > > > > > . > >
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org> To: Chao Yu <yuchao0@huawei.com> Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux-f2fs-devel@lists.sourceforge.net" <linux-f2fs-devel@lists.sourceforge.net> Subject: Re: [f2fs-dev] [PATCH] f2fs: set file as cold when file defragmentation Date: Mon, 10 May 2021 22:09:04 -0700 [thread overview] Message-ID: <YJoRcIpW1g/OgHZn@google.com> (raw) In-Reply-To: <6e95edca-4802-7650-4771-5389067935dc@huawei.com> 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. > > 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 <daejun7.park@samsung.com> > > > > > > --- > > > > > > 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
next prev parent reply other threads:[~2021-05-11 5:09 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <CGME20210429062005epcms2p352ef77f96ab66cbffe0c0ab6c1b62d8a@epcms2p3> 2021-04-29 6:20 ` [PATCH] f2fs: set file as cold when file defragmentation Daejun Park 2021-04-29 6:20 ` [f2fs-dev] " Daejun Park 2021-05-06 2:09 ` Chao Yu 2021-05-06 2:09 ` [f2fs-dev] " Chao Yu 2021-05-06 4:46 ` Jaegeuk Kim 2021-05-06 4:46 ` [f2fs-dev] " Jaegeuk Kim 2021-05-06 6:36 ` Chao Yu 2021-05-06 6:36 ` [f2fs-dev] " Chao Yu 2021-05-10 14:47 ` Jaegeuk Kim 2021-05-10 14:47 ` [f2fs-dev] " Jaegeuk Kim 2021-05-11 1:30 ` Chao Yu 2021-05-11 1:30 ` [f2fs-dev] " Chao Yu 2021-05-11 5:09 ` Jaegeuk Kim [this message] 2021-05-11 5:09 ` Jaegeuk Kim 2021-05-11 6:07 ` Chao Yu 2021-05-11 6:07 ` [f2fs-dev] " Chao Yu [not found] ` <CGME20210429062005epcms2p352ef77f96ab66cbffe0c0ab6c1b62d8a@epcms2p1> 2021-05-11 6:41 ` Daejun Park 2021-05-11 6:41 ` [f2fs-dev] " Daejun Park 2021-05-11 7:23 ` Chao Yu 2021-05-11 7:23 ` [f2fs-dev] " Chao Yu 2021-05-11 21:47 ` Jaegeuk Kim 2021-05-11 21:47 ` [f2fs-dev] " Jaegeuk Kim [not found] ` <CGME20210429062005epcms2p352ef77f96ab66cbffe0c0ab6c1b62d8a@epcms2p6> 2021-05-12 8:45 ` Daejun Park 2021-05-12 8:45 ` [f2fs-dev] " Daejun Park
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=YJoRcIpW1g/OgHZn@google.com \ --to=jaegeuk@kernel.org \ --cc=chao@kernel.org \ --cc=daejun7.park@samsung.com \ --cc=linux-f2fs-devel@lists.sourceforge.net \ --cc=linux-kernel@vger.kernel.org \ --cc=yuchao0@huawei.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.