On Thu, Apr 28, 2005 at 12:14:24PM -0700, Mingming Cao wrote:
Currently ext3_get_block()/ext3_new_block() only allocate one block at a
time. To allocate multiple blocks, the caller, for example, ext3 direct
IO routine, has to invoke ext3_get_block() many times. This is quite
inefficient for sequential IO workload.
The benefit of a real get_blocks() include
1) increase the possibility to get contiguous blocks, reduce possibility
of fragmentation due to interleaved allocations from other threads.
(should good for non reservation case)
2) Reduces CPU cycles spent in repeated get_block() calls
3) Batch meta data update and journaling in one short
4) Could possibly speed up future get_blocks() look up by cache the last
mapped blocks in inode.
And here is the patch to make mpage_writepages use get_blocks() for
multiple block lookup/allocation. It performs a radix-tree contiguous pages lookup, and issues a get_blocks for the range together. It maintains
an mpageio structure to track intermediate mapping state, somewhat
like the DIO code.
It does need some more testing, especially block_size < PAGE_SIZE.
The JFS workaround can be dropped if the JFS get_blocks fix from
Dave Kleikamp is integrated.
Review feedback would be welcome.
Mingming,
Let me know if you have a chance to try this out with your patch.
Regards
Suparna