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 /nest | |
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 'nest')
-rw-r--r-- | nest/a-path_test.c | 2 | ||||
-rw-r--r-- | nest/rt-table.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/nest/a-path_test.c b/nest/a-path_test.c index 2e6683f2..2533dbae 100644 --- a/nest/a-path_test.c +++ b/nest/a-path_test.c @@ -198,6 +198,7 @@ t_as_path_converting(void) #endif void resource_sys_init(void); +void io_init(void); int main(int argc, char *argv[]) @@ -207,6 +208,7 @@ main(int argc, char *argv[]) resource_init(); the_bird_lock(); birdloop_init(); + io_init(); bt_test_suite(t_as_path_match, "Testing AS path matching and some a-path utilities."); bt_test_suite(t_path_format, "Testing formating as path into byte buffer"); diff --git a/nest/rt-table.c b/nest/rt-table.c index cd0d6291..ada54396 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -1057,7 +1057,7 @@ rte_announce(rtable_private *tab, net *net, struct rte_storage *new, struct rte_ if (!rpeb) { - rpeb = alloc_page(tab->rp); + rpeb = alloc_page(); *rpeb = (struct rt_export_block) {}; add_tail(&tab->pending_exports, &rpeb->n); } @@ -2157,7 +2157,7 @@ rt_free(resource *_r) static void rt_res_dump(resource *_r) { - RT_LOCKED((rtable *) _r, r) + rtable_private *r = RT_PRIV((rtable *) _r); debug("name \"%s\", addr_type=%s, rt_count=%u, use_count=%d\n", r->name, net_label[r->addr_type], r->rt_count, r->use_count); } @@ -2484,7 +2484,7 @@ rt_export_cleanup(void *data) memset(reb, 0xbe, page_size); #endif - free_page(tab->rp, reb); + free_page(reb); if (EMPTY_LIST(tab->pending_exports)) { |