ZONE(9): Fix UMA_PCPU_ALLOC_SIZE

Using CACHE_LINE_SIZE for UMA_PCPU_ALLOC_SIZE was a huge memory waste
since the backend memory allocator is page based.
This commit is contained in:
Sebastian Huber
2019-02-12 08:29:55 +01:00
parent 1c3a92d81e
commit b3bbfdfe91
2 changed files with 7 additions and 9 deletions

View File

@@ -42,7 +42,7 @@ static inline uint64_t
counter_u64_read_one(uint64_t *p, int cpu)
{
return (*((uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)));
return (*((uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE * cpu)));
}
static inline uint64_t
@@ -65,7 +65,7 @@ counter_u64_zero_inline(counter_u64_t c)
uint32_t cpu;
for (cpu = 0; cpu < _SMP_Get_processor_count(); ++cpu) {
*((uint64_t *)((char *)c + sizeof(struct pcpu) * cpu)) = 0;
*((uint64_t *)((char *)c + UMA_PCPU_ALLOC_SIZE * cpu)) = 0;
}
}
#endif