From fe2674dd52dd63e6fb4a69e037a7cb5266049e4a Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 15 Oct 2021 16:01:52 -0400 Subject: [PATCH] aux/pb: more correctly check number of reclaims MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the increment needs to happen before the comparison here Fixes: 3d6c8829f54 ("aux/pb: add a tolerance for reclaim failure") Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/pipebuffer/pb_slab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/pipebuffer/pb_slab.c b/src/gallium/auxiliary/pipebuffer/pb_slab.c index 865ae92ee7f..83c1a597fe7 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_slab.c +++ b/src/gallium/auxiliary/pipebuffer/pb_slab.c @@ -89,7 +89,7 @@ pb_slabs_reclaim_locked(struct pb_slabs *slabs) * the driver should not walk the entire list, as this is likely to * result in zero reclaims if the first few entries fail to reclaim */ - } else if (num_failed_reclaims++ > MAX_FAILED_RECLAIMS) { + } else if (++num_failed_reclaims >= MAX_FAILED_RECLAIMS) { break; } }