bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ext2fs and large stores (> 1.5G)


From: Ognyan Kulev
Subject: Re: [PATCH] ext2fs and large stores (> 1.5G)
Date: Wed, 30 Apr 2003 17:48:05 +0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030327 Debian/1.3-4

M. Gerards wrote:
...


The rest of disk_image is used as block cache for indirect blocks. Code that uses indirect block must use disk_image_request and disk_image_release. disk_image_request first checks if the block is already in the memory, and if it's not, then allocate it from the block cache.

When using disk_image_release for modified blocks, they are marked as "dirty". The actual write of the block happens in the pokel or sync_global_ptr which call disk_image_clear. disk_image_clear clears the dirty flag of the block thus allowing it to be reused.

Isn't it easier to use what Neal proposed instead? You use LRU and a block
cache, Neal proposed to let gnumach handle this by mapping everything. You can
do this by making disk_image_request create a mapping and put it in a hashtable,
which IMHO is better than your current solution, one gigantic lookup table (Or
did I misunderstand your code? I had a quick look.).

I suppose you are talking about http://mail.gnu.org/archive/html/bug-hurd/2002-12/msg00055.html . Using hash tables to do the mapping instead of vector indexed by block number is not essential in the current state of the patch.

Here is the big problem that corrupts data: When a block is requested and the block cache is full, I _reuse_ VM page from the block cache but I can't force Mach to reload it. Mach must reload it because I assign different mapping between the memory page and the backing store. I tried pager_flush_some and pager_offer_page but they don't work or I do something incorrectly.

* block sizes different than 4096 are not supported. Don't try it! Discussion about this issue is welcomed, as I didn't think about this yet.

When using what I proposed above you should request ext2 blocks to
disk_image_request (or is this how it works now), make a mapping (if this wasn't
done for another block in the same page), you can also register if a block is
dirty just like you do now. And just register if it is dirty, never remove this
mapping from the hashtable. In pager_write_page (or better: the function called
by this function) you should check if the block is dirty and write it if it is,
if it is not ignore it.

Writing back any changes is done mostly via pokel_sync (except in some sync modes). Except some details (like hash tables) what you wrote is essentially the current implementation in the patch :-)

Regards
--
Ognyan Kulev <ogi@fmi.uni-sofia.bg>, "\"Programmer\""





reply via email to

[Prev in Thread] Current Thread [Next in Thread]