]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - kernel/rcu/srcu.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
[mirror_ubuntu-artful-kernel.git] / kernel / rcu / srcu.c
index ef3bcfb15b39ec4815275077d3e79825db740a27..584d8a983883584dfa87ff0e36cf01465506c199 100644 (file)
@@ -22,7 +22,7 @@
  *        Lai Jiangshan <laijs@cn.fujitsu.com>
  *
  * For detailed explanation of Read-Copy Update mechanism see -
- *             Documentation/RCU/ *.txt
+ *             Documentation/RCU/ *.txt
  *
  */
 
@@ -243,8 +243,14 @@ static bool srcu_readers_active(struct srcu_struct *sp)
  * cleanup_srcu_struct - deconstruct a sleep-RCU structure
  * @sp: structure to clean up.
  *
- * Must invoke this after you are finished using a given srcu_struct that
- * was initialized via init_srcu_struct(), else you leak memory.
+ * Must invoke this only after you are finished using a given srcu_struct
+ * that was initialized via init_srcu_struct().  This code does some
+ * probabalistic checking, spotting late uses of srcu_read_lock(),
+ * synchronize_srcu(), synchronize_srcu_expedited(), and call_srcu().
+ * If any such late uses are detected, the per-CPU memory associated with
+ * the srcu_struct is simply leaked and WARN_ON() is invoked.  If the
+ * caller frees the srcu_struct itself, a use-after-free crash will likely
+ * ensue, but at least there will be a warning printed.
  */
 void cleanup_srcu_struct(struct srcu_struct *sp)
 {