Re: [PATCH v2 03/12] f2fs: cache: introduce shrinker

From: Wenjie Qi

Date: Tue Aug 25 2026 - 01:42:36 EST


Hi Chao,

> spin_lock(&cache->list_lock);
> list_for_each_entry_safe(entry, next, &cache->lru_list, list) {
> if (isolated >= nr_to_scan)
> break;
>
> if (f2fs_cache_test_dirty(entry) ||
> f2fs_cache_test_writeback(entry) ||
> f2fs_cache_test_locked(entry))
> continue;
>
> if (f2fs_cache_refcount(entry) != 1)
> continue;
>
> list_move_tail(&entry->list, &dispose_list);
> isolated++;
> }

`isolated` advances only for an eligible entry. Entries skipped by the state
and refcount checks do not consume the `nr_to_scan` budget.

Is `nr_to_scan` intended to bound the number of entries examined here, or only
the number of reclaimable entries isolated?