On Fri, 18 Apr 2025, Damien Le Moal wrote:

> > It seems that you want to send many small overlapping write bios - the 
> > question is why? Why can't the application accumulate the content and send 
> > it as one big bio?
> 
> That is the application problem. On HDDs at least, small IOs will hurt
> performance. SMR or not, same problem. Intellignet applications will try to
> shape their workload to optimize performance. But that point is irrelevant 
> here.
> The kernel porvides a service: process write requests, regardless of how big
> these requests are, if they are correct (i.e. for zoned devices, they must be
> issued in order by the user), we must correctly execute the writes.
> 
> > I'm a bit worried that supporting this ordering will just bloat the kernel 
> > with marginal benefit.
> 
> Bloat ?

We would need three states instead of two: normal, suspended, resuming (so 
it would bloat all the device mapper logic with another state). There's 
dm_wq_work using submit_bio_noacct, which wouldn't work, as it would 
immediatelly enqueue the bio for suspend again, so we would need some 
other path to submit the bio.

dm_wq_work would have to transition the device from the "resuming" state 
to the "normal" state when it processes all the bios, but it is called for 
various other reasons too.

> everything is already in place to preserve the order of write operations
> to zoned devices, since a long time ago.

What if the controller doesn't preserve the order of writes? I think that 
there was some bit for that, but I forgot its name. So we can simply not 
set the bit for device mapper - and the applications will have to deal 
with it by using write plugging.

> What has not been covered are cases
> like suspend/resume which may, depending on what they do, break the ordering
> guarantees that we have for write requests. The only reason this has not been
> fixed is because I completely overlooked these cases as zoned block devices 
> were
> in the past mostly used in enterprise systems where suspend/resume is not 
> really
> used at all. But we have zoned UFS devices these days (smart phones), so
> properly supporting DM suspend/resume is important I think.

Do you mean zoned flash devices? I've never heard of them.

Mikulas


Reply via email to