|
|
Log in / Subscribe / Register

bcache block interface ongoing support

bcache block interface ongoing support

Posted May 24, 2018 12:30 UTC (Thu) by nix (subscriber, #2304)
In reply to: bcache block interface ongoing support by TimSmall
Parent article: An update on bcachefs

That might be quite difficult because you can layer bcache at almost any point in the block hierarchy, and because its header is on the front, either rewriting of all data or careful movement of the layer above (LVM, partitions or whatever, which requires knowledge of that layer) is required. And then there are clever bastards like me with an LVM PV on bcache on md, and a VG layered across both bcached and non-bcached PVs, on two md arrays on the same physical disks, and lots of LVs underneath that... changing *that* to the one-lvm-cache-device-per-LV model used by dm-cache without screwing alignment completely or risking data loss seems likely to be terribly difficult.

No, I fear the same rule applies to this as to any fs: people rely on it, so you can't rip it out or randomly change the data format -- though for non-writeback bcache volumes it is probably more practical to change the cache device format, you don't want to require changes to the backing device: even writeback bcaches probably just need to write all the data back and then freely change the cache device: it would be nice if this didn't require downtime for those of us with rootfses on bcache, too.


to post comments

bcache block interface ongoing support

Posted May 24, 2018 12:54 UTC (Thu) by TimSmall (guest, #96681) [Link] (1 responses)

I was assuming that this would not involve the lvm tool set (or metadata etc.), but instead that a user space bcache-specific tool could be written to setup device mapper mappings to use dm-cache directly (within the constraints of dm-cache). This would involve fully draining (write-back → write-through → nocache) and discarding the cache device contents - so that there's a way to end up with the same (cached) content without moving the entire contents of the backing store (but keeping the bcache metadata headers etc. on the backing store device).

bcache block interface ongoing support

Posted May 24, 2018 14:53 UTC (Thu) by nix (subscriber, #2304) [Link]

Thinking about it, you could do that in the dynamic state of the system with just a dm-linear that skips the start of the device. You'd definitely need something to get that set up though (with low enough requirements that it could run from an initramfs and link against musl etc). It would not exactly be entirely transparent, unless "bcache" remains as a block device that just does that and passes everything through, or that thunks to dm-cache for everything (now *that* would be neat, get any improvements with that layer without compatibility problems!).


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds