[uClinux-dev] I modified "fs/buffer.c",
would you give me some suggestions?
David Agan
dvd_agan at yahoo.com
Mon Jan 8 20:55:25 EST 2007
kernel "2.4.24-uc0(nommu)",
with USB storage disk.
I modified the function "create_buffers()", as :
while ((offset -= size) >= 0) {
// add
if (async && (nr_unused_buffer_heads<=NR_RESERVED)) {
/* try get unused header,
* before we alloc one.
*/
run_task_queue(&tq_disk);
free_more_memory();
}
// add end
bh = get_unused_buffer_head(async);
if (!bh)
goto no_grow;
...
}
All I want to do is to reduce the size of the memory that taken by the buffer cache while writing files. Some times, I can't allocate new memory while writing files, I think it's due to "nommu". The memory allocated by buffer cache would be free by the file system it'self, is it right?
After I modified the code, the IO operates more frequently. I test it on ext2 & ext3, everything seems ok, but on fat32, file system would panic with error message "File without EOF";
With the same purpose, I tried the patch "O_STREAM", it would be better, but it seems can't prevent the buffer cache from stealing the memory. I also tried "O_DIRECT", and found it's not implemented.
Any comments or suggestions will be really appreciated!
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20070108/bf8a76c3/attachment.html
More information about the uClinux-dev
mailing list