summaryrefslogtreecommitdiff
path: root/include/uapi/drm
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-10-03 22:01:00 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-10-04 13:43:43 +0100
commit3dda22d3dcd1fc39e7867b2c5f5fc8fa79fdefcc (patch)
treef7074121eac9203209c3de91008807438b44719f /include/uapi/drm
parent4ee92c7149da9cb1991684628a9e47166a5e26f6 (diff)
drm/mm: Use clear_bit_unlock() for releasing the drm_mm_node()
A few callers need to serialise the destruction of their drm_mm_node and ensure it is removed from the drm_mm before freeing. However, to be completely sure that any access from another thread is complete before we free the struct, we require the RELEASE semantics of clear_bit_unlock(). This allows the conditional locking such as Thread A Thread B mutex_lock(mm_lock); if (drm_mm_node_allocated(node)) { drm_mm_node_remove(node); mutex_lock(mm_lock); mutex_unlock(mm_lock); if (drm_mm_node_allocated(node)) drm_mm_node_remove(node); mutex_unlock(mm_lock); } kfree(node); to serialise correctly without any lingering accesses from A to the freed node. Allocation / insertion of the node is assumed never to race with removal or eviction scanning. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191003210100.22250-5-chris@chris-wilson.co.uk
Diffstat (limited to 'include/uapi/drm')
0 files changed, 0 insertions, 0 deletions