]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Refactor command ordering/blocking mechanism in CTL.
authormav <mav@FreeBSD.org>
Wed, 27 Feb 2019 21:29:21 +0000 (21:29 +0000)
committermav <mav@FreeBSD.org>
Wed, 27 Feb 2019 21:29:21 +0000 (21:29 +0000)
commit7fb02bfbe5c617adec375ff96196e0f103b48480
tree1f153466285952e991ed41a0a9e8c32bcad423a7
parentf3703ec6657c41e8a0d377be6bae3e59ef06d987
Refactor command ordering/blocking mechanism in CTL.

Replace long per-LUN queue of blocked commands, scanned on each command
completion and sometimes even twice, causing up to O(n^^2) processing cost,
by much shorter per-command blocked queues, scanned only when respective
command completes, and check only commands before the previous blocker,
reducing cost to O(n).

While there, unblock aborted commands to make them "complete" ASAP to be
removed from the OOA queue and so not waste time ordering other commands
against them.  Aborted commands that were not sent to execution yet should
have no visible side effects, so this is safe and easy optimization now,
comparing to commands already in processing, which are a still pain.

Together those two optimizations should fix quite pathological case, when
due to backend slowness CTL accumulated many thousands of blocked requests,
partially aborted by initiator and so supposedly not even existing, but
still wasting CTL CPU time.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
sys/cam/ctl/ctl.c
sys/cam/ctl/ctl_frontend_ioctl.c
sys/cam/ctl/ctl_io.h
sys/cam/ctl/ctl_private.h