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

Re: (reiserfs) Re: More on Re: (reiserfs) Reiserfs and ext2fs (was Re: (reiserfs) Sum Benchmarks (these look typical?))



>>>>> "ST" == Stephen C Tweedie <sct@dcs.ed.ac.uk> writes:

ST> Hi,
ST> On 29 Jun 1998 14:59:37 -0500, ebiederm+eric@npwt.net (Eric
ST> W. Biederman) said:

>> There are two problems I see.  

>> 1) A DMA controller actively access the same memory the CPU is
>> accessing could be a problem.  Recall video flicker on old video
>> cards.

ST> Shouldn't be a problem.

When either I trace through the code, or a hardware guy convinces me,
that it is safe to both write to a page, and do DMA from a page
simultaneously I'll believe it.

>> 2) More importantly the cpu writes to the _cache_, and the DMA
>> controller reads from the RAM.  I don't see any consistency garnatees
>> there.  We may be able solve these problems on a per architecture or
>> device basis however.

ST> Again, not important.  If we ever modify a page which is already being
ST> written out to a device, then we mark that page dirty.  On write, we
ST> mark it clean (but locked) _before_ starting the IO, not after.  So, if
ST> there is ever an overlap of a filesystem/mmap write with an IO to disk,
ST> we will always schedule another IO later to clean the re-dirtied
ST> buffers.

Duh.  I wonder what I was thinking...

Anyhow I've implemented the conservative version.  The only
change needed is to change from unmapping pages to removing the dirty
bit, and the basic code stands. 

The most important change needed would be to tell unuse_page it can't
remove a a locked page from the page cache.  Either that or I need to
worry about incrementing the count for page writes, which wouldn't be
a bad idea either.

Eric