Skip to contentSkip to conversation

Possible optimization in ext2_file_write()

DISCUSSION Stephen C. Tweedie 2 participants 2 messages Mar 19, 1999 – Mar 20, 1999 1 message not in the archive Memory management

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi,

Quoted 5 lines · V Ganesh

it looks like whenever we write a partial block which
doesn't exist in the buffer cache, ext2_file_write() (and possibly the write functions of other filesystems) directly reads that block from the block device without checking if it is present in the page cache.

Correct...

Quoted 4 lines

Of course, typical UNIX programs/shell jobs don't indulge in this kind of behaviour. General workstation usage (X, kernel compiles etc.) for a day caused only 32 unnecessary reads.

... and also correct.

Quoted 2 lines

So unless there are any specific application categories which require this I guess it's not worth the trouble to patch.

I'd agree (strongly). It ties in with your next question:

Quoted 1 line

Anyone working on a VM revamp or buffer/page cache unification ?

Yes. We still need the buffer cache (or something very like it) for filesystem metadata caching and for block IO. However, 2.3 _will_ see us using the page cache for data writeback (and we already have prototype patches to support that sort of behaviour). The linux-mm list has been discussing it for some time.

--Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm my@address' in the body to [email protected]. For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/

#2 lore raw
Quoted 6 lines · Stephen C. Tweedie

Hi,

On Thu, 18 Mar 1999 23:46:57 +0530 (IST), V Ganesh <[email protected]> said:

Quoted 7 lines
Quoted 5 lines

it looks like whenever we write a partial block which
doesn't exist in the buffer cache, ext2_file_write() (and possibly the write functions of other filesystems) directly reads that block from the block device without checking if it is present in the page cache.

Correct...

I don't know what you are exactly talking about, but there is another problem except speed:
Most modern harddisks remap bad sectors, so sometimes you can't read a sector, but if you write the sector is remapped.

I.e. if you "create a new file, write 400 bytes, close the file, sync", then the data sector should not be read.

Our current Windows 95 & Windows NT file system drivers read the data sector, and that has caused problems (older ZIP disks, SyQuest, my own damnaged harddisk?-I don't remember the details).

Regards,
Manfred
--
To unsubscribe, send a message with 'unsubscribe linux-mm my@address' in the body to [email protected]. For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/