mbox series

[f2fs-dev,v2,0/3] f2fs-tools: cache free segments count to improve perfmance

Message ID cover.1695890686.git.bo.wu@vivo.com (mailing list archive)
Headers show
Series f2fs-tools: cache free segments count to improve perfmance | expand

Message

Wu Bo Sept. 28, 2023, 9:20 a.m. UTC
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(-)