From 0827797e6e0a202314e59482766761a5cfb68137 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Mon, 10 Jun 2024 11:35:07 +0200 Subject: [PATCH] Table: pruning is deferred by task time, not by item count --- nest/rt-table.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/nest/rt-table.c b/nest/rt-table.c index a72964a3b..7fb6663c8 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -3312,7 +3312,6 @@ rt_prune_table(void *_tab) { RT_LOCK((rtable *) _tab, tab); - int limit = 2000; struct rt_import_hook *ih; node *n, *x; @@ -3352,21 +3351,15 @@ rt_prune_table(void *_tab) for (; tab->prune_index < bs; tab->prune_index++) { net *n = &routes[tab->prune_index]; - while ((limit > 0) && rt_prune_net(tab, n)) - limit--; - - if (limit <= 0) - { - ev_send_loop(tab->loop, tab->prune_event); - return; - } + while (rt_prune_net(tab, n)) + MAYBE_DEFER_TASK(birdloop_event_list(tab->loop), tab->prune_event, + "%s pruning", tab->name); struct rte_storage *e = NET_BEST_ROUTE(tab, n); if (tab->trie_new && e) { const net_addr *a = e->rte.net; trie_add_prefix(tab->trie_new, a, a->pxlen, a->pxlen); - limit--; } } -- 2.47.2