summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-09-09 20:57:59 +0200
committerMaria Matejka <mq@ucw.cz>2022-09-18 16:33:51 +0200
commitb80823fe828a0687d4baae3c34c737d46fbf439c (patch)
tree89833602bbe291778e3de42a939efe297e9ce084 /nest
parent3d627d09d4da3bdc1712bde67ba62c9cfbfcedc9 (diff)
Memory pages allocator is now a global simple lockless structure
Diffstat (limited to 'nest')
-rw-r--r--nest/cmds.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/nest/cmds.c b/nest/cmds.c
index 092be48a..96a3ec91 100644
--- a/nest/cmds.c
+++ b/nest/cmds.c
@@ -109,7 +109,6 @@ print_size(char *dsc, struct resmem vals)
extern pool *rt_table_pool;
extern pool *rta_pool;
-extern uint *pages_kept;
void
cmd_show_memory(void)
@@ -121,8 +120,9 @@ cmd_show_memory(void)
print_size("Protocols:", rmemsize(proto_pool));
struct resmem total = rmemsize(&root_pool);
#ifdef HAVE_MMAP
- print_size("Standby memory:", (struct resmem) { .overhead = page_size * *pages_kept });
- total.overhead += page_size * *pages_kept;
+ int pages_kept = atomic_load_explicit(&pages_kept, memory_order_relaxed);
+ print_size("Standby memory:", (struct resmem) { .overhead = page_size * pages_kept });
+ total.overhead += page_size * pages_kept;
#endif
print_size("Total:", total);
cli_msg(0, "");