apple-nvme: defer cache flushes by a specified amount m1-test
authorJens Axboe <axboe@kernel.dk>
Wed, 16 Feb 2022 19:17:58 +0000 (12:17 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 16 Feb 2022 19:48:58 +0000 (12:48 -0700)
commite226b395bc2d49a6a1411765875e0864c9a0e0da
tree9a5516b9469d004b63e417fa34d76fc90b396640
parente493225b2692e663729a79754065c3fcbe2d3243
apple-nvme: defer cache flushes by a specified amount

Cache flushes on the M1 nvme are really slow, taking 17-18 msec to
complete. This can slow down workloads considerably, pure random writes
end up being bound by the flush latency and hence run at 55-60 IOPS.

Add a deferred flush work around to provide better performance, at a
minimal risk. By default, flushes are delayed at most 1 second, but this
is configurable.

With this work-around, a pure random write workload runs at ~12K IOPS
rather than 56 IOPS.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/apple.c