]> www.infradead.org Git - users/hch/configfs.git/commit
xfs: use roundup_pow_of_two instead of ffs during xlog_find_tail
authorWang Jianchao <jianchwa@outlook.com>
Wed, 13 Sep 2023 01:38:01 +0000 (09:38 +0800)
committerChandan Babu R <chandanbabu@kernel.org>
Wed, 13 Sep 2023 05:08:20 +0000 (10:38 +0530)
commit8b010acb3154b669e52f0eef4a6d925e3cc1db2f
treeb73e826dd0d30ed73ac6e5c864f3b31e2138f064
parent1155b12edbb5d79a5730e1d9348cf3d8b2107696
xfs: use roundup_pow_of_two instead of ffs during xlog_find_tail

In our production environment, we find that mounting a 500M /boot
which is umount cleanly needs ~6s. One cause is that ffs() is
used by xlog_write_log_records() to decide the buffer size. It
can cause a lot of small IO easily when xlog_clear_stale_blocks()
needs to wrap around the end of log area and log head block is
not power of two. Things are similar in xlog_find_verify_cycle().

The code is able to handed bigger buffer very well, we can use
roundup_pow_of_two() to replace ffs() directly to avoid small
and sychronous IOs.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Wang Jianchao <wangjc136@midea.com>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/xfs_log_recover.c