[PATCH 2/2] drm/ttm: completely rework ttm_bo_delayed_delete

Michel Dänzer michel at daenzer.net
Wed Nov 15 15:12:09 UTC 2017


On 15/11/17 01:31 PM, Christian König wrote:
> There is no guarantee that the next entry on the ddelete list stays on
> the list when we drop the locks.
> 
> Completely rework this mess by moving processed entries on a temporary
> list.
> 
> Signed-off-by: Christian König <christian.koenig at amd.com>

[...]

>  static void ttm_bo_delayed_workqueue(struct work_struct *work)
>  {
>  	struct ttm_bo_device *bdev =
>  	    container_of(work, struct ttm_bo_device, wq.work);
> +	unsigned long delay = ((HZ / 100) < 1) ? 1 : HZ / 100;
>  
> -	if (ttm_bo_delayed_delete(bdev, false)) {
> -		schedule_delayed_work(&bdev->wq,
> -				      ((HZ / 100) < 1) ? 1 : HZ / 100);
> -	}
> +	if (!ttm_bo_delayed_delete(bdev, false))
> +		schedule_delayed_work(&bdev->wq, delay);
>  }

Would be better to only add the ! here and leave the rest of this
function unchanged in this patch. The cleanup can be done in a separate
patch.

Other than that, both patches are

Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the dri-devel mailing list