--- - branch: MAIN date: Fri Jun 28 15:08:47 UTC 2019 files: - new: '1.44' old: '1.43' path: src/sys/dev/ic/nvme.c pathrev: src/sys/dev/ic/nvme.c@1.44 type: modified - new: '1.20' old: '1.19' path: src/sys/dev/ic/nvmevar.h pathrev: src/sys/dev/ic/nvmevar.h@1.20 type: modified id: 20190628T150847Z.982dec82ebd0579dbc8cca87e37a4bb37593a0e0 log: "Fix a performance issue where one busy queue can starve all other queues.\n\nIn normal operations with multiple queues, the nvme driver will attempt\nto schedule I/O requests on the submitting CPU. This breaks down when any\none of the queues becomes full; the driver returns EAGAIN to the disk\nlayer, which causes the disk layer to stop submitting more requests until\nthe blocked request is consumed. When space becomes available in the full\nqueue, it pulls the next buffer from the bufq and fills the queue again,\nuntil finally hitting EAGAIN and preventing other queues from processing\nrequests.\n\nTwo changes here to fix the problem:\n\n - When processing requests from the bufq, attempt to assign them to the\n queue associated with the CPU that originated the request.\n - If that queue is busy, try to find another queue with available space\n before returning EAGAIN. This way, only when all queues are full will\n the disk layer stop submitting more requests.\n\nNow for some real numbers. On a Rockchip RK3399 board (6 CPUs), with 6\nconcurrent readers:\n\nOld code:\n\t4294967296 bytes transferred in 52.420 secs (81933752 bytes/sec)\n\t4294967296 bytes transferred in 53.969 secs (79582117 bytes/sec)\n\t4294967296 bytes transferred in 55.391 secs (77539082 bytes/sec)\n\t4294967296 bytes transferred in 55.649 secs (77179595 bytes/sec)\n\t4294967296 bytes transferred in 56.102 secs (76556402 bytes/sec)\n\t4294967296 bytes transferred in 72.901 secs (58915066 bytes/sec)\n\nNew code:\n\t4294967296 bytes transferred in 37.171 secs (115546186 bytes/sec)\n\t4294967296 bytes transferred in 37.611 secs (114194445 bytes/sec)\n\t4294967296 bytes transferred in 37.655 secs (114061009 bytes/sec)\n\t4294967296 bytes transferred in 38.247 secs (112295534 bytes/sec)\n\t4294967296 bytes transferred in 38.496 secs (111569183 bytes/sec)\n\t4294967296 bytes transferred in 38.595 secs (111282997 bytes/sec)\n" module: src subject: 'CVS commit: src/sys/dev/ic' unixtime: '1561734527' user: jmcneill