Re: [f2fs-dev] [PATCH] f2fs: no need to take the address of the array of sb->s_uuid

2018-04-04 Thread Gao Xiang
Hi Jaegeuk,

On 2018/4/5 11:54, Jaegeuk Kim wrote:
> Hi Gao,
> 
> Could you please check your email settings?
> It's broken.
> 
> Thanks,Sorry to bother for the pervious email..
My business email client was just in a mess. :(

Thanks,

> 
> On 04/05, Gao Xiang wrote:
>> Keep in line with the common case since it is some weird
>> to take the address of an array again.
>>
>> Signed-off-by: Gao Xiang 
>> ---
>>  fs/f2fs/super.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
>> index 42d564c5ccd0..f864ab702fa2 100644
>> --- a/fs/f2fs/super.c
>> +++ b/fs/f2fs/super.c
>> @@ -2701,7 +2701,7 @@ static int f2fs_fill_super(struct super_block *sb,
>> void *data, int silent)
>>  sb->s_time_gran = 1;
>>  sb->s_flags = (sb->s_flags & ~SB_POSIXACL) |
>>  (test_opt(sbi, POSIX_ACL) ? SB_POSIXACL : 0);
>> -memcpy(&sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
>> +memcpy(sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
>>  sb->s_iflags |= SB_I_CGROUPWB;
>>  /* init f2fs-specific super block info */
>> -- 
>> 2.12.2

--
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] [RESEND PATCH] f2fs: no need to take the address of the array of sb->s_uuid

2018-04-04 Thread Gao Xiang
Keep in line with the common case since it is some weird
to take the address of an array again.

Signed-off-by: Gao Xiang 
---
fix auto-wrapping of email client

 fs/f2fs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 9587ca0..4d467c7 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2565,7 +2565,7 @@ static int f2fs_fill_super(struct super_block *sb, void 
*data, int silent)
sb->s_time_gran = 1;
sb->s_flags = (sb->s_flags & ~SB_POSIXACL) |
(test_opt(sbi, POSIX_ACL) ? SB_POSIXACL : 0);
-   memcpy(&sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
+   memcpy(sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
sb->s_iflags |= SB_I_CGROUPWB;
 
/* init f2fs-specific super block info */
-- 
2.1.4


--
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: no need to take the address of the array of sb->s_uuid

2018-04-04 Thread Jaegeuk Kim
Hi Gao,

Could you please check your email settings?
It's broken.

Thanks,

On 04/05, Gao Xiang wrote:
> Keep in line with the common case since it is some weird
> to take the address of an array again.
> 
> Signed-off-by: Gao Xiang 
> ---
>  fs/f2fs/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 42d564c5ccd0..f864ab702fa2 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -2701,7 +2701,7 @@ static int f2fs_fill_super(struct super_block *sb,
> void *data, int silent)
>   sb->s_time_gran = 1;
>   sb->s_flags = (sb->s_flags & ~SB_POSIXACL) |
>   (test_opt(sbi, POSIX_ACL) ? SB_POSIXACL : 0);
> - memcpy(&sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
> + memcpy(sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
>   sb->s_iflags |= SB_I_CGROUPWB;
>   /* init f2fs-specific super block info */
> -- 
> 2.12.2

--
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 v10 00/62] Convert page cache to XArray

2018-04-04 Thread Matthew Wilcox
On Wed, Apr 04, 2018 at 09:35:46AM -0700, Mike Kravetz wrote:
> Running with this XArray series on top of next-20180329 consistently 'hangs'
> on shutdown looping (?forever?) in tag_pages_for_writeback/xas_for_each_tag.
> All I have to do is make sure there is some activity on the ext4 fs before
> shutdown.  Not sure if this is a 'next-20180329' issue or XArray issue.
> But the fact that we are looping in xas_for_each_tag looks suspicious.

Thanks for your help debugging this!  Particularly collecting the xa_dump.
I got bit by the undefined behaviour of shifting by BITS_PER_LONG,
but of course it was subtle.

The userspace testing framework wasn't catching this for a couple of
reasons; I'll work on making sure it catches this kind of thing in
the future.

I'll fold this in and post a v11 later this week or early next week.

diff --git a/include/linux/xarray.h b/include/linux/xarray.h
index eac04922eba2..f5b7e507a86f 100644
--- a/include/linux/xarray.h
+++ b/include/linux/xarray.h
@@ -904,9 +929,12 @@ static inline unsigned int xas_find_chunk(struct xa_state 
*xas, bool advance,
if (advance)
offset++;
if (XA_CHUNK_SIZE == BITS_PER_LONG) {
-   unsigned long data = *addr & (~0UL << offset);
-   if (data)
-   return __ffs(data);
+   if (offset < XA_CHUNK_SIZE) {
+   unsigned long data = *addr & (~0UL << offset);
+
+   if (data)
+   return __ffs(data);
+   }
return XA_CHUNK_SIZE;
}
 

--
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: enlarge block plug coverage

2018-04-04 Thread Jaegeuk Kim
On 04/04, Chao Yu wrote:
> This patch enlarges block plug coverage in __issue_discard_cmd, in
> order to collect more pending bios before issuing them, to avoid
> being disturbed by previous discard I/O in IO aware discard mode.

Hmm, then we need to wait for huge discard IO for over 10 secs, which
will affect following read/write IOs accordingly. In order to avoid that,
we actually need to limit the discard size.

Thanks,

> 
> Signed-off-by: Chao Yu 
> ---
>  fs/f2fs/segment.c | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 8f0b5ba46315..4287e208c040 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1208,10 +1208,12 @@ static int __issue_discard_cmd(struct f2fs_sb_info 
> *sbi,
>   pend_list = &dcc->pend_list[i];
>  
>   mutex_lock(&dcc->cmd_lock);
> +
> + blk_start_plug(&plug);
> +
>   if (list_empty(pend_list))
>   goto next;
>   f2fs_bug_on(sbi, !__check_rb_tree_consistence(sbi, &dcc->root));
> - blk_start_plug(&plug);
>   list_for_each_entry_safe(dc, tmp, pend_list, list) {
>   f2fs_bug_on(sbi, dc->state != D_PREP);
>  
> @@ -1227,8 +1229,9 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi,
>   if (++iter >= dpolicy->max_requests)
>   break;
>   }
> - blk_finish_plug(&plug);
>  next:
> + blk_finish_plug(&plug);
> +
>   mutex_unlock(&dcc->cmd_lock);
>  
>   if (iter >= dpolicy->max_requests)
> -- 
> 2.15.0.55.gc2ece9dc4de6

--
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] mkfs.f2fs: fix incorrect cold data location

2018-04-04 Thread Jaegeuk Kim
On 04/04, Chao Yu wrote:
> If last_zone((total_zones >> 2)) is equal or less than
> next_zone(CURSEG_COLD_NODE), cold data area will be located in the
> same position with hot data, fixes it.

verify_cur_segs() will rearrage this?


> 
> Signed-off-by: Chao Yu 
> ---
>  mkfs/f2fs_format.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
> index 65692bbe083a..8885f632371d 100644
> --- a/mkfs/f2fs_format.c
> +++ b/mkfs/f2fs_format.c
> @@ -471,7 +471,7 @@ static int f2fs_prepare_super_block(void)
>   c.cur_seg[CURSEG_HOT_DATA] = next_zone(CURSEG_COLD_NODE);
>   c.cur_seg[CURSEG_COLD_DATA] =
>   max(last_zone((total_zones >> 2)),
> - next_zone(CURSEG_COLD_NODE));
> + next_zone(CURSEG_HOT_DATA));
>   c.cur_seg[CURSEG_WARM_DATA] =
>   max(last_zone((total_zones >> 1)),
>   next_zone(CURSEG_COLD_DATA));
> -- 
> 2.15.0.55.gc2ece9dc4de6

--
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: fix to show encrypt flag in FS_IOC_GETFLAGS

2018-04-04 Thread Jaegeuk Kim
On 04/03, Chao Yu wrote:
> On 2018/4/3 4:21, Jaegeuk Kim wrote:
> > On 04/02, Chao Yu wrote:
> >> This patch fixes to show encrypt flag in FS_IOC_GETFLAGS like ext4 does.
> > 
> > Actually, we have to show internal flags owned by f2fs, not generic ones.
> > We may need to define all of them separately?
> 
> Agreed, I wrote a patch, could check that? and in that patch, do we need to
> delete flag definition f2fs don't use?

IMO, we'd better keep the flags. I merged it and could you add encryption part
on top of it?

Thanks,

> 
> Thanks,
> 
> > 
> >>
> >> Signed-off-by: Chao Yu 
> >> ---
> >>  fs/f2fs/file.c | 9 +++--
> >>  1 file changed, 7 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> >> index 8068b015ece5..271fadadaa36 100644
> >> --- a/fs/f2fs/file.c
> >> +++ b/fs/f2fs/file.c
> >> @@ -1584,8 +1584,13 @@ static int f2fs_ioc_getflags(struct file *filp, 
> >> unsigned long arg)
> >>  {
> >>struct inode *inode = file_inode(filp);
> >>struct f2fs_inode_info *fi = F2FS_I(inode);
> >> -  unsigned int flags = fi->i_flags &
> >> -  (FS_FL_USER_VISIBLE | FS_PROJINHERIT_FL);
> >> +  unsigned int flags = fi->i_flags;
> >> +
> >> +  if (file_is_encrypt(inode))
> >> +  flags |= FS_ENCRYPT_FL;
> >> +
> >> +  flags &= FS_FL_USER_VISIBLE | FS_PROJINHERIT_FL;
> >> +
> >>return put_user(flags, (int __user *)arg);
> >>  }
> >>  
> >> -- 
> >> 2.15.0.55.gc2ece9dc4de6
> > 
> > .
> > 

--
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] [GIT PULL] f2fs update for 4.17-rc1

2018-04-04 Thread Jaegeuk Kim
Hi Linus,

Could you please consider this pull request?

Thanks,

The following changes since commit 3664ce2d930983966d2aac0e167f1332988c4e25:

  Merge tag 'powerpc-4.16-4' of 
git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux (2018-02-24 
16:05:50 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git 
tags/f2fs-for-4.17

for you to fetch changes up to 214c2461a864a46b11856426b80dc7db453043c5:

  f2fs: remain written times to update inode during fsync (2018-04-03 18:52:47 
-0700)


f2fs-for-4.17-rc1

In this round, we've mainly focused on performance tuning and critical bug fixes
occurred in low-end devices. Sheng Yong introduced lost_found feature to keep
missing files during recovery instead of thrashing them. We're preparing coming
fsverity implementation. And, we've got more features to communicate with users
for better performance. In low-end devices, some memory-related issues were
fixed, and subtle race condtions and corner cases were addressed as well.

Enhancement:
 - large nat bitmaps for more free node ids
 - add three block allocation policies to pass down write hints given by user
 - expose extension list to user and introduce hot file extension
 - tune small devices seamlessly for low-end devices
 - set readdir_ra by default
 - give more resources under gc_urgent mode regarding to discard and cleaning
 - introduce fsync_mode to enforce posix or not
 - nowait aio support
 - add lost_found feature to keep dangling inodes
 - reserve bits for future fsverity feature
 - add test_dummy_encryption for FBE

Bug fix:
 - don't use highmem for dentry pages
 - align memory boundary for bitops
 - truncate preallocated blocks in write errors
 - guarantee i_times on fsync call
 - clear CP_TRIMMED_FLAG correctly
 - prevent node chain loop during recovery
 - avoid data race between atomic write and background cleaning
 - avoid unnecessary selinux violation warnings on resgid option
 - GFP_NOFS to avoid deadlock in quota and read paths
 - fix f2fs_skip_inode_update to allow i_size recovery

In addition to them, there are several minor bug fixes and clean-ups.


Chao Yu (16):
  f2fs: restrict inline_xattr_size configuration
  f2fs: fix to check extent cache in f2fs_drop_extent_tree
  f2fs: support large nat bitmap
  f2fs: fix to clear CP_TRIMMED_FLAG
  f2fs: fix to handle looped node chain during recovery
  f2fs: introduce sb_lock to make encrypt pwsalt update exclusive
  f2fs: fix to set KEEP_SIZE bit in f2fs_zero_range
  f2fs: expose extension_list sysfs entry
  f2fs: fix to avoid race in between atomic write and background GC
  f2fs: support hot file extension
  f2fs: wrap sb_rdonly with f2fs_readonly
  f2fs: fix to restore old mount option in ->remount_fs
  f2fs: wrap all options with f2fs_sb_info.mount_opt
  f2fs: remove unneeded set_cold_node()
  f2fs: clean up with F2FS_BLK_ALIGN
  f2fs: don't track new nat entry in nat set

Colin Ian King (1):
  f2fs: remove redundant initialization of pointer 'p'

Eric Biggers (1):
  f2fs: reserve bits for fs-verity

Gao Xiang (1):
  f2fs: flush cp pack except cp pack 2 page at first

Hyunchul Lee (4):
  f2fs: support passing down write hints given by users to block layer
  f2fs: support passing down write hints to block layer with F2FS policy
  f2fs: Add the 'whint_mode' mount option to f2fs documentation
  f2fs: add nowait aio support

Jaegeuk Kim (11):
  f2fs: handle quota for orphan inodes
  f2fs: don't stop GC if GC is contended
  f2fs: add mount option for segment allocation policy
  f2fs: add auto tuning for small devices
  f2fs: set readdir_ra by default
  f2fs: issue discard aggressively in the gc_urgent mode
  f2fs: do gc in greedy mode for whole range if gc_urgent mode is set
  f2fs: avoid selinux denial on CAP_SYS_RESOURCE
  f2fs: align memory boundary for bitops
  f2fs: truncate preallocated blocks in error case
  f2fs: remain written times to update inode during fsync

Junling Zheng (2):
  f2fs: introduce mount option for fsync mode
  f2fs: fix a wrong condition in f2fs_skip_inode_update

Qiuyang Sun (1):
  f2fs: release locks before return in f2fs_ioc_gc_range()

Ritesh Harjani (1):
  f2fs: Set GF_NOFS in read_cache_page_gfp while doing f2fs_quota_read

Sheng Yong (4):
  f2fs: fix potential corruption in area before F2FS_SUPER_OFFSET
  f2fs: clean up f2fs_sb_has_xxx functions
  f2fs: introduce F2FS_FEATURE_LOST_FOUND feature
  f2fs: introduce a new mount option test_dummy_encryption

Tiezhu Yang (1):
  f2fs: remove redundant check of page type when submit bio

Yunlei He (3):
  f2fs: Don't overwrite all types of node to keep node chain
  f2fs: check blkaddr more accuratly before issue

[f2fs-dev] [PATCH] f2fs: no need to take the address of the array of sb->s_uuid

2018-04-04 Thread Gao Xiang

Keep in line with the common case since it is some weird
to take the address of an array again.

Signed-off-by: Gao Xiang 
---
 fs/f2fs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 42d564c5ccd0..f864ab702fa2 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2701,7 +2701,7 @@ static int f2fs_fill_super(struct super_block *sb, 
void *data, int silent)

sb->s_time_gran = 1;
sb->s_flags = (sb->s_flags & ~SB_POSIXACL) |
(test_opt(sbi, POSIX_ACL) ? SB_POSIXACL : 0);
-   memcpy(&sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
+   memcpy(sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
sb->s_iflags |= SB_I_CGROUPWB;
/* init f2fs-specific super block info */
--
2.12.2


--
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: fix to show encrypt flag in FS_IOC_GETFLAGS

2018-04-04 Thread Sasha Levin via Linux-f2fs-devel
Hi Chao Yu.

[This is an automated email]

This commit has been processed by the -stable helper bot and determined
to be a high probability candidate for -stable trees. (score: 11.4088)

The bot has tested the following trees: v4.15.15, v4.14.32, v4.9.92, v4.4.126, 

v4.15.15: Build OK!
v4.14.32: Build OK!
v4.9.92: Failed to apply! Possible dependencies:
2c1d03056991: ("f2fs: support F2FS_IOC_FS{GET,SET}XATTR")
34dc77ad7436: ("f2fs: add ioctl to do gc with target block address")
e066b83c9b40: ("f2fs: add ioctl to flush data from faster device to cold 
area")
cac5a3d8f517: ("f2fs: fix 446 coding style warnings in f2fs.h")
7c45729a4d6d: ("f2fs: keep dirty inodes selectively for checkpoint")
15d04354555f: ("f2fs: call f2fs_balance_fs for setattr")

v4.4.126: Failed to apply! Possible dependencies:
2c1d03056991: ("f2fs: support F2FS_IOC_FS{GET,SET}XATTR")
34dc77ad7436: ("f2fs: add ioctl to do gc with target block address")
e066b83c9b40: ("f2fs: add ioctl to flush data from faster device to cold 
area")
4dd6f977fc77: ("f2fs: support an ioctl to move a range of data blocks")
d323d005ac4a: ("f2fs: support file defragment")
8da4b8c48e7b: ("lib/uuid.c: move generate_random_uuid() to uuid.c")
9b7365fc1c82: ("ext4: add FS_IOC_FSSETXATTR/FS_IOC_FSGETXATTR interface 
support")


Please let us know if you'd like to have this patch included in a stable tree.

--
Thanks.
Sasha
--
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 v10 00/62] Convert page cache to XArray

2018-04-04 Thread Mike Kravetz
On 03/29/2018 08:41 PM, Matthew Wilcox wrote:
> From: Matthew Wilcox 
> 
> I'd like to thank Andrew for taking the first eight XArray patches
> into -next.  He's understandably nervous about taking the rest of the
> patches into -next given how few of the remaining patches have review
> tags on them.  So ... if you're on the cc, I'd really appreciate a review
> on something that you feel somewhat responsible for, eg the particular
> filesystem (nilfs, f2fs, lustre) that I've touched, or something in the
> mm/ or fs/ directories that you've worked on recently.
> 
> This is against next-20180329.
> 

I applied this series to next-20180329 and booted in a debug environment.
My root fs is ext4, and next-20180329 had the first (bad) fix in bug
https://bugzilla.kernel.org/show_bug.cgi?id=199185
so, I had to apply the revised fix.

Running with this XArray series on top of next-20180329 consistently 'hangs'
on shutdown looping (?forever?) in tag_pages_for_writeback/xas_for_each_tag.
All I have to do is make sure there is some activity on the ext4 fs before
shutdown.  Not sure if this is a 'next-20180329' issue or XArray issue.
But the fact that we are looping in xas_for_each_tag looks suspicious.

#0  xas_find_chunk (tag=, advance=, 
xas=) at ./include/linux/xarray.h:886
#1  xas_next_tag (tag=, max=, 
xas=) at ./include/linux/xarray.h:915
#2  tag_pages_for_writeback (mapping=, start=, 
end=2251799813685247) at mm/page-writeback.c:2109
#3  0x812eccf0 in ext4_writepages (mapping=0x88012bf9b918, 
wbc=) at fs/ext4/inode.c:2793
#4  0x811bbe4b in do_writepages (mapping=0xc90001727a28, 
wbc=0x) at mm/page-writeback.c:2332
#5  0x812743bd in __writeback_single_inode (inode=0xc90001727a28, 
wbc=0xc90001727cc0) at fs/fs-writeback.c:1315
#6  0x81274aaf in writeback_sb_inodes (sb=0x88012e2e2e98, 
wb=0x88012c02e000, work=0x88012c4aae18) at fs/fs-writeback.c:1579
#7  0x81274ff7 in wb_writeback (wb=0x88012c02e000, 
work=0x88012c4aae18) at fs/fs-writeback.c:1755
#8  0x812757df in wb_do_writeback (wb=)
at fs/fs-writeback.c:1900
#9  wb_workfn (work=0xc90001727a28) at fs/fs-writeback.c:1941
#10 0x810b7415 in process_one_work (worker=0x88012eff6d68, 
work=0x88012c02e190) at kernel/workqueue.c:2145
#11 0x810b762e in worker_thread (__worker=0x88012eff6d68)
at kernel/workqueue.c:2279
#12 0x810bd7c3 in kthread (_create=0x88012e88fc28)
at kernel/kthread.c:238
#13 0x81a00205 in ret_from_fork () at arch/x86/entry/entry_64.S:411
#14 0x in ?? ()

