apple-nvme: defer cache flushes by a specified amount
authorJens Axboe <axboe@kernel.dk>
Wed, 16 Feb 2022 19:17:58 +0000 (12:17 -0700)
committerHector Martin <marcan@marcan.st>
Sat, 19 Feb 2022 08:30:30 +0000 (17:30 +0900)
commitf24d04a329041132f3a6a08e6268d22eacd07316
treec67c6b3f33b8ca22b45f72e4522201177b2d860d
parent538a79416ab25c7c91f4ae09c044f9405851c0cd
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