r620: revamped thread-local memory management

* Don't preallocate sdust_buf or minizer list. kalloc should be fast enough -
  benchmarks needed to confirm.

* Fixed a memory leak caused by divergence estimate (post v2.5)

* Reset the kalloc buffer after mapping a long query. This reduces peak memory
  when large chunks of memory are allocated, at the cost of performance, though.
This commit is contained in:
Heng Li
2017-12-11 12:11:10 -05:00
parent 98a6e52c06
commit f6608fe99c
6 changed files with 64 additions and 53 deletions
+6 -2
View File
@@ -189,6 +189,10 @@ void km_stat(const void *_km, km_stat_t *s)
panic("[km_stat] The end of a free block enters another free block.");
if (p->ptr == km->loop_head) break;
}
for (p = km->core_head; p != NULL; p = p->ptr)
++s->n_cores, s->capacity += p->size * sizeof(header_t);
for (p = km->core_head; p != NULL; p = p->ptr) {
size_t size = p->size * sizeof(header_t);
++s->n_cores;
s->capacity += size;
s->largest = s->largest > size? s->largest : size;
}
}