IB/hfi1: Add unique txwait_lock for txreq events
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Mon, 10 Oct 2016 13:14:28 +0000 (06:14 -0700)
committerDoug Ledford <dledford@redhat.com>
Tue, 15 Nov 2016 21:25:59 +0000 (16:25 -0500)
commit4e045572e2c2be674ed7e43cca7ca105e8a22f56
tree9ebe69a7c48b530e40a11a95f6bafa82abe8254e
parenta909d3e636995ba7c349e2ca5dbb528154d4ac30
IB/hfi1: Add unique txwait_lock for txreq events

Profiling suggests that the read_seqbegin() in
the txreq put logic is colliding with other uses
of the iowait lock.

The packet at a time use of this lock dictates a unique
lock to avoid reader/writer collisions when the number
of vTxWait events is low.

In order to support a unique lock the iowait struct embedded
in the QP is extended to remember the lock that protects the queue
head.

The QP destroy removes that QP from any wait list.  It doesn't
need to know the head because of the linked list API, but it does
need to know the lock required to protect the head.

This also opens up the wait logic to have unique per resources locks
which needs to be in future refinement.

Reviewed-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/iowait.h
drivers/infiniband/hw/hfi1/pio.c
drivers/infiniband/hw/hfi1/qp.c
drivers/infiniband/hw/hfi1/verbs.c
drivers/infiniband/hw/hfi1/verbs.h
drivers/infiniband/hw/hfi1/verbs_txreq.c