Skip to content

Commit d818cc7

Browse files
qiangzh3paulmckrcu
authored andcommitted
kasan: Record work creation stack trace with interrupts enabled
Recording the work creation stack trace for KASAN reports in call_rcu() is expensive, due to unwinding the stack, but also due to acquiring depot_lock inside stackdepot (which may be contended). Because calling kasan_record_aux_stack_noalloc() does not require interrupts to already be disabled, this may unnecessarily extend the time with interrupts disabled. Therefore, move calling kasan_record_aux_stack() before the section with interrupts disabled. Acked-by: Marco Elver <elver@google.com> Signed-off-by: Zqiang <qiang1.zhang@intel.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 1fe09eb commit d818cc7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/rcu/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3060,8 +3060,8 @@ void call_rcu(struct rcu_head *head, rcu_callback_t func)
30603060
}
30613061
head->func = func;
30623062
head->next = NULL;
3063-
local_irq_save(flags);
30643063
kasan_record_aux_stack_noalloc(head);
3064+
local_irq_save(flags);
30653065
rdp = this_cpu_ptr(&rcu_data);
30663066

30673067
/* Add the callback to our list. */

0 commit comments

Comments
 (0)