-- 
Mike Kravetz

--
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: issue all big range discards in umount process

2018-04-04 Thread Chao Yu
On 2018/4/4 17:29, Yunlei He wrote:
> This patch modify max_requests to UINT_MAX, to issue
> all big range discards in umount.
> 
> Signed-off-by: Yunlei He 

Reviewed-by: Chao Yu 

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


[f2fs-dev] [PATCH] f2fs: issue all big range discards in umount process

2018-04-04 Thread Yunlei He
This patch modify max_requests to UINT_MAX, to issue
all big range discards in umount.

Signed-off-by: Yunlei He 
---
 fs/f2fs/segment.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 5854cc4..a4b8e3e2 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1730,6 +1730,7 @@ void init_discard_policy(struct discard_policy *dpolicy,
} else if (discard_type == DPOLICY_FSTRIM) {
dpolicy->io_aware = false;
} else if (discard_type == DPOLICY_UMOUNT) {
+   dpolicy->max_requests = UINT_MAX;
dpolicy->io_aware = false;
}
 }
-- 
1.9.1


--
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] [PATCH] f2fs: remove redundant block plug

2018-04-04 Thread Chao Yu
For buffered IO, we don't need to use block plug to cache bio,
for direct IO, generic f2fs_direct_IO has already added block
plug, so let's remove redundant one in .write_iter.

