Re: oom_killer crash linux system
From: David Rientjes
Date: Tue Oct 19 2010 - 14:44:14 EST
On Tue, 19 Oct 2010, Figo.zhang wrote:
> > very lots of change ;)
> > can you please send us your crash log?
>
> i add some prink in select_bad_process() and oom_badness() to see
> pid/totalpages/points/memoryuseage/and finally process to selet to kill.
>
It shouldn't need any printk's to be added, the new heuristic is rather
predictable given the memory usage of the application. You could find
what the badness score is by checking /proc/pid/oom_score.
> i found it the oom-killer select: syslog-ng,mysqld,nautilus,VirtualBox
> to kill, so my question is:
>
> 1. the syslog-ng,mysqld,nautilus is the system foundamental process, so
> if oom-killer kill those process, the system will be damaged, such as
> lose some important data.
>
The oom killer always attempts to kill the most memory-hogging task that
is eligible given the context in which the system is out of memory. That
allows the kernel to free a large amount of memory so the oom killer will
not (hopefully) have to be recalled again in the near future. Otherwise,
we end up killing everything else other than the memory-hogger, and it
that may turn out to be a memory leaker that we don't care about :)
> 2. the new oom-killer just use percentage of used memory as score to
> select the candidate to kill, but how to know this process to very
> important for system?
>
The user has to tell it by using /proc/pid/oom_score_adj, see
Documentation/filesystems/proc.txt if you'd like to adjust how the oom
killer ranks tasks that you deem to be important and vital to your system.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/