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)
committerJens Axboe <axboe@kernel.dk>
Tue, 1 Mar 2022 17:38:38 +0000 (10:38 -0700)
commitbb1b8171a53cf9247523263f349b906906db5e17
tree23880d1adf77074964711f018218916abb1fbf3e
parent35b4f2b54b2b6e6a12a0a0dd41f2c7489096751a
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