sched: micro-optimize mmdrop()
authorIngo Molnar <mingo@elte.hu>
Mon, 9 Jul 2007 16:52:01 +0000 (18:52 +0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 9 Jul 2007 16:52:01 +0000 (18:52 +0200)
micro-optimize mmdrop(). Improves schedule()'s assembly a bit.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/sched.h

index 785ec84..cfb6805 100644 (file)
@@ -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);
 }