← Back to team overview

sslug-teknik team mailing list archive

Re: Slå swap-partition fra og andre gåder... :-)

 

I sslug.teknik, skrev Kristian Kallenberg:
>  OOM-killeren, rammer "det næste" program som allokerer hukommelse. Derfor har
>  jeg været ude i at den har ramt "forkerte" processor. Til gengæld mener jeg der
>  er mulighed for at slå en lidt grundigere vurdering til i kernen.
> 

Det kan godt være at det har været sådan, men det er i al fald ikke
tilfældet længere:

 * oom_badness - calculate a numeric value for how bad this task has been
 * @p: task struct of which task we should calculate
 *
 * The formula used is relatively simple and documented inline in the
 * function. The main rationale is that we want to select a good task
 * to kill when we run out of memory.
 *
 * Good in this context means that:
 * 1) we lose the minimum amount of work done
 * 2) we recover a large amount of memory
 * 3) we don't kill anything innocent of eating tons of memory
 * 4) we want to kill the minimum amount of processes (one)
 * 5) we try to kill the process the user expects us to kill, this
 *    algorithm has been meticulously tuned to meet the principle
 *    of least surprise ... (be careful when you change it)

Fra: /usr/src/linux/mm/oom_kill.c

Jesper

-- 
./Jesper Krogh, jesper@xxxxxxxx, Jabber ID: jesper@xxxxxxxxxxxx



References