Re: 2.5.74-mm1

From: Andrew Morton (
Date: Sat Jul 05 2003 - 13:43:08 EST

William Lee Irwin III <> wrote:
> 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.

Are we looking at the same code?

static struct task_struct * select_bad_process(void)
        int maxpoints = 0;
        struct task_struct *g, *p;
        struct task_struct *chosen = NULL;

        do_each_thread(g, p)
                if (p->pid) {
                        int points = badness(p);
                        if (points > maxpoints) {
                                chosen = p;
                                maxpoints = points;
                        if (p->flags & PF_SWAPOFF)
                                return p;
        while_each_thread(g, p);
        return chosen;

if badness() returns zero for everything, this returns NULL and
the kernel panics.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jul 07 2003 - 22:00:25 EST