Re: 2.5.74-mm1

William Lee Irwin III
2003-07-05T10:44:33Z

On Fri, Jul 04, 2003 at 06:15:39PM -0700, Andrew Morton wrote:
> Look at select_bad_process(), and the ->mm test in badness(). pdflush
> can never be chosen.
> Nevertheless, there have been several report where kernel threads _are_
> being hit my the oom killer. Any idea why that is?

The badness() check isn't good enough. If badness() returns 0 for all
processes with pid's > 0 and the first one seen is a kernel thread the
kernel thread will be chosen. In principle, one could merely retarget
chosen with points >= maxpoints, but that's trivially defeated by
kernel threads landing at the highest pid for whatever reason.

-- wli