]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - Documentation/RCU/Design/Requirements/Requirements.html
documentation: Record reason for rcu_head two-byte alignment
[mirror_ubuntu-zesty-kernel.git] / Documentation / RCU / Design / Requirements / Requirements.html
index ece410f40436dc4f88fdf521bf84b7191b0ff798..a4d3838130e4ef6c30ac7ece5dc56e452d5274cb 100644 (file)
@@ -2493,6 +2493,28 @@ or some future “lazy”
 variant of <tt>call_rcu()</tt> that might one day be created for
 energy-efficiency purposes.
 
+<p>
+That said, there are limits.
+RCU requires that the <tt>rcu_head</tt> structure be aligned to a
+two-byte boundary, and passing a misaligned <tt>rcu_head</tt>
+structure to one of the <tt>call_rcu()</tt> family of functions
+will result in a splat.
+It is therefore necessary to exercise caution when packing
+structures containing fields of type <tt>rcu_head</tt>.
+Why not a four-byte or even eight-byte alignment requirement?
+Because the m68k architecture provides only two-byte alignment,
+and thus acts as alignment's least common denominator.
+
+<p>
+The reason for reserving the bottom bit of pointers to
+<tt>rcu_head</tt> structures is to leave the door open to
+&ldquo;lazy&rdquo; callbacks whose invocations can safely be deferred.
+Deferring invocation could potentially have energy-efficiency
+benefits, but only if the rate of non-lazy callbacks decreases
+significantly for some important workload.
+In the meantime, reserving the bottom bit keeps this option open
+in case it one day becomes useful.
+
 <h3><a name="Performance, Scalability, Response Time, and Reliability">
 Performance, Scalability, Response Time, and Reliability</a></h3>