From: Ingo Molnar <mingo@elte.hu>
Date: Mon, 9 Jul 2007 16:52:01 +0000 (+0200)
Subject: sched: micro-optimize mmdrop()
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6fb43d7b50e49a36f8be3199141bec473e5ecb00;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git

sched: micro-optimize mmdrop()

micro-optimize mmdrop(). Improves schedule()'s assembly a bit.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 785ec8465bd3..cfb680585ab8 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1514,7 +1514,7 @@ extern struct mm_struct * mm_alloc(void);
 extern void FASTCALL(__mmdrop(struct mm_struct *));
 static inline void mmdrop(struct mm_struct * mm)
 {
-	if (atomic_dec_and_test(&mm->mm_count))
+	if (unlikely(atomic_dec_and_test(&mm->mm_count)))
 		__mmdrop(mm);
 }