Re: [PATCH v5 1/2] f2fs: introduce proc/fs/f2fs/<dev>/fsck_stack node

From: Chao Yu
Date: Sun Aug 15 2021 - 21:57:58 EST


On 2021/8/14 10:08, 李扬韬 wrote:
We can't remove stack from depot, as we store them contiguously one after
another in a contiguous memory allocation.

Or we can limit the recorded stack number.

$ grep -nr "SBI_NEED_FSCK" fs/f2fs/ --include=*.c --include=*.h | wc -l
53
$ grep -nr "f2fs_bug_on" fs/f2fs/ --include=*.c --include=*.h | wc -l
135

I didn't look into details of stack_depot_save(), two stack handles from below
call paths will be the same?

- move_data_block
- f2fs_wait_on_page_writeback
- f2fs_bug_on

- ra_data_block
- f2fs_wait_on_page_writeback
- f2fs_bug_on

If they have different stack handles, combination number of
set_sbi_flag(NEED_FSCK)/f2fs_bug_on and their callers will be far more than two
hundred.


Yes, these will be two different stacks. In the most extreme case, there will be 1000 (I guess) different places to set fsck?

It may be according to call stack height of each handle record.

Or we limit the number of recorded stacks to 10?

Yes, please limit the record number, maybe 8? and stack height could be 16 at
maximum?

Thanks,

what do you think. The stack depot design does not consider removing the stack from the depot.

MBR,
Yangtao