On Sat, 5 Mar 2022, Coly Li wrote: > On 3/5/22 3:54 PM, Cedric de Wijs wrote: > > On 3/4/22 08:45, Coly Li wrote: > >> On 3/3/22 1:23 AM, Cedric de Wijs wrote: > >>> Hi All, > >>> > >>> Summary: the kernel can't use an existing /dev/bcache0 as backing device > >>> for /dev/bcache1, and throws a lot of errors in /var/log/syslog. > >>> > > > 1) Is stacking bcaches on op of each other unsupported for now, and is it > > considered a technical problem that needs to be solved? > > > > 2) If I manage to somehow make the code work with stacked bcaches, will this > > code be accepted in the kernel? > > > Bcache is designed that a cache set or a backing device cannot be stacked by > itself. Otherwise some internal data structure will be conflicted, e.g. sysfs > device model related ones. Hi Cedric, Try placing a dm-linear as "bcache0-wrapper" device above bcache0 and place /dev/mapper/bcache0-wrapper as the backing device for bcache1. That could give you the extra layer of indirection needed to isolate bcache from itself and dm-linear is pretty fast so the performance wont be affected too much. This seems an appropriate quote: "All problems in computer science can be solved by another level of indirection... Except for the problem of too many layers of indirection." - David Wheeler You might also look at dm-cache and dm-writeboost above or below bcache. -Eric