On Fri, Jun 14, 2019 at 8:10 PM Christian KÃnig <ckoenig.leichtzumerken@xxxxxxxxx> wrote:
[SNIP]
WW_MUTEX_LOCK_BEGIN()
lock(lru_lock);
while (bo = list_first(lru)) {
if (kref_get_unless_zero(bo)) {
unlock(lru_lock);
WW_MUTEX_LOCK(bo->ww_mutex);
lock(lru_lock);
} else {
/* bo is getting freed, steal it from the freeing process
* or just ignore */
}
}
unlock(lru_lock)
WW_MUTEX_LOCK_END;
Also I think if we allow this we could perhaps use this to implement the
modeset macros too.
-Daniel
This is kinda what we went with for modeset locks with_______________________________________________
DRM_MODESET_LOCK_ALL_BEGIN/END, you can grab more locks in between the
pair at least. But it's a lot more limited use-cases, maybe too fragile an
idea for ww_mutex in full generality.
Not going to type this out because too much w/e mode here already, but I
can give it a stab next week.
-Daniel
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel