lkml.org 
[lkml]   [2021]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] rcu: record kasan stack before enter local_irq_save()/restore() critical area
Date
The kasan_record_aux_stack_noalloc() only record stack, it doesn't need
to be called in local_irq_save()/restore() critical area, and the global
spinlock (depot_lock) will be acquired in this function, When enable
kasan stack, locking contention may increase the time in the critical area.

Signed-off-by: Zqiang <qiang1.zhang@intel.com>
---
kernel/rcu/tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 347dae1876a6..5198e44cb124 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3030,8 +3030,8 @@ __call_rcu(struct rcu_head *head, rcu_callback_t func)
}
head->func = func;
head->next = NULL;
- local_irq_save(flags);
kasan_record_aux_stack_noalloc(head);
+ local_irq_save(flags);
rdp = this_cpu_ptr(&rcu_data);

/* Add the callback to our list. */
--
2.25.1
\
 
 \ /
  Last update: 2021-12-22 08:54    [W:0.151 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site