Skip to contentSkip to conversation

OOM changes in Linux 3.7 lead to udev warnings and total breakage of KDE 3.5.10/TDE

PATCH New Artem S. Tashkinov 3 participants 6 messages Nov 12, 2012 – Nov 13, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hello,

If I remember correctly kernel developers promised not to break user APIs in the Linux kernel however in Linux 3.7 a /proc/<PID>/oom_adj file has been totally removed which makes KDE 3.5.x (and I suppose TDE) unusable as they depend on this file and simply refuse to start in its absence.

Also, udev in CentOS/RHEL/Scientific and other old Linux'es depend on this file (which is not critical but not pleasant anyway).

I'm not a hacker/programmer to edit and recompile udev/KDE/TDE sources so I'd be glad if this file was restored.

If the interface behind this file was totally removed and there's no way you can bring it back, can I politely ask to export a dummy oom_adj file which allows the same mode of access yet the kernel does nothing in return.

--
Thank you,

Artem

#1 lore raw
Quoted 6 lines · Artem S. Tashkinov

Hello,

If I remember correctly kernel developers promised not to break user APIs in the Linux kernel however in Linux 3.7 a /proc/<PID>/oom_adj file has been totally removed which makes KDE 3.5.x (and I suppose TDE) unusable as they depend on this file and simply refuse to start in its absence.

This is
http://mail.kde.org/pipermail/unassigned-bugs/2010-December/016850.html
from almost two years ago. The tunable had been on the feature removal schedule for two years and would have emitted a warning if you had run on any kernel during that time. KDE 4.6.1 and later from two years ago work fine.

Quoted 3 lines

Also, udev in CentOS/RHEL/Scientific and other old Linux'es depend on this file (which is not critical but not pleasant anyway).

Fixed in udev v162 at the same time kde was.

#2 lore raw
Quoted 7 lines · David Rientjes

This is
http://mail.kde.org/pipermail/unassigned-bugs/2010-December/016850.html
from almost two years ago. The tunable had been on the feature removal schedule for two years and would have emitted a warning if you had run on any kernel during that time. KDE 4.6.1 and later from two years ago work fine.

Doesn't matter. If something breaks real users, it needs to get reverted (or worked around).

The feature-removal.txt file was a joke, and was used as an excuse for exactly the above kind of bad behavior. It got removed for good reasons.

The work-around might be as simple as creating an oom_adj file that simply doesn't do anything.

Linus

#3 lore raw
Quoted 3 lines · Linus Torvalds

The work-around might be as simple as creating an oom_adj file that simply doesn't do anything.

You want to carry a dummy tunable forever? If not, then how long if two years isn't sufficient?

#4 lore raw
Quoted 2 lines · David Rientjes

You want to carry a dummy tunable forever?

Feel free to make it non-dummy.

Quoted 1 line

If not, then how long if two years isn't sufficient?

What part of "We don't break user space" do you have trouble understanding?

There is no time limit. It's not about time. It's about not breaking user space.

End of discussion. I don't understand why people have such a hard time understanding such a simple concept. If people reports it breaks user-space, we fix it. And we keep fixing things until nobody uses the old versions any more. Seriously, IT IS THAT SIMPLE.

Linus

#5 lore raw

PATCH 1/1 mm, oom: reintroduce /proc/pid/oom_adj

This is mostly a revert of 01dc52ebdf47 ("oom: remove deprecated oom_adj") from Davidlohr Bueso.

It reintroduces /proc/pid/oom_adj for backwards compatibility with earlier kernels. It simply scales the value linearly when /proc/pid/oom_score_adj is written.

The major difference is that its scheduled removal is no longer included in Documentation/feature-removal-schedule.txt. We do warn users with a single printk, though, to suggest the more powerful and supported /proc/pid/oom_score_adj interface.

---
 Documentation/filesystems/proc.txt |   16 ++++--
 fs/proc/base.c                     |  109 ++++++++++++++++++++++++++++++++++++
 include/uapi/linux/oom.h           |    9 +++
 3 files changed, 130 insertions(+), 4 deletions(-)
Documentation/filesystems/proc.txt +12 -4
@@ -33,7 +33,7 @@ Table of Contents
   2	Modifying System Parameters
 
   3	Per-Process Parameters
-  3.1	/proc/<pid>/oom_score_adj - Adjust the oom-killer
+  3.1	/proc/<pid>/oom_adj & /proc/<pid>/oom_score_adj - Adjust the oom-killer
 								score
   3.2	/proc/<pid>/oom_score - Display current oom-killer score
   3.3	/proc/<pid>/io - Display the IO accounting fields
@@ -1320,10 +1320,10 @@ of the kernel.
 CHAPTER 3: PER-PROCESS PARAMETERS
 ------------------------------------------------------------------------------
 
-3.1 /proc/<pid>/oom_score_adj- Adjust the oom-killer score
+3.1 /proc/<pid>/oom_adj & /proc/<pid>/oom_score_adj- Adjust the oom-killer score
 --------------------------------------------------------------------------------
 
-This file can be used to adjust the badness heuristic used to select which
+These file can be used to adjust the badness heuristic used to select which
 process gets killed in out of memory conditions.
 
 The badness heuristic assigns a value to each candidate task ranging from 0
@@ -1361,6 +1361,12 @@ same system, cpuset, mempolicy, or memory controller resources to use at least
 equivalent to discounting 50% of the task's allowed memory from being considered
 as scoring against the task.
 
+For backwards compatibility with previous kernels, /proc/<pid>/oom_adj may also
+be used to tune the badness score.  Its acceptable values range from -16
+(OOM_ADJUST_MIN) to +15 (OOM_ADJUST_MAX) and a special value of -17
+(OOM_DISABLE) to disable oom killing entirely for that task.  Its value is
+scaled linearly with /proc/<pid>/oom_score_adj.
+
 The value of /proc/<pid>/oom_score_adj may be reduced no lower than the last
 value set by a CAP_SYS_RESOURCE process. To reduce the value any lower
 requires CAP_SYS_RESOURCE.
@@ -1375,7 +1381,9 @@ minimal amount of work.
 -------------------------------------------------------------
 
 This file can be used to check the current score used by the oom-killer is for
-any given <pid>.
+any given <pid>. Use it together with /proc/<pid>/oom_score_adj to tune which
+process should be killed in an out-of-memory situation.
+
 
 3.3  /proc/<pid>/io - Display the IO accounting fields
 -------------------------------------------------------
fs/proc/base.c +109 -0

127 lines not on this page · raw message

include/uapi/linux/oom.h +9 -0
@@ -8,4 +8,13 @@
 #define OOM_SCORE_ADJ_MIN	(-1000)
 #define OOM_SCORE_ADJ_MAX	1000
 
+/*
+ * /proc/<pid>/oom_adj set to -17 protects from the oom killer for legacy
+ * purposes.
+ */
+#define OOM_DISABLE (-17)
+/* inclusive */
+#define OOM_ADJUST_MIN (-16)
+#define OOM_ADJUST_MAX 15
+
 #endif /* _UAPI__INCLUDE_LINUX_OOM_H */