Преглед изворни кода

rcu: add DEBUG_OBJECTS_RCU_HEAD check for alignment

Verify that rcu_head structures are aligned to a four-byte boundary.
This check is enabled by CONFIG_DEBUG_OBJECTS_RCU_HEAD.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Paul E. McKenney пре 14 година
родитељ
комит
b0c9d7ff27
1 измењених фајлова са 1 додато и 0 уклоњено
  1. 1 0
      include/linux/rcupdate.h

+ 1 - 0
include/linux/rcupdate.h

@@ -785,6 +785,7 @@ extern struct debug_obj_descr rcuhead_debug_descr;
 
 
 static inline void debug_rcu_head_queue(struct rcu_head *head)
 static inline void debug_rcu_head_queue(struct rcu_head *head)
 {
 {
+	WARN_ON_ONCE((unsigned long)head & 0x3);
 	debug_object_activate(head, &rcuhead_debug_descr);
 	debug_object_activate(head, &rcuhead_debug_descr);
 	debug_object_active_state(head, &rcuhead_debug_descr,
 	debug_object_active_state(head, &rcuhead_debug_descr,
 				  STATE_RCU_HEAD_READY,
 				  STATE_RCU_HEAD_READY,