<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TimburyDotOrg &#187; Linux kernel</title>
	<atom:link href="http://timbury.org/tag/linux-kernel/feed/" rel="self" type="application/rss+xml" />
	<link>http://timbury.org</link>
	<description>Linux and Open Source Stuff</description>
	<lastBuildDate>Thu, 29 Jul 2010 11:06:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>TerminateSafe, Save-free Applications, and oom_adj</title>
		<link>http://feedproxy.google.com/~r/IBeenToUbuntu/~3/6XtKpnZ7P9Q/terminatesafe-save-free-applications.html</link>
		<comments>http://feedproxy.google.com/~r/IBeenToUbuntu/~3/6XtKpnZ7P9Q/terminatesafe-save-free-applications.html#comments</comments>
		<pubDate>Thu, 13 May 2010 02:10:00 +0000</pubDate>
		<dc:creator>Daengbo</dc:creator>
				<category><![CDATA[syndicated]]></category>
		<category><![CDATA[Linux kernel]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Image via WikipediaThere's a good proposal going through the rounds on the FreeDesktop.org mailing list which seeks to help the kernel decide which process(es) to kill first in the event of memory pressure. The proposal is simply adding a TerminateSafe...]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="display: block; float: right; margin-bottom: 1em; margin-left: 1em; margin-right: 1em; margin-top: 1em; width: 310px;"><img alt="The logo of freedesktop." height="47" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Freedesktop-logo.svg/300px-Freedesktop-logo.svg.png" style="border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: block;" width="300" /><span class="zemanta-img-attribution">Image via <a href="http://commons.wikipedia.org/wiki/Image:Freedesktop-logo.svg">Wikipedia</a></span></div>There's a good proposal going through the rounds on the <a class="zem_slink" href="http://en.wikipedia.org/wiki/Freedesktop.org" rel="wikipedia nofollow" title="Freedesktop.org">FreeDesktop.org</a> mailing list which seeks to help the kernel decide which process(es) to kill first in the event of memory pressure. The proposal is simply adding a TerminateSafe=true key to the .desktop files of applications which are stateless or which constantly save user data. Examples of stateless applications might be the character map and calculator tool. Applications which save continuously might include <a class="zem_slink" href="http://en.wikipedia.org/wiki/Tomboy_%28software%29" rel="wikipedia nofollow" title="Tomboy (software)">Tomboy</a>. Terminals, office suites, and IDEs would not have this key set to "true."<br />
<br />
The <a class="zem_slink" href="http://en.wikipedia.org/wiki/Linux_kernel" rel="wikipedia nofollow" title="Linux kernel">Linux kernel</a>'s <a class="zem_slink" href="http://en.wikipedia.org/wiki/Out_of_memory" rel="wikipedia nofollow" title="Out of memory">OOM</a> (out of memory) Killer has a method to determine which processes get killed first in a critical situation: it's called "magic." No, not really. It <b>is</b>&nbsp;complicated, though, and it offers a "user-friendly" way to help the kernel make its decision. oom_score is located in <a class="zem_slink" href="http://en.wikipedia.org/wiki/Procfs" rel="wikipedia nofollow" title="Procfs">/proc</a>/ under the number of each running process. The oom_score for each process is based on factors such as memory use and running time. The process directory also contains oom_adj, which, as the name suggests, allows one to adjust the score of the process. Think of it like <i>nice</i>, but for killing, not running.<br />
<br />
If TerminateSafe=true were implemented on Linux, it would likely signal the <a class="zem_slink" href="http://en.wikipedia.org/wiki/Desktop_environment" rel="wikipedia nofollow" title="Desktop environment">desktop environment</a> to adjust oom_score to put the application on the top op the assassination list using oom_adj. Other OSes might use a different method or not support the key at all.<br />
<br />
The problem with this approach is that the process the .desktop file spawns may not even be the main process if the file calls a script. The situation is made worse by processes that fork. Luckily, the kernel offers process groups to handle this situation, something <a href="http://0pointer.de/blog/projects/systemd.html">Systemd</a> is planning to use.<br />
<br />
I hope you've heard of Systemd, the init/upstart replacement with a model half way between <a href="http://developer.apple.com/MacOsX/launchd.html">launchd</a> and <a href="http://en.wikipedia.org/wiki/Inetd">inetd</a>. If you haven't you should take a look at it.<br />
<div class="zemanta-pixie" style="height: 15px; margin-top: 10px;"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/17c9d2ce-28c9-4c97-acf7-9f4ff6a2fca3/" title="Reblog this post [with Zemanta]"><img alt="Reblog this post [with Zemanta]" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=17c9d2ce-28c9-4c97-acf7-9f4ff6a2fca3" style="border: none; float: right;" /></a><span class="zem-script more-related pretty-attribution"><script defer="defer" src="http://static.zemanta.com/readside/loader.js" type="text/javascript">
</script></span></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/117578413372837062-5513134196510893558?l=blog.ibeentoubuntu.com' alt='' /></div>
<p><a href="http://feedads.g.doubleclick.net/~a/l2L54oFRfMvb2yPTD6bYRU7KsBk/0/da"><img src="http://feedads.g.doubleclick.net/~a/l2L54oFRfMvb2yPTD6bYRU7KsBk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/l2L54oFRfMvb2yPTD6bYRU7KsBk/1/da"><img src="http://feedads.g.doubleclick.net/~a/l2L54oFRfMvb2yPTD6bYRU7KsBk/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/IBeenToUbuntu?a=6XtKpnZ7P9Q:YOX1bnkiIjg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/IBeenToUbuntu?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/IBeenToUbuntu?a=6XtKpnZ7P9Q:YOX1bnkiIjg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/IBeenToUbuntu?i=6XtKpnZ7P9Q:YOX1bnkiIjg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/IBeenToUbuntu?a=6XtKpnZ7P9Q:YOX1bnkiIjg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/IBeenToUbuntu?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/IBeenToUbuntu/~4/6XtKpnZ7P9Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://timbury.org/2010/05/12/terminatesafe-save-free-applications-and-oom_adj/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
