Re: [f2fs-dev] [PATCH] f2fs: set_code_data in move_data_block

2018-02-10 Thread Yunlong Song

OK, Got it.

On 2018/2/11 11:50, Chao Yu wrote:

On 2018/2/11 11:34, Yunlong Song wrote:

Ping...

move_data_block misses set_cold_data, then the F2FS_WB_CP_DATA will
lack these data pages in move_data_block, and write_checkpoint can
not make sure this pages committed to the flash.


Hmm.. data block migration is running based on meta inode, so it will
be safe since checkpoint will flush all meta pages including encrypted
pages cached in meta inode?

Thanks,



On 2018/2/8 20:33, Yunlong Song wrote:

Signed-off-by: Yunlong Song 
---
   fs/f2fs/gc.c | 1 +
   1 file changed, 1 insertion(+)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index b9d93fd..2095630 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -692,6 +692,7 @@ static void move_data_block(struct inode *inode, block_t 
bidx,
fio.op = REQ_OP_WRITE;
fio.op_flags = REQ_SYNC;
fio.new_blkaddr = newaddr;
+   set_cold_data(fio.page);
err = f2fs_submit_page_write(&fio);
if (err) {
if (PageWriteback(fio.encrypted_page))






.



--
Thanks,
Yunlong Song


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH] f2fs: set_code_data in move_data_block

2018-02-10 Thread heyunlei


>-Original Message-
>From: Songyunlong (Euler)
>Sent: Sunday, February 11, 2018 11:35 AM
>To: jaeg...@kernel.org; c...@kernel.org; Yuchao (T); yunlong.s...@icloud.com
>Cc: miaoxie (A); Wangbintian; shengyong (A); heyunlei; 
>linux-f2fs-devel@lists.sourceforge.net; linux-ker...@vger.kernel.org
>Subject: Re: [PATCH] f2fs: set_code_data in move_data_block
>
>Ping...
>
>move_data_block misses set_cold_data, then the F2FS_WB_CP_DATA will
>lack these data pages in move_data_block, and write_checkpoint can
>not make sure this pages committed to the flash.
>

Here, we write encrypted_page back, which belong to meta mapping.

Thanks.


>On 2018/2/8 20:33, Yunlong Song wrote:
>> Signed-off-by: Yunlong Song 
>> ---
>>   fs/f2fs/gc.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
>> index b9d93fd..2095630 100644
>> --- a/fs/f2fs/gc.c
>> +++ b/fs/f2fs/gc.c
>> @@ -692,6 +692,7 @@ static void move_data_block(struct inode *inode, block_t 
>> bidx,
>>  fio.op = REQ_OP_WRITE;
>>  fio.op_flags = REQ_SYNC;
>>  fio.new_blkaddr = newaddr;
>> +set_cold_data(fio.page);
>>  err = f2fs_submit_page_write(&fio);
>>  if (err) {
>>  if (PageWriteback(fio.encrypted_page))
>>
>
>--
>Thanks,
>Yunlong Song

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH] f2fs: set_code_data in move_data_block

2018-02-10 Thread Chao Yu
On 2018/2/11 11:34, Yunlong Song wrote:
> Ping...
> 
> move_data_block misses set_cold_data, then the F2FS_WB_CP_DATA will
> lack these data pages in move_data_block, and write_checkpoint can
> not make sure this pages committed to the flash.

Hmm.. data block migration is running based on meta inode, so it will
be safe since checkpoint will flush all meta pages including encrypted
pages cached in meta inode?

Thanks,

> 
> On 2018/2/8 20:33, Yunlong Song wrote:
>> Signed-off-by: Yunlong Song 
>> ---
>>   fs/f2fs/gc.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
>> index b9d93fd..2095630 100644
>> --- a/fs/f2fs/gc.c
>> +++ b/fs/f2fs/gc.c
>> @@ -692,6 +692,7 @@ static void move_data_block(struct inode *inode, block_t 
>> bidx,
>>  fio.op = REQ_OP_WRITE;
>>  fio.op_flags = REQ_SYNC;
>>  fio.new_blkaddr = newaddr;
>> +set_cold_data(fio.page);
>>  err = f2fs_submit_page_write(&fio);
>>  if (err) {
>>  if (PageWriteback(fio.encrypted_page))
>>
> 


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH] f2fs: set_code_data in move_data_block

2018-02-10 Thread Yunlong Song

Ping...

move_data_block misses set_cold_data, then the F2FS_WB_CP_DATA will
lack these data pages in move_data_block, and write_checkpoint can
not make sure this pages committed to the flash.

On 2018/2/8 20:33, Yunlong Song wrote:

Signed-off-by: Yunlong Song 
---
  fs/f2fs/gc.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index b9d93fd..2095630 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -692,6 +692,7 @@ static void move_data_block(struct inode *inode, block_t 
bidx,
fio.op = REQ_OP_WRITE;
fio.op_flags = REQ_SYNC;
fio.new_blkaddr = newaddr;
+   set_cold_data(fio.page);
err = f2fs_submit_page_write(&fio);
if (err) {
if (PageWriteback(fio.encrypted_page))



--
Thanks,
Yunlong Song


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] Cold log explanation

2018-02-10 Thread Chao Yu
On 2018/2/10 23:45, Piergiorgio Sartor wrote:
> Hi all,
> 
> I noticed that "mkfs.f2fs" has an option, "-e",
> to store certain files into the "cold log".
> 
> First, basic question, what is the "cold log" or,
> better, what is the differnce between the "normal"
> ("warm", I guess) log and this one.

Could you check this paper of fast15? :)

https://www.usenix.org/conference/fast15/technical-sessions/presentation/lee

> 
> Second, it is possible to disable this list *after*
> filesystem creation?
> Maybe even with it mounted?

I'm working on this feature via sysfs, will send it out soon.

Thanks,

> 
> Thanks a lot in advance,
> 


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH] f2fs: remove unneed reada during build free nids

2018-02-10 Thread Chao Yu
On 2018/2/11 9:55, heyunlei wrote:
> 
> 
>> -Original Message-
>> From: Chao Yu [mailto:c...@kernel.org]
>> Sent: Friday, February 09, 2018 9:37 PM
>> To: heyunlei; jaeg...@kernel.org; Yuchao (T); 
>> linux-f2fs-devel@lists.sourceforge.net
>> Subject: Re: [f2fs-dev] [PATCH] f2fs: remove unneed reada during build free 
>> nids
>>
>> On 2018/2/9 11:58, Yunlei He wrote:
>>> This patch remove unneed reada during build free nids.
>>> If few nids left, three will introduce a lot of no hit
>>> read io.
>>
>> I guess it is due to be lack of commit c1fe3e981440 ("Revert "f2fs:
>> reuse nids more aggressively""), before that commit, we will update
>> .next_scan_nid randomly instead of updating it ascendingly, then
>> during __build_free_nids we may readahead NAT pages starting from
>> random position.
> 
> I think commit c1fe3e981440 will reduce fragment of nat area, it
> will locate all used nids at the left head of nat area, which I think
> will do benefit to WA ?

Yup, IMO, it can reduce WA. ;)

Also, there is another patch intends to reduce WA by adjusting allocation
policy of free nid.

FYI

https://patchwork.kernel.org/patch/10084653/

> 
> e.g, if we have used 1 nids, which will hold 1/455 blocks at least.
> Without this commit, the blocks taken for nids will expansion, may be 1
> blocks in the worst case, at this time, if we update node info, we will 
> produce 
> more nat IOs?

That's right.

Thanks,

> 
>>
>> Could try that commit to check IO again?
>>
>> Thanks,


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v2] f2fs: introduce "strict_fsync" for posix standard fsync

