diff options
author | Brendan Cunningham <bcunningham@cornelisnetworks.com> | 2023-05-19 19:54:19 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2023-06-01 20:45:57 +0300 |
commit | e236e2eae52e1e7fb0d38b8d921b04e527151b73 (patch) | |
tree | e6812bb12f1392d2ab5db87b7d15de410890c60d /drivers/infiniband/hw/hfi1/mmu_rb.c | |
parent | c9358de193ecfb360c3ce75f27ce839ca0b0bc8c (diff) | |
download | linux-e236e2eae52e1e7fb0d38b8d921b04e527151b73.tar.xz |
IB/hfi1: Add mmu_rb_node refcount to hfi1_mmu_rb_template tracepoints
Add kref_read() of mmu_rb_node.refcount in hfi1_mmu_rb_template-type
tracepoint output.
Change hfi1_mmu_rb_template tracepoint to take a struct mmu_rb_node* and
record the values it needs from that. This makes the trace_hfi1_mmu*()
calls shorter and easier to read.
Add hfi1_mmu_release_node() tracepoint before all
mmu_rb_node->handler->ops->remove() calls.
Make hfi1_mmu_rb_search() tracepoint its own tracepoint type separate
from hfi1_mmu_rb_template since hfi1_mmu_rb_search() does not take a
struct mmu_rb_node*.
Link: https://lore.kernel.org/r/168451525987.3702129.12824880387615916700.stgit@awfm-02.cornelisnetworks.com
Reviewed-by: Dean Luick <dean.luick@cornelisnetworks.com>
Signed-off-by: Brendan Cunningham <bcunningham@cornelisnetworks.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/mmu_rb.c')
-rw-r--r-- | drivers/infiniband/hw/hfi1/mmu_rb.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.c b/drivers/infiniband/hw/hfi1/mmu_rb.c index a864423c256d..7a51f7d73b61 100644 --- a/drivers/infiniband/hw/hfi1/mmu_rb.c +++ b/drivers/infiniband/hw/hfi1/mmu_rb.c @@ -124,7 +124,7 @@ int hfi1_mmu_rb_insert(struct mmu_rb_handler *handler, unsigned long flags; int ret = 0; - trace_hfi1_mmu_rb_insert(mnode->addr, mnode->len); + trace_hfi1_mmu_rb_insert(mnode); if (current->mm != handler->mn.mm) return -EPERM; @@ -189,6 +189,7 @@ static void release_immediate(struct kref *refcount) { struct mmu_rb_node *mnode = container_of(refcount, struct mmu_rb_node, refcount); + trace_hfi1_mmu_release_node(mnode); mnode->handler->ops->remove(mnode->handler->ops_arg, mnode); } @@ -252,6 +253,7 @@ void hfi1_mmu_rb_evict(struct mmu_rb_handler *handler, void *evict_arg) spin_unlock_irqrestore(&handler->lock, flags); list_for_each_entry_safe(rbnode, ptr, &del_list, list) { + trace_hfi1_mmu_rb_evict(rbnode); kref_put(&rbnode->refcount, release_immediate); } } @@ -271,7 +273,7 @@ static int mmu_notifier_range_start(struct mmu_notifier *mn, /* Guard against node removal. */ ptr = __mmu_int_rb_iter_next(node, range->start, range->end - 1); - trace_hfi1_mmu_mem_invalidate(node->addr, node->len); + trace_hfi1_mmu_mem_invalidate(node); /* Remove from rb tree and lru_list. */ __mmu_int_rb_remove(node, root); list_del_init(&node->list); @@ -304,6 +306,7 @@ static void handle_remove(struct work_struct *work) while (!list_empty(&del_list)) { node = list_first_entry(&del_list, struct mmu_rb_node, list); list_del(&node->list); + trace_hfi1_mmu_release_node(node); handler->ops->remove(handler->ops_arg, node); } } |