 
			
		cf. http://wiki.bit-hive.com/linuxkernelmemo/pg/generic_file_read()
do_generic_file_read(ファイル構造体、バッファ, ファイルオフセット)
  for(要求サイズが満たされるまで)
    if(ページキャッシュ上にない?(__find_page_nolock関数))
      フリーページを確保(page_cache_alloc関数)
      フリーページをキャッシュに登録(__add_to_page_cache関数)
      ファイルのiノードのreadpageオペレーションを呼び出す.
    先読み要求を出しておく(generic_file_readahead関数)
    ヒットしたページへのI/O完了を待つ(wait_on_page関数)
    ページの解放(page_cache_release関数)
cf. https://osdn.jp/projects/linux-kernel-docs/wiki/internal24-137-%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E8%AA%AD%E3%81%BF%E8%BE%BC%E3%81%BF
int ext3_readpage(struct file *file, struct page *page) {
    return mpage_readpage(page, ext3_get_block);
}
int blkdev_readpage(struct file * file, struct * page page) {
    return block_read_full_page(page, blkdev_get_block);
}
先読みがいつ実行されるのか
凝った特性
GrowthForecast/RRDtool チューニング秘伝の書
generic_file_write(ファイル構造体、ユーザ領域, ファイルポインタ)
  if(アペンドモードなら) ファイルポインタをファイルエンドにする
  while(書き込むデータがある間)
    ページキャッシュを確保する(__grab_cache_page関数)
      (もしキャッシュ上になければ新規確保し、登録する)
    ページの書き込み準備をする(iノードのprepare_writeオペレーション)
    ユーザ領域のデータをバッファに読み込む(copy_from_user関数)
    ページの書き込み要求を出す(iノードのcommit_writeオペレーション)
    ページキャッシュの解放(page_cache_release関数)
cf. https://osdn.jp/projects/linux-kernel-docs/wiki/internal24-138-%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%B8%E3%81%AE%E6%9B%B8%E3%81%8D%E8%BE%BC%E3%81%BF%E3%81%A8%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E6%8B%A1%E5%BC%B5
int ext2_prepare_write(struct file *file,
  struct page *page, unsigned from, unsigned to) {
  return block_prepare_write(page, from, to, ext2_get_block);
}
int blkdev_prepare_write(struct file *file,
  struct page *page, unsigned from, unsigned to) {
  return block_prepare_write(page, from, to, blkdev_get_block);
}
RubyのLoggerはスレッドセーフ(&プロセスセーフ)かどうか調べてみた - sonots:blog
int ext2_writepages(struct address_space *mapping,
  struct writeback_control *wbc) {
  return mpage_writepages(mapping, wbc, ext2_get_block);
}
cf. http://www-06.ibm.com/jp/linux/tech/doc/attachments/002f5e43_linux_io_subsystem_v1_2.pdf
メモリマッピング
2種類
int msync(void *addr, size_t length, int flags) ファイルに書き込ませる
ではなぜmmap(2)を使うと処理速度が上がるのか。これは「カーネルとコピープログラムの間でデータのコピーが発生しないから」と説明できる。
We would like to enable HDFS to read local files via mmap. This would enable truly zero-copy reads.