Signed-off-by: Chao Yu 
---
 fs/f2fs/file.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index fa8f7cf1498f..5ecf1e355a97 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -2943,9 +2943,8 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, 
struct iov_iter *from)
inode_unlock(inode);
return err;
}
-   blk_start_plug(&plug);
+
ret = __generic_file_write_iter(iocb, from);
-   blk_finish_plug(&plug);
clear_inode_flag(inode, FI_NO_PREALLOC);
 
if (ret > 0)
-- 
2.15.0.55.gc2ece9dc4de6


--
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] [PATCH v2] f2fs: enlarge block plug coverage

2018-04-04 Thread Chao Yu
This patch enlarges block plug coverage in __issue_discard_cmd, in
order to collect more pending bios before issuing them, to avoid
being disturbed by previous discard I/O in IO aware discard mode.

Signed-off-by: Chao Yu 
---
v2:
- fix to move plug to correct place.
 fs/f2fs/segment.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 8f0b5ba46315..e61faff9b109 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1202,6 +1202,8 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi,
int i, iter = 0, issued = 0;
bool io_interrupted = false;
 
+   blk_start_plug(&plug);
+
for (i = MAX_PLIST_NUM - 1; i >= 0; i--) {
if (i + 1 < dpolicy->granularity)
break;
@@ -1211,7 +1213,6 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi,
if (list_empty(pend_list))
goto next;
f2fs_bug_on(sbi, !__check_rb_tree_consistence(sbi, &dcc->root));
-   blk_start_plug(&plug);
list_for_each_entry_safe(dc, tmp, pend_list, list) {
f2fs_bug_on(sbi, dc->state != D_PREP);
 
@@ -1227,7 +1228,6 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi,
if (++iter >= dpolicy->max_requests)
break;
}
-   blk_finish_plug(&plug);
 next:
mutex_unlock(&dcc->cmd_lock);
 
@@ -1235,6 +1235,8 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi,
break;
}
 
