Linux Kernel(2.6)の実装に関するメモ書き

Boundary Buffer


Rev.3を表示中。最新版はこちら

概要

BufferのフラグBH_Boundaryに関して。

BH_Boundary 意味

編集中

カーネルのfs/mpage.cのコメントより
==== コメントここから ====
BH_Boundary explanation:
There is a problem.  The mpage read code assembles several pages, gets all their disk mappings, and then submits them all.  That's fine, but obtaining the disk mappings may require I/O.  Reads of indirect blocks, for example.

mpageのRead処理は幾つかのページをまとめて処理する際、これらのページ全てのディスクマッピングを取得します。それからページのI/Oを開始します。これはよくできていますが、ディスクマッピングを取得する場合はI/Oが必要になるかもしれません。例えば、間接参照ブロックのReadです。

So an mpage read of the first 16 blocks of an ext2 file will cause I/O to be submitted in the following order:

だから、ext2上のファイルの最初の16ブロックのReadは以下の順番でI/Oが発生します。

12 0 1 2 3 4 5 6 7 8 9 10 11 13 14 15 16

because the indirect block has to be read to get the mappings of blocks 13,14,15,16.  Obviously, this impacts performance.

13,14,15,16ブロックのマッピングを取得するために間接参照ブロックを読まなければならないためです。これは、明らかに性能に影響します。

So what we do it to allow the filesystem's get_block() function to set BH_Boundary when it maps block 11.  BH_Boundary says: mapping of the block after this one will require I/O against a block which is probably close to this one.  So you should push what I/O you have currently accumulated.

ファイルシステムがブロック11をマッピングする際、get_block()にBH_Boundaryを設定させるようにしました。 BH_Boundaryは「このあとのブロックのマッピングで、おそらく、このブロックに近いブロックに対してI/Oが必要になる。だから、今溜めているI/Oを発行すべき。」ということを意味します。

This all causes the disk requests to be issued in the correct order.

これにより、正しい順番でI/Oを行えるようになります。
==== コメントここまで ====

関連関数

buffer_boundary(bh)
指定バッファがBoundary(BH_Boundaryが立っている)かチェックする。

関連ページ

Buffer
Ext2 FS
mpage


最終更新 2007/02/21 17:02:18 - kztomita
(2007/02/21 16:48:17 作成)
添付ファイル
boundary.png - kztomita


リンク
最近更新したページ
検索