2018-02-10 Thread Junling Zheng
Hi, Jaegeuk

On 2018/2/10 8:44, Jaegeuk Kim wrote:
> On 02/02, Junling Zheng wrote:
>> Commit "0a007b97aad6"(f2fs: recover directory operations by fsync)
>> fixed xfstest generic/342 case, but it also increased the written
>> data and caused the performance degradation. In most cases, there's
>> no need to do so heavily fsync actually.
>>
>> So we introduce a new mount option "strict_fsync" to control the
>> policy of fsync. It's set by default, and means that fsync follows
>> POSIX semantics. And "nostrict_fsync" means that the behaviour is
>> in line with xfs, ext4 and btrfs, where generic/342 will pass.
> 
> How about adding "fsync=%s" to give another chance for fsync policies?
> 

OK, I'll give patch v3 to change to "fsync=%s" format.
BTW, which policy do u think should be the default behavior for f2fs? Posix
or ext4?

Thanks
Junling

> Thanks,
> 
>>
>> Signed-off-by: Junling Zheng 
>> Reviewed-by: Chao Yu 
>> ---
>>  Documentation/filesystems/f2fs.txt |  4 
>>  fs/f2fs/dir.c  |  3 ++-
>>  fs/f2fs/f2fs.h |  1 +
>>  fs/f2fs/file.c |  3 ++-
>>  fs/f2fs/namei.c|  9 ++---
>>  fs/f2fs/super.c| 13 +
>>  6 files changed, 28 insertions(+), 5 deletions(-)
>>


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH] f2fs: remove unneed reada during build free nids

