mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-03 07:31:54 +00:00
fixup! Forbid locking altogether when RCU reader is active
This commit is contained in:
parent
8424941f95
commit
e96c44e32d
@ -215,6 +215,14 @@ alloc_page(void)
|
|||||||
/* Reinstate the stack with zero */
|
/* Reinstate the stack with zero */
|
||||||
PAGE_STACK_PUT(NULL);
|
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. */
|
/* If there is any free page kept cold, we use that. */
|
||||||
LOCK_DOMAIN(resource, empty_pages_domain);
|
LOCK_DOMAIN(resource, empty_pages_domain);
|
||||||
if (empty_pages) {
|
if (empty_pages) {
|
||||||
@ -244,6 +252,8 @@ alloc_page(void)
|
|||||||
if (fp)
|
if (fp)
|
||||||
return fp;
|
return fp;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* And in the worst case, allocate some new pages by mmap() */
|
/* And in the worst case, allocate some new pages by mmap() */
|
||||||
void *ptr = alloc_sys_page();
|
void *ptr = alloc_sys_page();
|
||||||
ajlog(ptr, NULL, 0, AJT_ALLOC_MMAP);
|
ajlog(ptr, NULL, 0, AJT_ALLOC_MMAP);
|
||||||
|
Loading…
Reference in New Issue
Block a user