IB/hfi1: Don't remove RB entry when not needed.
authorSebastian Sanchez <sebastian.sanchez@intel.com>
Fri, 26 May 2017 12:35:12 +0000 (05:35 -0700)
committerDoug Ledford <dledford@redhat.com>
Tue, 27 Jun 2017 20:56:33 +0000 (16:56 -0400)
commit7be85676f1d13c77a7e0c72e04903bfd39580d4f
tree4c3abce16a023ce29ad3a0a297d94ccb3decab3a
parent14fe13fcd3afb96b06809f280b586be1c998332c
IB/hfi1: Don't remove RB entry when not needed.

An RB tree is used for the SDMA pinning cache. Cache
entries are extracted and reinserted from the tree
in case the address range for it changes. However,
if the address range for the entry doesn't change,
deleting the entry from the RB tree is not necessary.

This affects performance since the tree needs to be
rebalanced for each insertion, and this happens in
the hot path. Optimize RB search by not removing
entries when it's not needed.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Mitko Haralanov <mitko.haralanov@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>
drivers/infiniband/hw/hfi1/mmu_rb.c
drivers/infiniband/hw/hfi1/mmu_rb.h
drivers/infiniband/hw/hfi1/user_sdma.c