dm-linear is now implemented as a bio-based but my idea is to add new dm-linear-req target based on request-based device-mapper.
Consider the input I/Os are random but are actually consecutive if sorted. With bio-based, all the N I/Os are passing through the I/O path in device-mapper. However, with request-based, the I/Os are sorted and merged prior and thus much less frequent. In particular, it is only one if the total amount is less than the device underneath can handle as a request (it is typically 512KB).
The overhead of device-mapper path is not notable if the device is slow, say a single HDD. However, it will be so if it's really fast. In my past experience, it was 20-30% with a single SSD. Device-mapper is not as simple as it seems.
The drawback of request-based linear target is that the underlying must be only one; Any request can't straddle two devices. But I suppose most users are creating linear device above a single device so it is not a big problem actually. Usually, to build up multiple devices as one, you could use dm-thin or hardware RAID.
I am wondering why there isn't request-based linear target in upstream. Any reader knows why please tell me.