Skip to contentSkip to conversation

numa-balancing: fix confusion in /proc/sys/kernel/numa_balancing

PATCH In review Xishi Qiu 2 participants 3 messages Sep 14, 2015 – Sep 15, 2015

Subsystems (2)
lore
Share & tools
lore

Xishi Qiu

author
#0 lore raw

PATCH 1/1 numa-balancing: fix confusion in /proc/sys/kernel/numa_balancing

We can only echo 0 or 1 > "/proc/sys/kernel/numa_balancing", usually 1 means enable and 0 means disable. But when echo 1, it shows the value is 65536, this is confusion.

---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/core.c +1 -1
index 3595403..e97a348 100644
@@ -2135,7 +2135,7 @@ int sysctl_numa_balancing(struct ctl_table *table, int write,
 {
 	struct ctl_table t;
 	int err;
-	int state = numabalancing_enabled;
+	int state = !!numabalancing_enabled;
 
 	if (write && !capable(CAP_SYS_ADMIN))
 		return -EPERM;
Signature · 1 line
2.0.0
#1 lore raw
Quoted 14 lines · Xishi Qiu

We can only echo 0 or 1 > "/proc/sys/kernel/numa_balancing", usually 1 means enable and 0 means disable. But when echo 1, it shows the value is 65536, this is confusion.

---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/core.c +0 -0
index 3595403..e97a348 100644

kernel/sched/core.c int sysctl_numa_balancing(struct ctl_table *table, int write, · line 2141

Quoted 8 lines
kernel/sched/core.c +1 -1
@@ -2135,7 +2135,7 @@ int sysctl_numa_balancing(struct ctl_table *table, int write,
 {
 	struct ctl_table t;
 	int err;
-	int state = numabalancing_enabled;
+	int state = !!numabalancing_enabled;
 
 	if (write && !capable(CAP_SYS_ADMIN))
 		return -EPERM;

So in the latest scheduler tree this variable got renamed, please adjust your patch:

git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core

Thanks,

Ingo

--
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
#2 lore raw
Quoted 23 lines · Ingo Molnar
Quoted 20 lines · Xishi Qiu

We can only echo 0 or 1 > "/proc/sys/kernel/numa_balancing", usually 1 means enable and 0 means disable. But when echo 1, it shows the value is 65536, this is confusion.

---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/core.c +1 -1
index 3595403..e97a348 100644
@@ -2135,7 +2135,7 @@ int sysctl_numa_balancing(struct ctl_table *table, int write,
 {
 	struct ctl_table t;
 	int err;
-	int state = numabalancing_enabled;
+	int state = !!numabalancing_enabled;
 
Quoted 8 lines

kernel/sched/core.c int sysctl_numa_balancing(struct ctl_table *table, int write, · line 2141

Quoted 2 lines
kernel/sched/core.c +0 -0
 	if (write && !capable(CAP_SYS_ADMIN))
 		return -EPERM;

So in the latest scheduler tree this variable got renamed, please adjust your patch:

git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core

Hi Ingo,

I tested the latest kernel in the above tree, it seems that the problem has been fixed. So please drop this patch.

Thanks,
Xishi Qiu

Quoted 6 lines

Thanks,

Ingo