From b3bbfdfe91277d28ad72f44e87c48fc8173bbc09 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 12 Feb 2019 08:29:55 +0100 Subject: 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. --- rtemsbsd/include/machine/counter.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rtemsbsd') diff --git a/rtemsbsd/include/machine/counter.h b/rtemsbsd/include/machine/counter.h index 2e38c00c..4afc9ee9 100644 --- a/rtemsbsd/include/machine/counter.h +++ b/rtemsbsd/include/machine/counter.h @@ -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 -- cgit v1.2.3