>       mutex_lock(&hmm->lock);
> -     list_for_each_entry(range, &hmm->ranges, list)
> -             range->valid = false;
> -     wake_up_all(&hmm->wq);
> +     /*
> +      * Since hmm_range_register() holds the mmget() lock hmm_release() is
> +      * prevented as long as a range exists.
> +      */
> +     WARN_ON(!list_empty(&hmm->ranges));
>       mutex_unlock(&hmm->lock);

This can just use list_empty_careful and avoid the lock entirely.

Otherwise looks good:

Reviewed-by: Christoph Hellwig <h...@lst.de>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to