Hi,<div><br></div><div>I understand that multiple readers have to use rcu_read_lock(void) and rcu_read_unlock(void) to read data protected by rcu. However, I do not understand how the kernel distinguishes between multiple rcu protected regions. </div>
<div><br></div><div>For e.g. if a region/data is protected by a mutex or spinlock, then the code is something like:</div><div><br></div><div>int data;</div><div>mutex_t/spinlock_t lock;</div><div><br></div><div>print_data()</div>
<div>{</div><div>acquire(lock);</div><div>release(lock);</div><div>}</div><div><br></div><div>Here kernel can distinguish between different regions/data using different locks used to protect it. However, the rcu_read(un)lock() do not accept any lock as a parameter.</div>
<div>How does it manage under the hood?</div><div><br></div><div>-Thanks.</div>