Saturday, March 13, 2010

waiting on a locked page

a page might be locked because it is having IO or migration.

each zone has a hash table of wait queues. there is a waiting on a bit mechanism. when a process waits on a page, it actually waits on a page flag bit inside a wait queue from that zone hash table.

pagemap.h:lock_page(), filemap.c:page_waitqueue()

Wednesday, March 10, 2010

read --> disk blocks

there are two kinds of high-level accesses: sync, async
there are two kinds of low-level accesses: page cache and direct IO
sync infact uses async adding waiting on the async
sync, async both go through low-level accesses either through page cache or skipping page cache

generally unix filesystems use native unix read/write implementation. from files, control goes to mapping toward inode read_page method. that method converts file pages to disk blocks.