From: Eero Tamminen Date: Fri, 15 Dec 2023 19:36:31 +0000 (+0200) Subject: gpu_sysman: fix minimum memory usage calculation X-Git-Tag: 6.0.0-rc0~27^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4210%2Fhead;p=thirdparty%2Fcollectd.git gpu_sysman: fix minimum memory usage calculation Signed-off-by: Eero Tamminen --- diff --git a/src/gpu_sysman.c b/src/gpu_sysman.c index 20e9b5d4e..0b4e04925 100644 --- a/src/gpu_sysman.c +++ b/src/gpu_sysman.c @@ -1169,10 +1169,10 @@ static bool gpu_mems(gpu_device_t *gpu, unsigned int cache_idx) { /* find min & max values for memory free from * (the configured number of) samples */ - uint64_t free_min = (uint64_t)0xffffffff; - uint64_t free_max = 0, mem_free; + uint64_t free_max = 0; + uint64_t free_min = mem_size; for (uint32_t j = 0; j < config.samples; j++) { - mem_free = gpu->memory[j][i].free; + uint64_t mem_free = gpu->memory[j][i].free; if (mem_free < free_min) { free_min = mem_free; }