summaryrefslogtreecommitdiff
path: root/sysdep
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-09-20 14:57:43 +0200
committerMaria Matejka <mq@ucw.cz>2022-09-20 14:57:43 +0200
commit28d4ac6c97fd8021083a523fc713fc6d9322f181 (patch)
tree5f332b4a80df8378b8b29a6e2980e68b456a11db /sysdep
parenta00e0b5930b6f1e56eed65cb5250aa9120a6f506 (diff)
Fixed display of standby memory
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/unix/alloc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sysdep/unix/alloc.c b/sysdep/unix/alloc.c
index 47cd4624..1559fe97 100644
--- a/sysdep/unix/alloc.c
+++ b/sysdep/unix/alloc.c
@@ -93,9 +93,7 @@ alloc_page(void)
if (!fp)
return alloc_sys_page();
- if (atomic_fetch_sub_explicit(&pages_kept, 1, memory_order_relaxed) <= KEEP_PAGES_MIN)
- SCHEDULE_CLEANUP;
-
+ atomic_fetch_sub_explicit(&pages_kept, 1, memory_order_relaxed);
return fp;
#endif
}
@@ -146,15 +144,15 @@ page_cleanup(void *_ UNUSED)
else
free_page(f);
}
- while (stack && (atomic_fetch_sub_explicit(&pages_kept, 1, memory_order_relaxed) >= KEEP_PAGES_MAX / 2));
+ while ((atomic_fetch_sub_explicit(&pages_kept, 1, memory_order_relaxed) >= KEEP_PAGES_MAX / 2) && stack);
while (stack)
{
- atomic_fetch_sub_explicit(&pages_kept, 1, memory_order_relaxed);
-
struct free_page *f = stack;
stack = atomic_load_explicit(&f->next, memory_order_acquire);
free_page(f);
+
+ atomic_fetch_sub_explicit(&pages_kept, 1, memory_order_relaxed);
}
}
#endif