Thread (2 messages) 2 messages, 2 authors, 2003-02-05

Re: Doubt in pagefault handler..!

From: Andrew Morton <hidden>
Date: 2003-02-05 08:48:01

John Navil Joseph [off-list ref] wrote:
	1) add the current process to a wait queue 
	2) invoke schedule() from the page fault handler
	3) wake up the process after the transfer has been completed.
You probably don't need to do all that by hand - you should be calling
non-blocking functions in the network layer, and waking the faulting process
up on completion of network I/O (based on interrupt-time networking
callbacks).

Looking at the NFS and SMB client code may help.
i tried to trace pagefault handler all the way down to where the acutal IO
takes palce incase of the transfer of page from swap to memory..But i never
saw schedule() anywhere. But i know that process sleeps on page I/O .. then
how and where does this sleeping takes place.?
The faulting process will sleep in wait_on_page() or lock_page().  See
filemap_nopage(), around the page_not_uptodate label.

The filesystem's responsibility is to run unlock_page() against the page once
its contents have been filled in from the backing medium (disk, network,
etc).  it will typically do this from interrupt context.  The unlock_page()
will wake up the faulting process.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help