[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-dvswxo34oaiibm06zyvrv0q5@git.kernel.org>
Date: Thu, 18 Oct 2012 10:01:47 -0700
From: tip-bot for Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
a.p.zijlstra@...llo.nl, tglx@...utronix.de
Subject: [tip:numa/core] sched/numa: Simplify task_numa_fault()
Commit-ID: f3bd8842a897685269b3fa48ad6f9d5590be67ab
Gitweb: http://git.kernel.org/tip/f3bd8842a897685269b3fa48ad6f9d5590be67ab
Author: Peter Zijlstra <a.p.zijlstra@...llo.nl>
AuthorDate: Wed, 10 Oct 2012 14:13:15 +0200
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 15 Oct 2012 12:30:16 +0200
sched/numa: Simplify task_numa_fault()
Also fix numa_scan_seq off by one.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Link: http://lkml.kernel.org/n/tip-dvswxo34oaiibm06zyvrv0q5@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
include/linux/sched.h | 11 +----------
kernel/sched/core.c | 2 +-
kernel/sched/fair.c | 9 ++++-----
3 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 99a70eb..c7f8656 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1608,16 +1608,7 @@ static inline int tsk_home_node(struct task_struct *p)
}
extern void task_numa_placement(void);
-extern void __task_numa_fault(int node);
-static inline void task_numa_fault(int node)
-{
- struct task_struct *p = current;
-
- if (likely(p->numa_faults))
- p->numa_faults[node]++;
- else
- __task_numa_fault(node);
-}
+extern void task_numa_fault(int node);
#else
static inline int tsk_home_node(struct task_struct *p)
{
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index ff4a3bd..b370f2f 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1543,7 +1543,7 @@ static void __sched_fork(struct task_struct *p)
p->node = -1;
p->node_stamp = 0ULL;
p->numa_scan_seq = p->mm ? p->mm->numa_scan_seq : 0;
- p->numa_migrate_seq = p->mm ? p->mm->numa_scan_seq : 0;
+ p->numa_migrate_seq = p->mm ? p->mm->numa_scan_seq - 1 : 0;
p->numa_faults = NULL;
#endif /* CONFIG_SCHED_NUMA */
}
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 592291b..1a32930 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -823,18 +823,17 @@ unsigned int sysctl_sched_numa_settle_count = 2;
/*
* Got a PROT_NONE fault for a page on @node.
*/
-void __task_numa_fault(int node)
+void task_numa_fault(int node)
{
struct task_struct *p = current;
- if (!p->numa_faults) {
+ if (unlikely(!p->numa_faults)) {
p->numa_faults = kzalloc(sizeof(unsigned long) * nr_node_ids,
GFP_KERNEL);
+ if (!p->numa_faults)
+ return;
}
- if (!p->numa_faults)
- return;
-
p->numa_faults[node]++;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists