0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

Table: RCU synchronization moved to lfjour

the sync is actually needed when the pages get freed, not precisely
after every item cleanup, as the data technically stays intact until the
deferred free's are called.
This commit is contained in:
Maria Matejka 2024-06-12 14:48:15 +02:00
parent bd05dd7304
commit 3ed192edc3
2 changed files with 5 additions and 10 deletions

View File

@ -359,10 +359,6 @@ lfjour_cleanup_hook(void *_j)
{ {
j->item_done(j, first); j->item_done(j, first);
#ifdef LOCAL_DEBUG
memset(first, 0xbd, j->item_size);
#endif
/* Find next journal item */ /* Find next journal item */
struct lfjour_item *next = lfjour_get_next(j, first); struct lfjour_item *next = lfjour_get_next(j, first);
if (PAGE_HEAD(next) != PAGE_HEAD(first)) if (PAGE_HEAD(next) != PAGE_HEAD(first))
@ -374,6 +370,11 @@ lfjour_cleanup_hook(void *_j)
/* Free this block */ /* Free this block */
lfjour_block_rem_node(&j->pending, block); lfjour_block_rem_node(&j->pending, block);
/* Wait for possible pending readers of the block */
synchronize_rcu();
/* Now we can finally drop the block */
#ifdef LOCAL_DEBUG #ifdef LOCAL_DEBUG
memset(block, 0xbe, page_size); memset(block, 0xbe, page_size);
#endif #endif

View File

@ -1503,9 +1503,6 @@ rt_cleanup_export_best(struct lfjour *j, struct lfjour_item *i)
/* Update the first and last pointers */ /* Update the first and last pointers */
rt_cleanup_update_pointers(&net->best, rpe); rt_cleanup_update_pointers(&net->best, rpe);
/* Wait for readers before releasing */
synchronize_rcu();
} }
static void static void
@ -1530,9 +1527,6 @@ rt_cleanup_export_all(struct lfjour *j, struct lfjour_item *i)
if (is_last) if (is_last)
tab->gc_counter++; tab->gc_counter++;
/* Wait for readers before releasing */
synchronize_rcu();
} }
static void static void