Re: [PATCH v2 01/12] f2fs: cache: implement metadata cache

From: Chao Yu

Date: Tue Aug 25 2026 - 02:35:58 EST


On 8/25/26 13:39, Wenjie Qi wrote:
Hi Chao,

next:
spin_lock_irqsave(&cache->tree_lock, flags);
nr = radix_tree_gang_lookup(&cache->root, (void **)entries, index,
min((unsigned long)F2FS_ONSTACK_CACHES, end - index));
...
spin_unlock_irqrestore(&cache->tree_lock, flags);
...
if (index < end)
goto next;

`nr` bounds each gang lookup, while the outer loop continues until `index`
reaches `end`. Dropping `tree_lock` between batches is not itself a
scheduling point.

Is there a scheduling point or another bound on the number of entries that
this range invalidation can process in one invocation?

Wenjie,

I think it's good to have cond_resched() before "goto next", will fix in below
cases:

- f2fs_cache_wait_on_all_writeback
- f2fs_drop_cache_range
- f2fs_invalidate_compress_pages

Thanks,