+   blk_finish_plug(&plug);
+
if (!issued && io_interrupted)
issued = -1;
 
-- 
2.15.0.55.gc2ece9dc4de6


--
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] [PATCH] f2fs: enlarge block plug coverage

2018-04-04 Thread Chao Yu
This patch enlarges block plug coverage in __issue_discard_cmd, in
order to collect more pending bios before issuing them, to avoid
being disturbed by previous discard I/O in IO aware discard mode.

Signed-off-by: Chao Yu 
---
 fs/f2fs/segment.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 8f0b5ba46315..4287e208c040 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1208,10 +1208,12 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi,
pend_list = &dcc->pend_list[i];
 
mutex_lock(&dcc->cmd_lock);
+
+   blk_start_plug(&plug);
+
if (list_empty(pend_list))
goto next;
f2fs_bug_on(sbi, !__check_rb_tree_consistence(sbi, &dcc->root));
-   blk_start_plug(&plug);
list_for_each_entry_safe(dc, tmp, pend_list, list) {
f2fs_bug_on(sbi, dc->state != D_PREP);
 
@@ -1227,8 +1229,9 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi,
if (++iter >= dpolicy->max_requests)
break;
}
-   blk_finish_plug(&plug);
 next:
+   blk_finish_plug(&plug);
+
mutex_unlock(&dcc->cmd_lock);
 
if (iter >= dpolicy->max_requests)
-- 
2.15.0.55.gc2ece9dc4de6


--
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