summaryrefslogtreecommitdiffstats
path: root/rtemsbsd
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-02-12 08:29:55 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-02-12 08:57:42 +0100
commitb3bbfdfe91277d28ad72f44e87c48fc8173bbc09 (patch)
tree3e65b268cf92e442187c6551f51efc92669442de /rtemsbsd
parentatomic.h: Add atomic_fetchadd_64() (diff)
downloadrtems-libbsd-b3bbfdfe91277d28ad72f44e87c48fc8173bbc09.tar.bz2
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.
Diffstat (limited to 'rtemsbsd')
-rw-r--r--rtemsbsd/include/machine/counter.h4
1 files changed, 2 insertions, 2 deletions
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