2018-02-10 Thread heyunlei


>-Original Message-
>From: Chao Yu [mailto:c...@kernel.org]
>Sent: Friday, February 09, 2018 9:37 PM
>To: heyunlei; jaeg...@kernel.org; Yuchao (T); 
>linux-f2fs-devel@lists.sourceforge.net
>Subject: Re: [f2fs-dev] [PATCH] f2fs: remove unneed reada during build free 
>nids
>
>On 2018/2/9 11:58, Yunlei He wrote:
>> This patch remove unneed reada during build free nids.
>> If few nids left, three will introduce a lot of no hit
>> read io.
>
>I guess it is due to be lack of commit c1fe3e981440 ("Revert "f2fs:
>reuse nids more aggressively""), before that commit, we will update
>.next_scan_nid randomly instead of updating it ascendingly, then
>during __build_free_nids we may readahead NAT pages starting from
>random position.

I think commit c1fe3e981440 will reduce fragment of nat area, it
will locate all used nids at the left head of nat area, which I think
will do benefit to WA ?

e.g, if we have used 1 nids, which will hold 1/455 blocks at least.
Without this commit, the blocks taken for nids will expansion, may be 1
blocks in the worst case, at this time, if we update node info, we will produce 
more nat IOs?

>
>Could try that commit to check IO again?
>
>Thanks,
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [RFC PATCH 0/2] f2fs: introduce lost+found feature

2018-02-10 Thread Sheng Yong

Hi, Jaegeuk

On 2018/2/10 10:50, Jaegeuk Kim wrote:

On 02/06, Sheng Yong wrote:

This patchset introduces lost+found feature in f2fs. If the feature is
enabled, f2fs should avoid to encrypting root directory.


In that case, we need to add test_dummy_encryption likewise ext4.


If the test_dummy_encryption is only used for some a testcase, I think
it's ok not to add it. The lost_found feature is not enabled by default,
so if we don't specify "-O lost_found" for mkfs, root directory is allowed
to be encrypted. If I miss something, please let me know :)

thanks,
Sheng



For more information, please check the mail "f2fs-tools: introduce lost+
found feature".

Thanks,
Sheng

Sheng Yong (2):
   f2fs: clean up f2fs_sb_has_xxx functions
   f2fs: introduce lost+found feature

  fs/f2fs/data.c|  2 +-
  fs/f2fs/f2fs.h| 53 +++--
  fs/f2fs/file.c|  6 +++---
  fs/f2fs/segment.c |  4 ++--
  fs/f2fs/super.c   | 26 +++---
  fs/f2fs/sysfs.c   |  4 ++--
  6 files changed, 42 insertions(+), 53 deletions(-)

--
2.11.0


.




--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] Cold log explanation

2018-02-10 Thread Piergiorgio Sartor
Hi all,

I noticed that "mkfs.f2fs" has an option, "-e",
to store certain files into the "cold log".

First, basic question, what is the "cold log" or,
better, what is the differnce between the "normal"
("warm", I guess) log and this one.

Second, it is possible to disable this list *after*
filesystem creation?
Maybe even with it mounted?

Thanks a lot in advance,

-- 

piergiorgio

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel