Re: [PATCH 08/19] drm/i915: Fix runtime pm handling in i915_gem_shrink

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Op 29-09-2021 om 10:37 schreef Matthew Auld:
> On Mon, 30 Aug 2021 at 13:10, Maarten Lankhorst
> <maarten.lankhorst@xxxxxxxxxxxxxxx> wrote:
>> We forgot to call intel_runtime_pm_put on error, fix it!
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
>> Fixes: cf41a8f1dc1e ("drm/i915: Finally remove obj->mm.lock.")
>> Cc: Thomas Hellström <thomas.hellstrom@xxxxxxxxxxxxxxx>
>> Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
>> Cc: <stable@xxxxxxxxxxxxxxx> # 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




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux