Skip to contentSkip to conversation

sched/numa: drop sysctl_numa_balancing_settle_count sysctl

PATCH Applied Wanpeng Li 3 participants 12 messages Dec 12, 2013 – Dec 18, 2013 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
author
#5 lore raw

PATCH v8 4/4 sched/numa: fix period_slot recalculation

In reply to Wanpeng Li

Changelog:
v3 -> v4:
* remove period_slot recalculation

The original code is as intended and was meant to scale the difference between the NUMA_PERIOD_THRESHOLD and local/remote ratio when adjusting the scan period. The period_slot recalculation can be dropped.

---
 kernel/sched/fair.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
kernel/sched/fair.c +0 -1
index 8a00879..e7ca79a 100644
@@ -1356,7 +1356,6 @@ static void update_task_scan_period(struct task_struct *p,
 		 * scanning faster if shared accesses dominate as it may
 		 * simply bounce migrations uselessly
 		 */
-		period_slot = DIV_ROUND_UP(diff, NUMA_PERIOD_SLOTS);
 		ratio = DIV_ROUND_UP(private * NUMA_PERIOD_SLOTS, (private + shared));
 		diff = (diff * ratio) / NUMA_PERIOD_SLOTS;
 	}
Signature · 7 lines
1.7.7.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
author
#3 lore raw

PATCH v8 3/4 sched/numa: use wrapper function task_faults_idx to calculate index in group_faults

In reply to Wanpeng Li

Use wrapper function task_faults_idx to calculate index in group_faults.

---
 kernel/sched/fair.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
kernel/sched/fair.c +2 -1
index c3f6ff9..8a00879 100644
@@ -935,7 +935,8 @@ static inline unsigned long group_faults(struct task_struct *p, int nid)
 	if (!p->numa_group)
 		return 0;
 
-	return p->numa_group->faults[2*nid] + p->numa_group->faults[2*nid+1];
+	return p->numa_group->faults[task_faults_idx(nid, 0)] +
+		p->numa_group->faults[task_faults_idx(nid, 1)];
 }
 
 /*
Signature · 1 line
1.7.7.6

Wanpeng Li

author
#0 lore raw

PATCH v8 1/4 sched/numa: drop sysctl_numa_balancing_settle_count sysctl

Changelog:
v7 -> v8:
* remove references to it in Documentation/sysctl/kernel.txt

commit 887c290e (sched/numa: Decide whether to favour task or group weights based on swap candidate relationships) drop the check against sysctl_numa_balancing_settle_count, this patch remove the sysctl.

---
 Documentation/sysctl/kernel.txt |    5 -----
 include/linux/sched/sysctl.h    |    1 -
 kernel/sched/fair.c             |    9 ---------
 kernel/sysctl.c                 |    7 -------
 4 files changed, 0 insertions(+), 22 deletions(-)
Documentation/sysctl/kernel.txt +0 -5
index 26b7ee4..6d48640 100644
@@ -428,11 +428,6 @@ rate for each task.
 numa_balancing_scan_size_mb is how many megabytes worth of pages are
 scanned for a given scan.
 
-numa_balancing_settle_count is how many scan periods must complete before
-the schedule balancer stops pushing the task towards a preferred node. This
-gives the scheduler a chance to place the task on an alternative node if the
-preferred node is overloaded.
-
 numa_balancing_migrate_deferred is how many page migrations get skipped
 unconditionally, after a page migration is skipped because a page is shared
 with other tasks. This reduces page migration overhead, and determines
include/linux/sched/sysctl.h +0 -1
index 41467f8..31e0193 100644
@@ -48,7 +48,6 @@ extern unsigned int sysctl_numa_balancing_scan_delay;
 extern unsigned int sysctl_numa_balancing_scan_period_min;
 extern unsigned int sysctl_numa_balancing_scan_period_max;
 extern unsigned int sysctl_numa_balancing_scan_size;
-extern unsigned int sysctl_numa_balancing_settle_count;
 
 #ifdef CONFIG_SCHED_DEBUG
 extern unsigned int sysctl_sched_migration_cost;
kernel/sched/fair.c +0 -9
index fd773ad..acdef27 100644
@@ -886,15 +886,6 @@ static unsigned int task_scan_max(struct task_struct *p)
 	return max(smin, smax);
 }
 
-/*
- * Once a preferred node is selected the scheduler balancer will prefer moving
- * a task to that node for sysctl_numa_balancing_settle_count number of PTE
- * scans. This will give the process the chance to accumulate more faults on
- * the preferred node but still allow the scheduler to move the task again if
- * the nodes CPUs are overloaded.
- */
-unsigned int sysctl_numa_balancing_settle_count __read_mostly = 4;
-
 static void account_numa_enqueue(struct rq *rq, struct task_struct *p)
 {
 	rq->nr_numa_running += (p->numa_preferred_nid != -1);
kernel/sysctl.c +0 -7
index 34a6047..c8da99f 100644
@@ -385,13 +385,6 @@ static struct ctl_table kern_table[] = {
 		.proc_handler	= proc_dointvec,
 	},
 	{
-		.procname       = "numa_balancing_settle_count",
-		.data           = &sysctl_numa_balancing_settle_count,
-		.maxlen         = sizeof(unsigned int),
-		.mode           = 0644,
-		.proc_handler   = proc_dointvec,
-	},
-	{
 		.procname       = "numa_balancing_migrate_deferred",
 		.data           = &sysctl_numa_balancing_migrate_deferred,
 		.maxlen         = sizeof(unsigned int),
Signature · 7 lines
1.7.7.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
author
#1 lore raw

PATCH v8 2/4 sched/numa: use wrapper function task_node to get node which task is on

Changelog:
v2 -> v3:
* tranlate cpu_to_node(task_cpu(p)) to task_node(p) in sched/debug.c

Use wrapper function task_node to get node which task is on.

---
 kernel/sched/debug.c |    2 +-
 kernel/sched/fair.c  |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
kernel/sched/debug.c +1 -1
index 5c34d18..374fe04 100644
@@ -139,7 +139,7 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
 		0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L);
 #endif
 #ifdef CONFIG_NUMA_BALANCING
-	SEQ_printf(m, " %d", cpu_to_node(task_cpu(p)));
+	SEQ_printf(m, " %d", task_node(p));
 #endif
 #ifdef CONFIG_CGROUP_SCHED
 	SEQ_printf(m, " %s", task_group_path(task_group(p)));
kernel/sched/fair.c +2 -2
index acdef27..c3f6ff9 100644
@@ -1216,7 +1216,7 @@ static int task_numa_migrate(struct task_struct *p)
 	 * elsewhere, so there is no point in (re)trying.
 	 */
 	if (unlikely(!sd)) {
-		p->numa_preferred_nid = cpu_to_node(task_cpu(p));
+		p->numa_preferred_nid = task_node(p);
 		return -EINVAL;
 	}
 
@@ -1283,7 +1283,7 @@ static void numa_migrate_preferred(struct task_struct *p)
 	p->numa_migrate_retry = jiffies + HZ;
 
 	/* Success if task is already running on preferred CPU */
-	if (cpu_to_node(task_cpu(p)) == p->numa_preferred_nid)
+	if (task_node(p) == p->numa_preferred_nid)
 		return;
 
 	/* Otherwise, try migrate to a CPU on the preferred node */
Signature · 7 lines
1.7.7.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
maintainer Applied
#7 lore raw
In reply to Wanpeng Li
Quoted 3 lines · Wanpeng Li

Changelog:
v7 -> v8:
* remove references to it in Documentation/sysctl/kernel.txt

Please do not put such bits in the changelog proper, but put them below the --- line, that way they disappear automagically.

Applied all 4, thanks!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author Acked-by Mel Gorman Reviewed-by Rik van Riel Acked-by David Rientjes
#8 lore raw

Hi Peter,

Quoted 8 lines · Peter Zijlstra
Quoted 3 lines · Wanpeng Li

Changelog:
v7 -> v8:
* remove references to it in Documentation/sysctl/kernel.txt

Please do not put such bits in the changelog proper, but put them below the --- line, that way they disappear automagically.

Do you mean something like:

commit 887c290e (sched/numa: Decide whether to favour task or group weights
based on swap candidate relationships) drop the check against sysctl_numa_balancing_settle_count, this patch remove the sysctl.

---
Changelog:
v7 -> v8:
* remove references to it in Documentation/sysctl/kernel.txt
---

Documentation/sysctl/kernel.txt |    5 -----
include/linux/sched/sysctl.h    |    1 -
kernel/sched/fair.c             |    9 ---------
kernel/sysctl.c                 |    7 -------
4 files changed, 0 insertions(+), 22 deletions(-)
Quoted 1 line

Applied all 4, thanks!

Thanks. ;-)

Regards,
Wanpeng Li

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

maintainer
#10 lore raw
In reply to a message not in the archive
Quoted 11 lines · Wanpeng Li

Do you mean something like:

commit 887c290e (sched/numa: Decide whether to favour task or group weights
based on swap candidate relationships) drop the check against sysctl_numa_balancing_settle_count, this patch remove the sysctl.

Quoted 5 lines

---
Changelog:
v7 -> v8:
* remove references to it in Documentation/sysctl/kernel.txt
---

No need to insert another --- line, just the one below the SoB,

Quoted 5 lines
Documentation/sysctl/kernel.txt |    5 -----
include/linux/sched/sysctl.h    |    1 -
kernel/sched/fair.c             |    9 ---------
kernel/sysctl.c                 |    7 -------
4 files changed, 0 insertions(+), 22 deletions(-)

Everything between --- and the patch proper (usually started with an Index line or other diff syntax thingy), including this diffstat you have, will be made to disappear.

But yes indeed. The Changelog should describe the patch as is, and the differences between this and the previous version are relevant only to the reviewer who saw the previous version too. But once we commit the patch, the previous version ceases to exist (in the commit history) and therefore such comments loose their intrinsic meaning and should go away too.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author
#11 lore raw
Quoted 30 lines · Peter Zijlstra
Quoted 11 lines · Wanpeng Li

Do you mean something like:

commit 887c290e (sched/numa: Decide whether to favour task or group weights
based on swap candidate relationships) drop the check against sysctl_numa_balancing_settle_count, this patch remove the sysctl.

Quoted 5 lines

---
Changelog:
v7 -> v8:
* remove references to it in Documentation/sysctl/kernel.txt
---

No need to insert another --- line, just the one below the SoB,

Quoted 5 lines
Documentation/sysctl/kernel.txt |    5 -----
include/linux/sched/sysctl.h    |    1 -
kernel/sched/fair.c             |    9 ---------
kernel/sysctl.c                 |    7 -------
4 files changed, 0 insertions(+), 22 deletions(-)

Everything between --- and the patch proper (usually started with an Index line or other diff syntax thingy), including this diffstat you have, will be made to disappear.

Quoted 6 lines

But yes indeed. The Changelog should describe the patch as is, and the differences between this and the previous version are relevant only to the reviewer who saw the previous version too. But once we commit the patch, the previous version ceases to exist (in the commit history) and therefore such comments loose their intrinsic meaning and should go away too.

Thanks for your great explanation. ;-)

Regards,
Wanpeng Li

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#12 lore raw

[tip:sched/core] sched/numa: Drop sysctl_numa_balancing_settle_count sysctl

In reply to Wanpeng Li
sched/numa: Drop sysctl_numa_balancing_settle_count sysctl
Commit-ID:  1bd53a7efdc988163ec4c25f656df38dbe500632
Gitweb:     http://git.kernel.org/tip/1bd53a7efdc988163ec4c25f656df38dbe500632
Author:     Wanpeng Li <[email protected]>
AuthorDate: Thu, 12 Dec 2013 15:23:23 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 17 Dec 2013 15:24:38 +0100

sched/numa: Drop sysctl_numa_balancing_settle_count sysctl

commit 887c290e (sched/numa: Decide whether to favour task or group weights based on swap candidate relationships) drop the check against sysctl_numa_balancing_settle_count, this patch remove the sysctl.

---
 Documentation/sysctl/kernel.txt | 5 -----
 include/linux/sched/sysctl.h    | 1 -
 kernel/sched/fair.c             | 9 ---------
 kernel/sysctl.c                 | 7 -------
 4 files changed, 22 deletions(-)
Documentation/sysctl/kernel.txt +0 -5
index 26b7ee4..6d48640 100644
@@ -428,11 +428,6 @@ rate for each task.
 numa_balancing_scan_size_mb is how many megabytes worth of pages are
 scanned for a given scan.
 
-numa_balancing_settle_count is how many scan periods must complete before
-the schedule balancer stops pushing the task towards a preferred node. This
-gives the scheduler a chance to place the task on an alternative node if the
-preferred node is overloaded.
-
 numa_balancing_migrate_deferred is how many page migrations get skipped
 unconditionally, after a page migration is skipped because a page is shared
 with other tasks. This reduces page migration overhead, and determines
include/linux/sched/sysctl.h +0 -1
index 41467f8..31e0193 100644
@@ -48,7 +48,6 @@ extern unsigned int sysctl_numa_balancing_scan_delay;
 extern unsigned int sysctl_numa_balancing_scan_period_min;
 extern unsigned int sysctl_numa_balancing_scan_period_max;
 extern unsigned int sysctl_numa_balancing_scan_size;
-extern unsigned int sysctl_numa_balancing_settle_count;
 
 #ifdef CONFIG_SCHED_DEBUG
 extern unsigned int sysctl_sched_migration_cost;
kernel/sched/fair.c +0 -9
index a9185f7..fcb6c17 100644
@@ -872,15 +872,6 @@ static unsigned int task_scan_max(struct task_struct *p)
 	return max(smin, smax);
 }
 
-/*
- * Once a preferred node is selected the scheduler balancer will prefer moving
- * a task to that node for sysctl_numa_balancing_settle_count number of PTE
- * scans. This will give the process the chance to accumulate more faults on
- * the preferred node but still allow the scheduler to move the task again if
- * the nodes CPUs are overloaded.
- */
-unsigned int sysctl_numa_balancing_settle_count __read_mostly = 4;
-
 static void account_numa_enqueue(struct rq *rq, struct task_struct *p)
 {
 	rq->nr_numa_running += (p->numa_preferred_nid != -1);
kernel/sysctl.c +0 -7
index 34a6047..c8da99f 100644
@@ -385,13 +385,6 @@ static struct ctl_table kern_table[] = {
 		.proc_handler	= proc_dointvec,
 	},
 	{
-		.procname       = "numa_balancing_settle_count",
-		.data           = &sysctl_numa_balancing_settle_count,
-		.maxlen         = sizeof(unsigned int),
-		.mode           = 0644,
-		.proc_handler   = proc_dointvec,
-	},
-	{
 		.procname       = "numa_balancing_migrate_deferred",
 		.data           = &sysctl_numa_balancing_migrate_deferred,
 		.maxlen         = sizeof(unsigned int),
#2 lore raw

[tip:sched/core] sched/numa: Use wrapper function task_node to get node which task is on

In reply to Wanpeng Li
sched/numa: Use wrapper function task_node to get node which task is on
Commit-ID:  de1b301a19754778ddd9f908d266ffe1c010b2cf
Gitweb:     http://git.kernel.org/tip/de1b301a19754778ddd9f908d266ffe1c010b2cf
Author:     Wanpeng Li <[email protected]>
AuthorDate: Thu, 12 Dec 2013 15:23:24 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 17 Dec 2013 15:24:39 +0100

sched/numa: Use wrapper function task_node to get node which task is on

Use wrapper function task_node to get node which task is on.

---
 kernel/sched/debug.c | 2 +-
 kernel/sched/fair.c  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
kernel/sched/debug.c +1 -1
index 5c34d18..374fe04 100644
@@ -139,7 +139,7 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
 		0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L);
 #endif
 #ifdef CONFIG_NUMA_BALANCING
-	SEQ_printf(m, " %d", cpu_to_node(task_cpu(p)));
+	SEQ_printf(m, " %d", task_node(p));
 #endif
 #ifdef CONFIG_CGROUP_SCHED
 	SEQ_printf(m, " %s", task_group_path(task_group(p)));
kernel/sched/fair.c +2 -2
index fcb6c17..ebdb08b 100644
@@ -1202,7 +1202,7 @@ static int task_numa_migrate(struct task_struct *p)
 	 * elsewhere, so there is no point in (re)trying.
 	 */
 	if (unlikely(!sd)) {
-		p->numa_preferred_nid = cpu_to_node(task_cpu(p));
+		p->numa_preferred_nid = task_node(p);
 		return -EINVAL;
 	}
 
@@ -1269,7 +1269,7 @@ static void numa_migrate_preferred(struct task_struct *p)
 	p->numa_migrate_retry = jiffies + HZ;
 
 	/* Success if task is already running on preferred CPU */
-	if (cpu_to_node(task_cpu(p)) == p->numa_preferred_nid)
+	if (task_node(p) == p->numa_preferred_nid)
 		return;
 
 	/* Otherwise, try migrate to a CPU on the preferred node */
#4 lore raw

[tip:sched/core] sched/numa: Use wrapper function task_faults_idx to calculate index in group_faults

In reply to Wanpeng Li
sched/numa: Use wrapper function task_faults_idx to calculate index in group_faults
Commit-ID:  82897b4fd3920ffd2456731d4f2ae1406558ef4c
Gitweb:     http://git.kernel.org/tip/82897b4fd3920ffd2456731d4f2ae1406558ef4c
Author:     Wanpeng Li <[email protected]>
AuthorDate: Thu, 12 Dec 2013 15:23:25 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 17 Dec 2013 15:24:40 +0100

sched/numa: Use wrapper function task_faults_idx to calculate index in group_faults

Use wrapper function task_faults_idx to calculate index in group_faults.

---
 kernel/sched/fair.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/sched/fair.c +2 -1
index ebdb08b..37892d7 100644
@@ -921,7 +921,8 @@ static inline unsigned long group_faults(struct task_struct *p, int nid)
 	if (!p->numa_group)
 		return 0;
 
-	return p->numa_group->faults[2*nid] + p->numa_group->faults[2*nid+1];
+	return p->numa_group->faults[task_faults_idx(nid, 0)] +
+		p->numa_group->faults[task_faults_idx(nid, 1)];
 }
 
 /*
#6 lore raw

[tip:sched/core] sched/numa: Fix period_slot recalculation

In reply to Wanpeng Li
sched/numa: Fix period_slot recalculation
Commit-ID:  e777b63bbd589248eb151a3191ee92331a701385
Gitweb:     http://git.kernel.org/tip/e777b63bbd589248eb151a3191ee92331a701385
Author:     Wanpeng Li <[email protected]>
AuthorDate: Thu, 12 Dec 2013 15:23:26 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 17 Dec 2013 15:24:41 +0100

sched/numa: Fix period_slot recalculation

The original code is as intended and was meant to scale the difference between the NUMA_PERIOD_THRESHOLD and local/remote ratio when adjusting the scan period. The period_slot recalculation can be dropped.

---
 kernel/sched/fair.c | 1 -
 1 file changed, 1 deletion(-)
kernel/sched/fair.c +0 -1
index 37892d7..4316af2 100644
@@ -1342,7 +1342,6 @@ static void update_task_scan_period(struct task_struct *p,
 		 * scanning faster if shared accesses dominate as it may
 		 * simply bounce migrations uselessly
 		 */
-		period_slot = DIV_ROUND_UP(diff, NUMA_PERIOD_SLOTS);
 		ratio = DIV_ROUND_UP(private * NUMA_PERIOD_SLOTS, (private + shared));
 		diff = (diff * ratio) / NUMA_PERIOD_SLOTS;
 	}