lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4B82867D.9020007@cybertec.at>
Date:	Mon, 22 Feb 2010 14:28:29 +0100
From:	Boszormenyi Zoltan <zb@...ertec.at>
To:	linux-kernel <linux-kernel@...r.kernel.org>
Subject: [PATCH] Kill specific processes first in OOM-killer

Hi,

one of our clients wanted the possibility to specify which processes
do they want to get killed first by the OOM-killer in case of low memory.
The agreement included posting the result upstream. The original
was implemented on 2.6.27, it was adapted to 2.6.33-rc8 as well.
Both patches are included.

There's a new /proc/sys/vm/oom_preferred_tasks file which accepts
a string. E.g.:

# echo "/usr/bin/httpd,myforkbomb,oocalc" >/proc/sys/vm/oom_preferred_tasks

The string must contain comma separated process names or executable
pathnames. Upon calling out_of_memory(), the processes are checked
against the list of names. The process name matching is performed in
this order:

1. full pathname of the executable using /proc/PID/exe link
2.  executable name  without full pathname
3. process name using get_task_comm()

If no such matching process is found, the usual badness check is performed.

Best regards,
Zoltán Böszörményi

-- 
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics

----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/


View attachment "oom-pref-task-2.6.27-3.patch" of type "text/x-patch" (5249 bytes)

View attachment "oom-pref-task-2.6.33rc8.patch" of type "text/x-patch" (5371 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