Your message dated Sat, 11 Jun 2016 20:13:20 +0200
with message-id <[email protected]>
and subject line Re: use oom_score_adj instead of deprecated oom_adj
has caused the Debian Bug report #803486,
regarding use oom_score_adj instead of deprecated oom_adj
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
803486: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803486
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: ocfs2-tools
Severity: normal
Tags: patch

Hi,
I am not sure where the upstream code sits for this package so I am
reporting it to distribution. Let me know if I should post the patch
somewhere else.
Anyway oom_adj is long deprecated and shouldn't be used. The attached
patch uses oom_score_adj in preference to oom_adj.

Thanks!

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.3.0-rc7 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

-- 
Michal Hocko
From: Michal Hocko <[email protected]>
Subject: use oom_score_adj instead of deprecated oom_adj

We are trying to get rid of oom_adj in the kernel. It has been
deprecated since 2.6.36. Let's use oom_score_adj preferably
and fallback to oom_adj when the former is not present (if
used on older systems).

While at it rename set_oom_adj to suppress_oom for an easier
transition because the file specific value can be handled
inside the function.

Signed-off-by: Michal Hocko <[email protected]>
Index: ocfs2-tools-1.6.4/ocfs2_controld/main.c
===================================================================
--- ocfs2-tools-1.6.4.orig/ocfs2_controld/main.c
+++ ocfs2-tools-1.6.4/ocfs2_controld/main.c
@@ -1150,11 +1150,16 @@ static void decode_arguments(int argc, c
 	}
 }
 
-static void set_oom_adj(int val)
+static void suppress_oom(int val)
 {
 	FILE *fp;
+	int val = -941; /* scaled out OOM_ADJUST_MIN */
 
-	fp = fopen("/proc/self/oom_adj", "w");
+	fp = fopen("/proc/self/oom_score_adj", "w");
+	if (!fp) {
+		fp = fopen("/proc/self/oom_adj", "w");
+		val = -16; /*OOM_ADJUST_MIN */
+	}
 	if (!fp)
 		return;
 
@@ -1212,7 +1217,7 @@ int main(int argc, char **argv)
 		daemonize();
 
 	set_scheduler();
-	set_oom_adj(-16);
+	suppress_oom();
 
 	return loop();
 }

--- End Message ---
--- Begin Message ---
Version: 1.8.4-1

New version uploaded to unstable uses only /proc/self/oom_score_adj.

-- 
Valentin

--- End Message ---

Reply via email to