<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><div><div><div><div style="font-family: 'arial', 'helvetica', sans-serif; font-size: 12pt; color: #000000;" data-mce-style="font-family: 'arial', 'helvetica', sans-serif; font-size: 12pt; color: #000000;"><div>Hello Linux hackers,<br></div><br><div>I was reading some kernel code and documentation, and came to learn about the RCU mechanism.<br></div><div>I think I've more or less understood what it is and how it works, but still something puzzles me :<br></div><br><div>Why is the *_bh flavor not used pretty much everywhere ? I mean, at least where the "classic" flavor is used (not dealing with srcu or rcu_sched for now ...)<br></div><br><div>If I undestand well, rcu_read_lock_bh and friends protect us from ddos style attacks where one or more CPUs may loop executing only soft-irqs forever.<br></div><div>They do that by :<br></div><div>- disabling soft-irqs inside the read-side critical sections<br></div><div>- and consider that completing a soft-irq is a transition to quiescent state, in addition to context switching<br></div><br><div>Yet I see that rcu_read_lock is far more employed in the kernel than rcu_read_lock_bh is, the latter being apparently restricted to the net subsystem area.<br></div><br><div>What I don't get is : sure ddos attacks can be related to the net area (e.g. with someone flooding us with small packets), but why would kernel code dealing with other things be immune to such attacks ?<br></div><div>I mean : what if some code in the kernel, maybe dealing with the implementation of a particular scall (having nothing to do with the net subsystem), uses rcu_read_lock(), and then our system suffers a ddos attack, leading one of our CPUs to remain in a soft-irq loop forever ?</div><div>Wouldn't that mean that the thread performing the related synchronize_rcu() would never finish ?<br></div><div>And then we would be deadlocked by this ddos attack, although the "victim" rcu was made from a place / on a structure that has nothing to do with the network itself ?<br></div><br><div>Obviously I must be missing something otherwise *_bh would be used everywhere ....</div><div>Can you enlighten me ?<br></div><br><div>Thanks a lot !</div></div></div></div></div></div><div><br></div><div data-marker="__SIG_PRE__"><div>Vincent Ray<br data-mce-bogus="1"></div></div></div><div id="content_out_vray_kalrayinc.com"></div></body></html>