lkml.org 
[lkml]   [2022]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 6/8] drm/shmem-helper: Add generic memory shrinker
From
On 3/17/22 20:32, Daniel Vetter wrote:
>> +static void drm_gem_shmem_update_purgeable_status(struct drm_gem_shmem_object *shmem)
>> +{
>> + struct drm_gem_object *obj = &shmem->base;
>> + struct drm_gem_shmem_shrinker *gem_shrinker = obj->dev->shmem_shrinker;
>> + size_t page_count = obj->size >> PAGE_SHIFT;
>> +
>> + if (!gem_shrinker || obj->import_attach || !obj->funcs->purge)
>> + return;
>> +
>> + mutex_lock(&shmem->vmap_lock);
>> + mutex_lock(&shmem->pages_lock);
>> + mutex_lock(&gem_shrinker->lock);
> Uh this is just terrible I think.
>
> Can't we move shmem helpers over to reasonable locking, i.e. per-object
> dma_resv_lock for everything? I know it's a pile of work, but I think
> we're way past the point with things like this popping up where we should
> just bite that bullet.
>
> I discussed the full thing with Daniel Stone, but maybe a joint refresher
> on irc would be a good thing.

Aha! Perhaps I saw bits of that discussion, but it wasn't entirely clear
to me what was discussed in fact. Sounds like a good idea to try to use
the reservation lock everywhere, thank you for the suggestion.

\
 
 \ /
  Last update: 2022-03-17 18:49    [W:0.077 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site