Skip to contentSkip to conversation

sched/numa/mm: Fix and further simplify fault accounting

tip:numa/core tip-bot for Peter Zijlstra 1 participant 1 message Oct 18, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw
Commit-ID:  617fe041711635713ec52ed5f36d6f46f38d83f2
Gitweb:     http://git.kernel.org/tip/617fe041711635713ec52ed5f36d6f46f38d83f2
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Sun, 14 Oct 2012 21:30:07 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 15 Oct 2012 14:21:13 +0200

sched/numa/mm: Fix and further simplify fault accounting

The THP alloc failure path did double accounting .. fix this.

While we're at it, merge task_numa_placement() into task_numa_fault() so that there's only a single call from the fault path.

---
 include/linux/sched.h |    5 -----
 kernel/sched/fair.c   |   43 +++++++++++++++++++++----------------------
 mm/huge_memory.c      |    4 ----
 3 files changed, 21 insertions(+), 31 deletions(-)
include/linux/sched.h +0 -5
index 2c3009b..c86db44 100644
@@ -1608,7 +1608,6 @@ static inline int tsk_home_node(struct task_struct *p)
 	return p->node;
 }
 
-extern void task_numa_placement(void);
 extern void task_numa_fault(int node, int pages);
 #else
 static inline int tsk_home_node(struct task_struct *p)
@@ -1616,10 +1615,6 @@ static inline int tsk_home_node(struct task_struct *p)
 	return -1;
 }
 
-static inline void task_numa_placement(void)
-{
-}
-
 static inline void task_numa_fault(int node, int pages)
 {
 }
kernel/sched/fair.c +21 -22

63 lines not on this page · raw message

mm/huge_memory.c +0 -4
index 2b65116..5afd0d7 100644
@@ -800,7 +800,6 @@ fixup:
 unlock:
 	spin_unlock(&mm->page_table_lock);
 	if (page) {
-		task_numa_placement();
 		task_numa_fault(page_to_nid(page), HPAGE_PMD_NR);
 		put_page(page);
 	}
@@ -823,8 +822,6 @@ migrate:
 	}
 	spin_unlock(&mm->page_table_lock);
 
-	task_numa_placement();
-
 	new_page = alloc_pages_node(node,
 	    (GFP_TRANSHUGE | GFP_THISNODE) & ~(__GFP_NO_KSWAPD | __GFP_WAIT),
 	    HPAGE_PMD_ORDER);
@@ -895,7 +892,6 @@ alloc_fail:
 	if (new_page)
 		put_page(new_page);
 
-	task_numa_fault(page_to_nid(page), HPAGE_PMD_NR);
 	unlock_page(page);
 
 	spin_lock(&mm->page_table_lock);