Op 29-09-2021 om 10:37 schreef Matthew Auld: > On Mon, 30 Aug 2021 at 13:10, Maarten Lankhorst > <maarten.lankho...@linux.intel.com> wrote: >> We forgot to call intel_runtime_pm_put on error, fix it! >> >> Signed-off-by: Maarten Lankhorst <maarten.lankho...@linux.intel.com> >> Fixes: cf41a8f1dc1e ("drm/i915: Finally remove obj->mm.lock.") >> Cc: Thomas Hellström <thomas.hellst...@linux.intel.com> >> Cc: Daniel Vetter <daniel.vet...@ffwll.ch> >> Cc: <sta...@vger.kernel.org> # v5.13+ > How does the err handling work? gem_shrink is meant to return the > number of pages reclaimed which is an unsigned long, and yet we are > also just returning the err here? Fortunately it looks like nothing is > calling gem_shrinker with an actual ww context, so nothing will hit > this yet? I think the interface needs to be reworked or something.
We should probably make it signed in the future when used. It should never hit the LONG_MAX limit, since max value returned would be ULONG_MAX >> PAGE_SHIFT, assuming the entire address space is filled with evictable buffers. I've kept the ww lock, in case we want to evict in the future. Without ww context the buffers are trylocked, with ww we can evict the entire address space as much as possible. In most cases we only want to evict idle objects, in that case no ww is needed. Pushed just this patch, thanks for feedback. :) ~Maarten