drm/mm: Document locking rules
Subsystems (2)
PATCH 1/1 drm/mm: Document locking rules
Drivers need to take care. Motivated by a discussion between Mark and Rob on dri-devel.
Cc Mark yao <[email protected]>
Cc Rob Clark <[email protected]>
Signed-off-by Daniel Vetter <[email protected]>
--- drivers/gpu/drm/drm_mm.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/drm_mm.c +5 -0
@@ -89,6 +89,11 @@* * Finally iteration helpers to walk all nodes and all holes are provided as are * some basic allocator dumpers for debugging. +* +* Note that this range allocator is not thread-safe, drivers need to protect +* allocation and freeing with their on locking. The idea behind this is that +* for a full memory manager additional data needs to be protected anyway, hence +* internal locking would be fully redundant. */ static struct drm_mm_node *drm_mm_search_free_generic(const struct drm_mm *mm,
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 15 lines · Daniel Vetter
Drivers need to take care. Motivated by a discussion between Mark and Rob on dri-devel.
Cc Mark yao <[email protected]>Cc Rob Clark <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- drivers/gpu/drm/drm_mm.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/drm_mm.c +0
-0
drivers/gpu/drm/drm_mm.c line 97
Quoted 9 lines
drivers/gpu/drm/drm_mm.c +5
-0@@ -89,6 +89,11 @@* * Finally iteration helpers to walk all nodes and all holes are provided as are * some basic allocator dumpers for debugging. +* +* Note that this range allocator is not thread-safe, drivers need to protect +* allocation and freeing with their on locking. The idea behind this is that +* for a full memory manager additional data needs to be protected anyway, hence +* internal locking would be fully redundant. */
I was going to write the same after that question, the only difference is trying to avoid using the terms allocation/freeing (since it doesn't!) - probably just replace both with "modification".
Reviewed-by Chris Wilson <[email protected]>
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel