On Thu, 2004-12-02 at 12:59 -0500, Colin Walters wrote:
On Thu, 2004-12-02 at 12:40 -0500, David Zeuthen wrote:
> I'm almost positive it requires kernel changes to do this the right way;
> one naive idea is to have a userspace daemon, capturing what blocks are
> read when (kernel tells this daemon using the kernel events layer). This
> would run in the first three minutes on each and every boot. When the
> system is idle (and only when running on AC power!) another daemon
> rearranges blocks on the disk. What blocks to rearrange could be the
> result of a computation involving several three-minute result sets.
Rearranging sounds complex and dangerous, since it requires deep
integration with the filesystem. The online resizing took quite a long
time to appear and that is conceptually much simpler. Why not do it on
the block device layer (without knowledge of the filesystem) and just
copy those blocks to a reserved area of the block device? Disks are
big, duplicating say 100MB for this purpose wouldn't be bad.
To flesh this out a bit more, you would also write out the mapping from
cache block -> original block to the cache, and make this a device-
mapper target.