Re: [PATCH 1/2] drm/mm: Fix caching of leftmost node in the interval tree

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

 



Quoting Chris Wilson (2018-02-19 10:57:27)
> When we descend the tree to find our slot, if we step to the right, we
> are no longer the leftmost node.
> 
> Fixes: f808c13fd373 ("lib/interval_tree: fast overlap detection")
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Davidlohr Bueso <dbueso@xxxxxxx>
> Cc: Jérôme Glisse <jglisse@xxxxxxxxxx>
> Cc: Christian König <christian.koenig@xxxxxxx>

<SNIP>

> @@ -208,11 +209,11 @@ static void drm_mm_interval_tree_add_node(struct drm_mm_node *hole_node,
>                 parent = rb_entry(rb, struct drm_mm_node, rb);
>                 if (parent->__subtree_last < node->__subtree_last)
>                         parent->__subtree_last = node->__subtree_last;
> -               if (node->start < parent->start)
> +               if (node->start < parent->start) {
>                         link = &parent->rb.rb_left;
> -               else {
> +               } else {
>                         link = &parent->rb.rb_right;
> -                       leftmost = true;
> +                       leftmost = false;

As this bug didn't have any functional effect, we could go with
rb_insert_augmented and not try to cache the node if the information
ends up being unused.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>

Regards, Joonas
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux