From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753245Ab2F1NBm (ORCPT ); Thu, 28 Jun 2012 09:01:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57678 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755877Ab2F1M6k (ORCPT ); Thu, 28 Jun 2012 08:58:40 -0400 From: Andrea Arcangeli To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Hillf Danton , Dan Smith , Peter Zijlstra , Linus Torvalds , Andrew Morton , Thomas Gleixner , Ingo Molnar , Paul Turner , Suresh Siddha , Mike Galbraith , "Paul E. McKenney" , Lai Jiangshan , Bharata B Rao , Lee Schermerhorn , Rik van Riel , Johannes Weiner , Srivatsa Vaddagiri , Christoph Lameter , Alex Shi , Mauricio Faria de Oliveira , Konrad Rzeszutek Wilk , Don Morris , Benjamin Herrenschmidt Subject: [PATCH 01/40] mm: add unlikely to the mm allocation failure check Date: Thu, 28 Jun 2012 14:55:41 +0200 Message-Id: <1340888180-15355-2-git-send-email-aarcange@redhat.com> In-Reply-To: <1340888180-15355-1-git-send-email-aarcange@redhat.com> References: <1340888180-15355-1-git-send-email-aarcange@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Very minor optimization to hint gcc. Signed-off-by: Andrea Arcangeli --- 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)); From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx125.postini.com [74.125.245.125]) by kanga.kvack.org (Postfix) with SMTP id D64726B0092 for ; Thu, 28 Jun 2012 08:57:06 -0400 (EDT) From: Andrea Arcangeli Subject: [PATCH 01/40] mm: add unlikely to the mm allocation failure check Date: Thu, 28 Jun 2012 14:55:41 +0200 Message-Id: <1340888180-15355-2-git-send-email-aarcange@redhat.com> In-Reply-To: <1340888180-15355-1-git-send-email-aarcange@redhat.com> References: <1340888180-15355-1-git-send-email-aarcange@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Hillf Danton , Dan Smith , Peter Zijlstra , Linus Torvalds , Andrew Morton , Thomas Gleixner , Ingo Molnar , Paul Turner , Suresh Siddha , Mike Galbraith , "Paul E. McKenney" , Lai Jiangshan , Bharata B Rao , Lee Schermerhorn , Rik van Riel , Johannes Weiner , Srivatsa Vaddagiri , Christoph Lameter , Alex Shi , Mauricio Faria de Oliveira , Konrad Rzeszutek Wilk , Don Morris , Benjamin Herrenschmidt Very minor optimization to hint gcc. Signed-off-by: Andrea Arcangeli --- 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, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org