]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - include/rdma/rdma_vt.h
IB/hfi1: Optimize kthread pointer locking when queuing CQ entries
authorSebastian Sanchez <sebastian.sanchez@intel.com>
Wed, 2 May 2018 13:43:39 +0000 (06:43 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
commit4eac9bb21b8481eb12d96423ab63374c95cf70b3
treeb779df829f6eed0d03c61ddb3fcf053215fcb705
parentfd295e454d73adb5ea434968daa6c2175351a939
IB/hfi1: Optimize kthread pointer locking when queuing CQ entries

BugLink: http://bugs.launchpad.net/bugs/1807469
commit af8aab71370a692eaf7e7969ba5b1a455ac20113 upstream.

All threads queuing CQ entries on different CQs are unnecessarily
synchronized by a spin lock to check if the CQ kthread worker hasn't
been destroyed before queuing an CQ entry.

The lock used in 6efaf10f163d ("IB/rdmavt: Avoid queuing work into a
destroyed cq kthread worker") is a device global lock and will have
poor performance at scale as completions are entered from a large
number of CPUs.

Convert to use RCU where the read side of RCU is rvt_cq_enter() to
determine that the worker is alive prior to triggering the
completion event.
Apply write side RCU semantics in rvt_driver_cq_init() and
rvt_cq_exit().

Fixes: 6efaf10f163d ("IB/rdmavt: Avoid queuing work into a destroyed cq kthread worker")
Cc: <stable@vger.kernel.org> # 4.14.x
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/infiniband/sw/rdmavt/cq.c
include/rdma/rdma_vt.h