On Sun, Mar 29, 2020 at 10:47:10AM -0700, Chaitanya Kulkarni wrote: > Hi, > > This patch-series is based on the original RFC patch series:- > https://www.spinics.net/lists/linux-block/msg47933.html. > > I've designed a rough testcase based on the information present > in the mailing list archive for original RFC, it may need > some corrections from the author. > > If anyone is interested, test results are at the end of this patch. > > Following is the original cover-letter :- > > Information about continuous extent placement may be useful > for some block devices. Say, distributed network filesystems, > which provide block device interface, may use this information > for better blocks placement over the nodes in their cluster, > and for better performance. Block devices, which map a file > on another filesystem (loop), may request the same length extent > on underlining filesystem for less fragmentation and for batching > allocation requests. Also, hypervisors like QEMU may use this > information for optimization of cluster allocations. > > This patchset introduces REQ_OP_ASSIGN_RANGE, which is going > to be used for forwarding user's fallocate(0) requests into > block device internals. It rather similar to existing > REQ_OP_DISCARD, REQ_OP_WRITE_ZEROES, etc. The corresponding > exported primitive is called blkdev_issue_assign_range(). > See [1/3] for the details. > > Patch [2/3] teaches loop driver to handle REQ_OP_ASSIGN_RANGE > requests by calling fallocate(0). > > Patch [3/3] makes ext4 to notify a block device about fallocate(0). Ok, so ext4 has a very limited max allocation size for an extent, so I expect this won't cause huge latency problems. However, what happens when we use XFS, have a 64kB block size, and fallocate() is allocating disk space in continguous 100GB extents and passing those down to the block device? How does this get split by dm devices? Are raid stripes going to dice this into separate stripe unit sized bios, so instead of single large requests we end up with hundreds or thousands or tiny allocation requests being issued? I know that for the loop device, it is going to serialise all IO to the backing file while fallocate is run on it. Hence if you have concurrent IO running, any REQ_OP_ASSIGN_RANGE is going to cause an significant, measurable latency hit to all those IOs in flight. How are we expecting hardware to behave here? Is this a queued command in the scsi/nvme/sata protocols? Or is this, for the moment, just a special snowflake that we can't actually use in production because the hardware just can't handle what we throw at it? IOWs, what sort of latency issues is this operation going to cause on real hardware? Is this going to be like discard? i.e. where we end up not using it at all because so few devices actually handle the massive stream of operations the filesystem will end up sending the device(s) in the course of normal operations? Cheers, Dave. -- Dave Chinner david@xxxxxxxxxxxxx