[PATCH] Removed unnecessary use of local variable in v3.12.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch remove use of temporary variable 'ip' which optimizes the code and results in
reduction of assembly instructions and hence improves latency.

Benefit of 18 lines of assembly instructions is observed on e6500 core.

Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@xxxxxxxxxxxxx>
---
 kernel/sched/core.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 8749d20..cdf43f8 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2296,13 +2296,16 @@ void __kprobes add_preempt_count(int val)
 	DEBUG_LOCKS_WARN_ON((preempt_count() & PREEMPT_MASK) >=
 				PREEMPT_MASK - 10);
 #endif
-	if (preempt_count() == val) {
-		unsigned long ip = get_parent_ip(CALLER_ADDR1);
+
+	if (preempt_count() == val)
 #ifdef CONFIG_DEBUG_PREEMPT
-		current->preempt_disable_ip = ip;
+		trace_preempt_off(CALLER_ADDR0,
+			current->preempt_disable_ip =
+			get_parent_ip(CALLER_ADDR1));
+#else
+		trace_preempt_off(CALLER_ADDR0, get_parent_ip(CALLER_ADDR1));
 #endif
-		trace_preempt_off(CALLER_ADDR0, ip);
-	}
+
 }
 EXPORT_SYMBOL(add_preempt_count);
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux