Skip to contentSkip to conversation

make sysctl_overcommit_memory enumeration sensible

PATCH In review Coywolf Qi Hunt 5 participants 11 messages Feb 15, 2006 – Feb 16, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make sysctl_overcommit_memory enumeration sensible

I see system admins often confused when they sysctl vm.overcommit_memory. This patch makes overcommit_memory enumeration sensible.

0 - no overcommit
1 - always overcommit
2 - heuristic overcommit (default)

I don't feel this would break any userspace scripts. If it seems OK, I'll update the documents.

---

include/linux/mman.h +2 -2
index 18a5689..e50f5ad 100644
@@ -10,9 +10,9 @@
 #define MREMAP_MAYMOVE	1
 #define MREMAP_FIXED	2
 
-#define OVERCOMMIT_GUESS		0
+#define OVERCOMMIT_NEVER		0
 #define OVERCOMMIT_ALWAYS		1
-#define OVERCOMMIT_NEVER		2
+#define OVERCOMMIT_GUESS		2
 extern int sysctl_overcommit_memory;
 extern int sysctl_overcommit_ratio;
 extern atomic_t vm_committed_space;
Signature · 1 line
Coywolf Qi Hunt
#1 lore raw
Quoted 9 lines · Coywolf Qi Hunt

I see system admins often confused when they sysctl vm.overcommit_memory. This patch makes overcommit_memory enumeration sensible.

0 - no overcommit
1 - always overcommit
2 - heuristic overcommit (default)

I don't feel this would break any userspace scripts.

eh? If any such scripts exist, they'll break.

Confused.

#2 lore raw
Quoted 9 lines · Andrew Morton
Quoted 8 lines · Coywolf Qi Hunt

I see system admins often confused when they sysctl vm.overcommit_memory. This patch makes overcommit_memory enumeration sensible.

0 - no overcommit
1 - always overcommit
2 - heuristic overcommit (default)

Quoted 6 lines
Quoted 1 line

I don't feel this would break any userspace scripts.

eh? If any such scripts exist, they'll break.

Confused.

That's a corner case. Let'em break and fix. Otherwise, users will be confused. Even they get it right, after some weeks they'll have to re-read the doc. A logical user interface is important to human.

Signature · 1 line
Coywolf Qi Hunt
#3 lore raw
Quoted 18 lines · Coywolf Qi Hunt
Quoted 15 lines · Andrew Morton
Quoted 10 lines · Coywolf Qi Hunt

I see system admins often confused when they sysctl vm.overcommit_memory. This patch makes overcommit_memory enumeration sensible.

0 - no overcommit
1 - always overcommit
2 - heuristic overcommit (default)

I don't feel this would break any userspace scripts.

eh? If any such scripts exist, they'll break.

Quoted 9 lines
Quoted 3 lines

Confused.

That's a corner case. Let'em break and fix. Otherwise, users will be confused. Even they get it right, after some weeks they'll have to re-read the doc. A logical user interface is important to human.

If I have

vm.overcommit_memory = 2

in my /etc/sysctl.conf, its meaning silently changes. I'll know about it during the next oomkiller pass.

Signature · 1 line
error compiling committee.c: too many arguments to function
#4 lore raw
Quoted 31 lines · Avi Kivity
Quoted 19 lines · Coywolf Qi Hunt
Quoted 16 lines · Andrew Morton
Quoted 11 lines · Coywolf Qi Hunt

I see system admins often confused when they sysctl vm.overcommit_memory.
This patch makes overcommit_memory enumeration sensible.

0 - no overcommit
1 - always overcommit
2 - heuristic overcommit (default)

I don't feel this would break any userspace scripts.

eh? If any such scripts exist, they'll break.

Quoted 9 lines
Quoted 3 lines

Confused.

That's a corner case. Let'em break and fix. Otherwise, users will be confused. Even they get it right, after some weeks they'll have to re-read the doc. A logical user interface is important to human.

Quoted 6 lines

If I have

vm.overcommit_memory = 2

in my /etc/sysctl.conf, its meaning silently changes. I'll know about it during the next oomkiller pass.

Indeed. See, the breakage doesn't hurt.

Signature · 1 line
Coywolf Qi Hunt
#5 lore raw
Quoted 7 lines · Coywolf Qi Hunt
Quoted 3 lines

in my /etc/sysctl.conf, its meaning silently changes. I'll know about it during the next oomkiller pass.

Indeed. See, the breakage doesn't hurt.

I guess we have different definitions for 'hurt' in our dictionaries.

Signature · 1 line
error compiling committee.c: too many arguments to function
#6 lore raw
Quoted 8 lines · Avi Kivity
Quoted 6 lines · Coywolf Qi Hunt
Quoted 4 lines

in my /etc/sysctl.conf, its meaning silently changes. I'll know about it during the next oomkiller pass.

Indeed. See, the breakage doesn't hurt.

Indeed. See, the breakage doesn't hurt (much).

Quoted 8 lines
Quoted 2 lines

I guess we have different definitions for 'hurt' in our dictionaries.

Signature · 1 line
error compiling committee.c: too many arguments to function
Signature · 1 line
Coywolf Qi Hunt
#7 lore raw
In reply to Coywolf Qi Hunt
Quoted 3 lines · Coywolf Qi Hunt

I see system admins often confused when they sysctl vm.overcommit_memory. This patch makes overcommit_memory enumeration sensible.

What's the point? The current has been there for a long time, and is well documented.

Quoted 5 lines

0 - no overcommit
1 - always overcommit
2 - heuristic overcommit (default)

I don't feel this would break any userspace scripts.

You mean, except for the ones that go echo 0 > /proc/sys/vm/overcommit_memory; or echo 2 > /proc/sys/vm/overcommit_memory ?

And those sysctl configuration files that get set at bootup?

Quoted 22 lines

If it seems OK, I'll
update the documents.

---

include/linux/mman.h +2 -2
index 18a5689..e50f5ad 100644
@@ -10,9 +10,9 @@
 #define MREMAP_MAYMOVE	1
 #define MREMAP_FIXED	2
 
-#define OVERCOMMIT_GUESS		0
+#define OVERCOMMIT_NEVER		0
 #define OVERCOMMIT_ALWAYS		1
-#define OVERCOMMIT_NEVER		2
+#define OVERCOMMIT_GUESS		2
 extern int sysctl_overcommit_memory;
 extern int sysctl_overcommit_ratio;
 extern atomic_t vm_committed_space;
Signature · 2 lines
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 
#8 lore raw
Quoted 2 lines

What's the point? The current has been there for a long time, and is well documented.

right - low-pointage user-space break. it _would_ make a small amount of sense to use a string (never/guess/always works for me), but the existing meanings (2/0/1 respectively) would need to be provided through a major release cycle then generate an error if used...

regards, mark hahn.

#9 lore raw
In reply to Nick Piggin
Quoted 7 lines · Nick Piggin
Quoted 3 lines · Coywolf Qi Hunt

I see system admins often confused when they sysctl vm.overcommit_memory. This patch makes overcommit_memory enumeration sensible.

What's the point? The current has been there for a long time, and is well documented.

Yes, the current is well documented and for a long time. But the design is insane, no matter how well and how long it is documented. Users have to read the document for *many times*.

The new way is logical so it would let us "read once, remember always".

Coywolf

Quoted 41 lines
Quoted 6 lines

0 - no overcommit
1 - always overcommit
2 - heuristic overcommit (default)

I don't feel this would break any userspace scripts.

You mean, except for the ones that go `echo 0 >
/proc/sys/vm/overcommit_memory`;
or echo 2 > /proc/sys/vm/overcommit_memory ?

And those sysctl configuration files that get set at bootup?

Quoted 22 lines

If it seems OK, I'll
update the documents.

---

include/linux/mman.h +2 -2
index 18a5689..e50f5ad 100644
@@ -10,9 +10,9 @@
 #define MREMAP_MAYMOVE	1
 #define MREMAP_FIXED	2
 
-#define OVERCOMMIT_GUESS		0
+#define OVERCOMMIT_NEVER		0
 #define OVERCOMMIT_ALWAYS		1
-#define OVERCOMMIT_NEVER		2
+#define OVERCOMMIT_GUESS		2
 extern int sysctl_overcommit_memory;
 extern int sysctl_overcommit_ratio;
 extern atomic_t vm_committed_space;
Signature · 2 lines
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 
Signature · 1 line
Coywolf Qi Hunt
#10 lore raw
Quoted 12 lines · Coywolf Qi Hunt
Quoted 8 lines · Nick Piggin
Quoted 3 lines · Coywolf Qi Hunt

I see system admins often confused when they sysctl vm.overcommit_memory. This patch makes overcommit_memory enumeration sensible.

What's the point? The current has been there for a long time, and is well documented.

Quoted 7 lines

Yes, the current is well documented and for a long time. But the design is insane, no matter how well and how long it is documented. Users have to read the document for *many times*.

The new way is logical so it would let us "read once, remember always".

That's just not how it's done, full stop.

If it was really a big problem, you'd add a new sysctl with the new behaviour, put a warning printk in the kernel that says the old one is deprecated, wait for a year or so, then remove the old one.

But I suspect it simply doesn't matter that much in this case.

Signature · 2 lines
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com