From 4310ef773dfeba9dde69f905c8718897894ca4ff Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 11 Aug 2011 12:03:55 +0200 Subject: [PATCH] Remove preempt_disable from unwind hotpath. We only need to preempt_disable when we fail to find a kernel module to unwind through so we can call __module_text_address. --- runtime/unwind.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/runtime/unwind.c b/runtime/unwind.c index e31c76e6a..bd3068431 100644 --- a/runtime/unwind.c +++ b/runtime/unwind.c @@ -1329,11 +1329,12 @@ static int unwind(struct unwind_context *context, } else { - preempt_disable(); /* probably redundant */ m = _stp_kmod_sec_lookup (pc, &s); if (!m) { #ifdef STAPCONF_MODULE_TEXT_ADDRESS - struct module *ko = __module_text_address (pc); + struct module *ko; + preempt_disable(); + ko = __module_text_address (pc); if (ko) { module_name = ko->name; } else { /* Possible heuristic: we could assume we're talking @@ -1341,9 +1342,9 @@ static int unwind(struct unwind_context *context, were SYMBOL_EXPORT'd, we could call that and be more sure. */ } + preempt_enable_no_resched(); #endif } - preempt_enable_no_resched(); } if (unlikely(m == NULL)) { -- 2.43.5