Skip to content

Commit

Permalink
Merge pull request collectd#4210 from eero-t/min-mem-fix
Browse files Browse the repository at this point in the history
[collectd 6] gpu_sysman: fix minimum memory usage calculation
  • Loading branch information
octo committed Dec 22, 2023
2 parents 345c52d + 472a34f commit e4db172
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gpu_sysman.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e4db172

Please sign in to comment.