Re: [PATCH] drm/mm: Document locking rules

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

 



On Tue, Dec 27, 2016 at 11:10:57AM +0100, Daniel Vetter wrote:
> Drivers need to take care. Motivated by a discussion between Mark and
> Rob on dri-devel.
> 
> Cc: Mark yao <mark.yao@xxxxxxxxxxxxxx>
> Cc: Rob Clark <robdclark@xxxxxxxxx>
> Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>
> ---
>  drivers/gpu/drm/drm_mm.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
> index ca1e344f318d..6109e022e000 100644
> --- a/drivers/gpu/drm/drm_mm.c
> +++ b/drivers/gpu/drm/drm_mm.c
> @@ -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 <chris@xxxxxxxxxxxxxxxxxx>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux