diff options
author | Sebastian Sanchez <sebastian.sanchez@intel.com> | 2017-05-26 15:35:12 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-06-27 23:56:33 +0300 |
commit | 7be85676f1d13c77a7e0c72e04903bfd39580d4f (patch) | |
tree | 4c3abce16a023ce29ad3a0a297d94ccb3decab3a /drivers/infiniband/hw/hfi1/mmu_rb.h | |
parent | 14fe13fcd3afb96b06809f280b586be1c998332c (diff) | |
download | linux-7be85676f1d13c77a7e0c72e04903bfd39580d4f.tar.xz |
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>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/mmu_rb.h')
-rw-r--r-- | drivers/infiniband/hw/hfi1/mmu_rb.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.h b/drivers/infiniband/hw/hfi1/mmu_rb.h index 754f6ebf13fb..f04cec1e99d1 100644 --- a/drivers/infiniband/hw/hfi1/mmu_rb.h +++ b/drivers/infiniband/hw/hfi1/mmu_rb.h @@ -81,7 +81,8 @@ int hfi1_mmu_rb_insert(struct mmu_rb_handler *handler, void hfi1_mmu_rb_evict(struct mmu_rb_handler *handler, void *evict_arg); void hfi1_mmu_rb_remove(struct mmu_rb_handler *handler, struct mmu_rb_node *mnode); -struct mmu_rb_node *hfi1_mmu_rb_extract(struct mmu_rb_handler *handler, - unsigned long addr, unsigned long len); +bool hfi1_mmu_rb_remove_unless_exact(struct mmu_rb_handler *handler, + unsigned long addr, unsigned long len, + struct mmu_rb_node **rb_node); #endif /* _HFI1_MMU_RB_H */ |