freenode/#mezzano - IRC Chatlog
Search
1:24:01
fittestbits__
I think it would be better if the callers didn't have to know what is going on in the cache.
1:25:11
fittestbits__
So, I would cache sector size buffers, then either copy the sectors from the cache to the buffer or read data from the disk into the buffer as required.
1:25:55
fittestbits__
Yes, which is a disadvantage. Of course memory to memory copy is much faster than disk I/O.
1:27:06
fittestbits__
It would be better to avoid copying if you can. The question is how much do you want to caller to understand about the lower layers.
1:29:30
fittestbits__
Well, if FAT, we're currently reading the whole file, so not fixed size blocks. But, we can change the stream code to use a fixed size buffer that always has the correct alignment.
1:31:51
fittestbits__
Well, it would be the block size that read and write are called with. Or, you could have the file system mount code set the cache block size as part of init.
1:41:12
fittestbits__
Hmm. I think they need to wired, you don't want the cached blocks to be paged out to swap. That would defeat the whole purpose of having them cached - to avoid disk operations.
1:42:13
fittestbits__
I wonder if wired pages are can become unwired if everything on them has been freed by GC.
1:44:57
fittestbits__
Perhaps we need a different interface - block-device-read-wired. Which takes a wired buffer instead of an unwired buffer and doesn't do a copy for the supervisor disk driver.
1:54:49
fittestbits__
Yeah, you probably need to have some kind of structure as the hash value instead of just the buffer - one of the elements of the structure is the buffer, another might be a dirty flag.