[PATCH 01/40] mm: add unlikely to the mm allocation failure check

From: Andrea Arcangeli
Date: Thu Jun 28 2012 - 09:01:35 EST


Very minor optimization to hint gcc.

Signed-off-by: Andrea Arcangeli <aarcange@xxxxxxxxxx>
---
kernel/fork.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index ab5211b..5fcfa70 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -572,7 +572,7 @@ struct mm_struct *mm_alloc(void)
struct mm_struct *mm;

mm = allocate_mm();
- if (!mm)
+ if (unlikely(!mm))
return NULL;

memset(mm, 0, sizeof(*mm));
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/