lkml.org 
[lkml]   [2012]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 19/39] mm: add unlikely to the mm allocation failure check
Date
Very minor optimization to hint gcc.

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

diff --git a/kernel/fork.c b/kernel/fork.c
index aefe24f..31b2f35 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -547,7 +547,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));

\
 
 \ /
  Last update: 2012-03-26 20:15    [W:0.146 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site