0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-10-18 09:58:43 +00:00

fixup! Forbid locking altogether when RCU reader is active

This commit is contained in:
Maria Matejka 2024-06-27 09:08:01 +02:00
parent 8424941f95
commit e96c44e32d

View File

@ -215,6 +215,14 @@ alloc_page(void)
/* Reinstate the stack with zero */
PAGE_STACK_PUT(NULL);
if (rcu_read_active())
{
/* We can't lock and we actually shouldn't alloc either when rcu is active
* but that's a quest for another day. */
}
else
{
/* If there is any free page kept cold, we use that. */
LOCK_DOMAIN(resource, empty_pages_domain);
if (empty_pages) {
@ -244,6 +252,8 @@ alloc_page(void)
if (fp)
return fp;
}
/* And in the worst case, allocate some new pages by mmap() */
void *ptr = alloc_sys_page();
ajlog(ptr, NULL, 0, AJT_ALLOC_MMAP);