The performance flame graph of resize shows that 'get_free_segments()' consum
most user space time:
https://linkthinking.cn/images/resize_flame.jpg

Every calling 'get_free_segments()', it will traverses all segments to calculate
the free segments count. And this path is called a lot in resize & sload &
defrag.

If the free segments count is cached, these tools performance will be
improved.

Changed in v2:
  - Fixed some logic issues reviewed by Chao Yu

Wu Bo (3):
  f2fs-tools: use 'IS_CUR_SEGNO()' to check if it is current segment
  f2fs-tools: skip not matched segment when finding free block
  f2fs-tools: cache free segments count to improve perfmance

 fsck/f2fs.h    |  1 +
 fsck/mount.c   | 25 ++++++++++++-------------
 fsck/segment.c |  2 ++
 3 files changed, 15 insertions(+), 13 deletions(-)

-- 
2.25.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to