Re: Request: I/O request recording

From: Bart Samwel
Date: Sun Jan 25 2004 - 18:34:09 EST


Andrew Morton wrote:
Bart Samwel <bart@xxxxxxxxx> wrote:

When I saw this thread I've fiddled for a bit with the block_dump
functionality that's in the laptop_mode patch. I wanted to see if it
could support a similar thing completely from user space (except for the
block_dump code, of course). I've written a small tool to generate a
complete file that lists tuples (sector, size, device) from the kernel
output in syslog; it parses all "READ block xxx" messages since the
last reboot. Putting this through sort -n -u delivers a nicely sorted
file, ready for optimized reading.

Unfortunately I'm now stuck within the other part, which is reading the
pages back in memory at the next boot. It's not working, and I was hoping someone here could take a look and tell me what I'm doing wrong.

Linux caches disk data on a per-file basis. So if you preload pagecache
via the /dev/hda1 "file", that is of no benefit to the /etc/passwd file. Each one has its own unique pagecache. When reading pages for /etc/passwd
we don't go looking for the same disk blocks in the cache of /dev/hda1.

Which is why the userspace cache preloading needs to know the pathnames of
all the relevant files - it needs to open and read each one, applying
knowledge of disk layout while doing it.

Hmmm, that explains why this didn't work. :( So if I wanted to do this completely from user space using only block_dump data I'd probably have to go through all files and find out if they had any blocks in common with my preload set -- presuming there is a way to find that out, which there probably isn't. That makes this idea pretty much useless, I'm sorry to have bothered you with it.

-- Bart
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/