Welcome! Log In Create A New Profile

Advanced

why does `synchronize_rcu()` not deadlock when beening called inside a read lock block?

Posted by 915086731 
synchronize_rcu() is used to waits only for ongoing RCU read-side critical sections to complete. If so, it should been blocked forever when beening called inside a read block. However, the following code works well on my linux kernel, why?

void port_range_clean( void ) 
{
    struct port_range *p;

    rcu_read_lock();
redo:
    list_for_each_entry_rcu(p, &port_rt->ports, list) {
        list_del_rcu(&p->list);
        synchronize_rcu();
        rcu_read_unlock();
        kfree(p);
        goto redo;
    }
}



Edited 2 time(s). Last edit at 08/18/2018 03:51AM by 915086731.
Author:

Your Email:


Subject:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 3 plus 5?
Message: