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

安稳与你 提交于 2020-01-06 09:06:42

问题


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;

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

来源:https://stackoverflow.com/questions/51906424/why-does-synchronize-rcu-not-deadlock-when-beening-called-inside-a-read-lock

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!