From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by kanga.kvack.org (Postfix) with ESMTP id D8E486B003D for ; Tue, 10 Dec 2013 19:50:27 -0500 (EST) Received: by mail-pd0-f173.google.com with SMTP id p10so8445854pdj.32 for ; Tue, 10 Dec 2013 16:50:27 -0800 (PST) Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com. [202.81.31.148]) by mx.google.com with ESMTPS id pj7si11848008pbc.249.2013.12.10.16.50.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 10 Dec 2013 16:50:26 -0800 (PST) Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 11 Dec 2013 10:50:23 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 6A7583578050 for ; Wed, 11 Dec 2013 11:50:20 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rBB0o7t04456800 for ; Wed, 11 Dec 2013 11:50:07 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rBB0oJMV022888 for ; Wed, 11 Dec 2013 11:50:20 +1100 From: Wanpeng Li Subject: [PATCH v5 8/8] sched/numa: drop unnecessary variable in task_weight Date: Wed, 11 Dec 2013 08:50:01 +0800 Message-Id: <1386723001-25408-9-git-send-email-liwanp@linux.vnet.ibm.com> In-Reply-To: <1386723001-25408-1-git-send-email-liwanp@linux.vnet.ibm.com> References: <1386723001-25408-1-git-send-email-liwanp@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Ingo Molnar , Rik van Riel , Mel Gorman , Peter Zijlstra , Naoya Horiguchi , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Wanpeng Li Drop unnecessary total_faults variable in function task_weight to unify task_weight and group_weight. Reviewed-by: Naoya Horiguchi Signed-off-by: Wanpeng Li --- kernel/sched/fair.c | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f507e12..5c54837 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -947,17 +947,10 @@ static inline unsigned long group_faults(struct task_struct *p, int nid) */ static inline unsigned long task_weight(struct task_struct *p, int nid) { - unsigned long total_faults; - - if (!p->numa_faults) - return 0; - - total_faults = p->total_numa_faults; - - if (!total_faults) + if (!p->numa_faults || !p->total_numa_faults) return 0; - return 1000 * task_faults(p, nid) / total_faults; + return 1000 * task_faults(p, nid) / p->total_numa_faults; } static inline unsigned long group_weight(struct task_struct *p, int nid) -- 1.7.7.6 -- 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