Re: [PATCH] kernel_thread race

Jeff Dike (jdike@karaya.com)
Fri, 27 Aug 1999 00:36:13 -0400


Having thought about this a bit more, I think that something simpler is
reasonable.

The problem is that get_free_pages is waking something up which hasn't yet run
enough to set a pointer to its task struct. However, it is already awake, so
there's no point in waking it up. So, what do you think about this:

Instead of

int try_to_free_pages(unsigned int gfp_mask)
{
wake_up_process(kswapd_process);
...
}

we have

int try_to_free_pages(unsigned int gfp_mask)
{
if(kswapd_process != NULL) wake_up_process(kswapd_process);
...
}

kernel_thread would remain unchanged, and nothing tries to wake up bdflush_tsk
in a similar way, so this would be a one-line patch.

Jeff

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/