Re: 2.2.1{3,4,5pre*} VM bug found

From: Stephen C. Tweedie (sct@redhat.com)
Date: Thu Jan 27 2000 - 14:07:42 EST


Hi,

On Tue, 25 Jan 2000 04:27:43 +0100 (CET), Rik van Riel
<riel@nl.linux.org> said:

> Sometimes a process with tsk->state != TASK_RUNNABLE
> calls __get_free_pages(). When we're (almost) out of
> memory, the process will wake up kswapd and try to
> free some memory itself.

> In 2.2.15pre4 or when the call to try_to_free_pages()
> generates disk I/O, the task will call schedule().
> Since the task state != TASK_RUNNABLE, schedule() will
> immedately remove it from the run queue ...

Shouldn't be a problem. Anywhere that we stall in try_to_free_pages()
to wait for disk IO, we obviously have to set task->state to
TASK_UNINTERRUPTIBLE, as we're about to block. If we do that as a
result of disk IO, then we have necessarily already scheduled a wakeup
event which will set the task state back to runnable.

So, the only risk is that the call to try_to_free_pages() has the
unexpected side effect of setting the task state to TASK_RUNNABLE. That
isn't a problem: the only effect it will have on the caller is to make a
call schedule() return sooner than expected.

--Stephen

-
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/



This archive was generated by hypermail 2b29 : Mon Jan 31 2000 - 21:00:19 EST