filemap.c:wait_on_page() problem & question

Ingo Molnar (
Mon, 25 Nov 1996 19:53:59 +0100 (MET)

void __wait_on_page(struct page *page)
struct wait_queue wait = { current, NULL };

add_wait_queue(&page->wait, &wait);
current->state = TASK_UNINTERRUPTIBLE;
if (PageLocked(page)) {
goto repeat;
remove_wait_queue(&page->wait, &wait);
current->state = TASK_RUNNING;

now how does a process that isnt on 'tq_disk' get runnable if the page
isnt read yet? Or are all pages that are far from being complete expected
to be 'PageLocked(page)'? [if not, then whos responsibility is it to mark
them locked?]

Why i'm asking this is that i'm seeing long (and unjustified) delays in
'sys_read()'. These delays might be due to incomplete IO but not properly
locked pages?

-- mingo