> 2023年9月26日 04:41,Eric Wheeler <bcache@xxxxxxxxxxxxxxxxxx> 写道: >> [snipped] >> >>>>> Another consideration, stripe_sectors_dirty and full_dirty_stripes, the two >>>>> arrays allocated using n, are being used just in writeback mode, is this >>>>> correct? In my specific case, I'm not planning to use writeback mode so I >>>>> would expect bcache to not even try to create those arrays. Or, at least, to >>>>> not create them during initialization but just in case of a change in the >>>>> working mode (i.e. write-through -> writeback). >>>> Indeed, Mingzhe Zou (if I remember correctly) submitted a patch for this >>>> idea, but it is blocked by other depending patches which are not finished >>>> by me. Yes I like the idea to dynamically allocate/free d->stripe_sectors_dirty >>>> and d->full_dirty_stripes when they are necessary. I hope I may help to make >>>> the change go into upstream sooner. >>>> I will post a patch for your testing. >>> This would be great! Thank you very much! On the other side, if there's anything I can do to help I would be glad to contribute. >> >> I will post a simple patch for the reported memory allocation failure for you to test soon. >> >> Thanks. >> >> Coly Li >> >> > > > Hi Coly and Andrea: > > Years ago I wrote a patch to make stripe_size and > partial_stripes_expensive configurable: > > https://lore.kernel.org/lkml/yq1fspvq99j.fsf@xxxxxxxxxxxxxxxxxxxx/T/ > > A modern version of this could be merged with bcache-tools support. There > are still RAID controllers that either do not report io_opt, and Andrea's > issue highlights the problem with io_opt being too small. We should try best to avoid the on-disk format change, before adding new member into bcache super block a new incompatible feature bit is required, other wise old format running on new kernel will be problematic. I replied this in the original discussion. And adding a sysfs interface to change the bcache stripe size might introduce more unnecessary troubles. IMHO I’d prefer to increase the minimal bcache stripe size which still may work fine with writeback code. Coly Li