On Tue, Nov 18, 2008 at 1:06 AM, Ruby <ruby185@xxxxxxxxx> wrote: > hi, all > > as I understand, ->readpage() will be invoked on address space object at > some point when you do a syscall on read. > for ext3, it will be ext3_readpage, which ask mpage_readpage() to do the > job. > > what I don't follow is why the function doc right before mapge_readpage() > claims "This isn't called much at all". > These are the caller I can find: ./fs/gfs2/ops_address.c: error = mpage_readpage(page, gfs2_block_map); * 3. mpage_readpages() does most of the heavy lifting in the common case. ret = mpage_readpages(mapping, pages, nr_pages, gfs2_block_map); ./fs/ocfs2/aops.c: err = mpage_readpages(mapping, pages, nr_pages, ocfs2_get_block); ./fs/ext3/inode.c: return mpage_readpage(page, ext3_get_block); return mpage_readpages(mapping, pages, nr_pages, ext3_get_block); ./fs/ext4/inode.c: return mpage_readpage(page, ext4_get_block); return mpage_readpages(mapping, pages, nr_pages, ext4_get_block); ./fs/omfs/file.c: return mpage_readpages(mapping, pages, nr_pages, omfs_get_block); ./fs/ext2/inode.c: return mpage_readpage(page, ext2_get_block); return mpage_readpages(mapping, pages, nr_pages, ext2_get_block); ./fs/reiserfs/inode.c: return mpage_readpages(mapping, pages, nr_pages, reiserfs_get_block); ./fs/xfs/linux-2.6/xfs_aops.c: return mpage_readpage(page, xfs_get_blocks); return mpage_readpages(mapping, pages, nr_pages, xfs_get_blocks); ./fs/fat/inode.c: return mpage_readpage(page, fat_get_block); return mpage_readpages(mapping, pages, nr_pages, fat_get_block); ./fs/jfs/inode.c: return mpage_readpage(page, jfs_get_block); return mpage_readpages(mapping, pages, nr_pages, jfs_get_block); So for ext3, the caller is ext3_readpage(), since ext3_readpages() called mpage_readpages(). Doing an ftrace based on "gedit" usage: + cat /debug/tracing/trace # tracer: function # # TASK-PID CPU# TIMESTAMP FUNCTION # | | | | | ping-16862 [001] 4154504124.726653: ext3_readpages <-__do_page_cache_readahead ping-16862 [001] 4154504124.734300: ext3_readpages <-__do_page_cache_readahead ping-16862 [001] 4154504130.842834: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504132.875053: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504132.875279: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504132.875635: ext3_readpages <-__do_page_cache_readahead sleep-16871 [000] 4154504132.876264: ext3_readpages <-__do_page_cache_readahead sleep-16871 [000] 4154504132.975226: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.518396: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.542090: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.554723: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.561582: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.568196: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.571578: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.573920: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.583903: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.587428: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.597227: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.598789: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.600786: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.601692: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.605248: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.607422: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.652960: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.672707: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.682435: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.696935: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.736472: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.745688: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.757596: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.787324: ext3_readpages <-__do_page_cache_readahead gedit-16870 [001] 4154504133.794610: ext3_readpages <-__do_page_cache_readahead We can see majority are using ext3_readpages(), not ext3_readpage(). So I guessed that's what it meant - "pages" are more often used than "page". And they don't overlap. > is this not on the primary read I/O path anymore? > > > thanks > > Ruby > -- Regards, Peter Teoh -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