git: nvme - Fix BUF_KERNPROC() SMP race

Matthew Dillon dillon at crater.dragonflybsd.org
Thu Jul 21 22:53:02 PDT 2016


commit a391a14a3472200021bf4616938068c5e9ee2b58
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Wed Jul 20 19:29:06 2016 -0700

    nvme - Fix BUF_KERNPROC() SMP race
    
    * BUF_KERNPROC() must be issued before we submit the request.  The subq
      lock is not sufficient to interlock request completion (which only needs
      the comq lock).
    
    * Only occurs under extreme loads, probably due to an IPI or Xinvltlb
      causing enough of a pause that the completion can run.  NVMe is so fast,
      probably no other controller would hit this particular race condition.
    
    * Also fix a bio queueing race which can leave a bio hanging.  If no
      requests are available (which can only happen under very heavy I/O
      loads), the signaling to the admin thread on the next I/O completion
      can race the queueing of the bio.  Fix the race by making sure the
      admin thread is signalled *after* queueing the bio.

Summary of changes:
 sys/dev/disk/nvme/nvme.c      |  7 +++----
 sys/dev/disk/nvme/nvme_disk.c | 18 ++++++++++++++++--
 2 files changed, 19 insertions(+), 6 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a391a14a3472200021bf4616938068c5e9ee2b58


-- 
DragonFly BSD source repository


More information about the Commits mailing list