Totally find to me, but can we change it a bit like:
if (size < node->hole_size) {
best = node;
rb = rb->rb_right;
} else if (size > node->hole_size){
rb = rb->rb_left;
} else {
Hi Chris
Please check the sanity test of the patch from Rex
/Monk
From: Zhu, Rex
Sent: Friday, November 23, 2018 5:45 PM
To: Liu, Monk ; amd-...@lists.freedesktop.org
Subject: Re: [PATCH] drm: should break if already get the best size
Tested-by: Rex Zhu mailto:rex@amd.com>>
Without this
There is no checks at all in this best_hole() ... can you review the patch
again ?
/Monk
-Original Message-
From: Chris Wilson
Sent: Friday, November 23, 2018 5:34 PM
To: Liu, Monk ; dri-devel@lists.freedesktop.org
Subject: RE: FW: [PATCH] drm: should break if already get the best size
Quoting Liu, Monk (2018-11-23 09:11:02)
> What do you mean the first in the chain ? and also can you explain the "
> perfect match." ? thanks
>
> Assume there is couple nodes equal to the size you requested, without this
> patch it will traveler to the bottom level of the RB tree and gives you
nt: Friday, November 23, 2018 5:03 PM
To: Liu, Monk ; dri-devel@lists.freedesktop.org
Subject: Re: FW: [PATCH] drm: should break if already get the best size
Quoting Liu, Monk (2018-11-23 08:02:11)
>
>
> -Original Message-
> From: amd-gfx On Behalf Of
> Monk Liu
> Sent: T
Quoting Liu, Monk (2018-11-23 08:02:11)
>
>
> -Original Message-
> From: amd-gfx On Behalf Of Monk Liu
> Sent: Thursday, November 22, 2018 8:33 PM
> To: amd-...@lists.freedesktop.org
> Cc: Liu, Monk
> Subject: [PATCH] drm: should break if already get the best size
>
> Signed-off-by: Mo
-Original Message-
From: amd-gfx On Behalf Of Monk Liu
Sent: Thursday, November 22, 2018 8:33 PM
To: amd-...@lists.freedesktop.org
Cc: Liu, Monk
Subject: [PATCH] drm: should break if already get the best size
Signed-off-by: Monk Liu
---
drivers/gpu/drm/drm_mm.c | 2 ++
1 file changed
-Original Message-
From: amd-gfx On Behalf Of Monk Liu
Sent: Thursday, November 22, 2018 8:33 PM
To: amd-...@lists.freedesktop.org
Cc: Liu, Monk
Subject: [PATCH] drm: should break if already get the best size
Signed-off-by: Monk Liu
---
drivers/gpu/drm/drm_mm.c | 2 ++
1 file changed