浏览代码

sched: micro-optimize mmdrop()

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

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar 18 年之前
父节点
当前提交
6fb43d7b50
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/linux/sched.h

+ 1 - 1
include/linux/sched.h

@@ -1514,7 +1514,7 @@ extern struct mm_struct * mm_alloc(void);
 extern void FASTCALL(__mmdrop(struct mm_struct *));
 extern void FASTCALL(__mmdrop(struct mm_struct *));
 static inline void mmdrop(struct mm_struct * mm)
 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);
 		__mmdrop(mm);
 }
 }