diff options
author | Maria Matejka <mq@ucw.cz> | 2021-11-30 23:57:14 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2021-12-01 13:00:54 +0100 |
commit | bb63e99d7877023667edaf26495dd657ec2fd57b (patch) | |
tree | 3ae919a00541c27c8f661addb56c6d4ef681d361 /sysdep/unix/io-loop.c | |
parent | 385b3ea3956aefc2868cdd838fc0a90f1d8a7857 (diff) |
Page allocator moved from pools to IO loops.
The resource pool system is highly hierarchical and keeping spare pages
in pools leads to unnecessarily complex memory management.
Loops have a flat hiearchy, at least for now, and it is therefore much
easier to keep care of pages, especially in cases of excessive virtual memory
fragmentation.
Diffstat (limited to 'sysdep/unix/io-loop.c')
-rw-r--r-- | sysdep/unix/io-loop.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sysdep/unix/io-loop.c b/sysdep/unix/io-loop.c index 769f01ba..732ea64d 100644 --- a/sysdep/unix/io-loop.c +++ b/sysdep/unix/io-loop.c @@ -32,7 +32,7 @@ * Current thread context */ -_Thread_local struct birdloop *birdloop_current; +_Thread_local struct birdloop *birdloop_current = NULL; static _Thread_local struct birdloop *birdloop_wakeup_masked; static _Thread_local uint birdloop_wakeup_masked_count; @@ -391,6 +391,8 @@ birdloop_new(pool *pp, uint order, const char *name) timers_init(&loop->time, loop->pool); sockets_init(loop); + init_pages(loop); + loop->time.coro = coro_run(loop->pool, birdloop_main, loop); birdloop_leave(loop); @@ -571,6 +573,7 @@ birdloop_main(void *arg) /* Free the pool and loop */ birdloop_enter(loop); rp_free(loop->pool, parent); + flush_pages(loop); birdloop_leave(loop); rfree(&loop->r); |