[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211222075406.57191-1-qiang1.zhang@intel.com>
Date: Wed, 22 Dec 2021 15:54:06 +0800
From: Zqiang <qiang1.zhang@...el.com>
To: paulmck@...nel.org, ryabinin.a.a@...il.com
Cc: urezki@...il.com, elver@...gle.com, jun.miao@...el.com,
linux-kernel@...r.kernel.org
Subject: [PATCH] rcu: record kasan stack before enter local_irq_save()/restore() critical area
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@...el.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
Powered by blists - more mailing lists