Yes, the budget should use the supplied object size. The current limit
is a separate regression from
776a853a43c9 ("i915: Use writeback_iter()"). The old loop walked
size >> PAGE_SHIFT pages; the iterator now honours the pre-existing
SWAP_CLUSTER_MAX budget, leaving size unused.

The reclaim-accounting consequence needs some qualification, though.
Before optional writeback, i915 drops its references to the whole object's
pages and clears mapping unevictability. The remaining pages can be
reclaimed by the MM. The shrinker also counts the object when writeback
isn't requested, so that count doesn't mean every page reached swap.

I have sent a separate patch [1], "drm/i915: size shmem writeback budget
to the object", using an object-sized nr_to_write budget to restore the
previous writeback scope. It remains best-effort.
I have not measured the effect of the current limit on reclaim latency
or OOM.

[1] 
https://lore.kernel.org/all/[email protected]/

Reply via email to