• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/sys/ofed/drivers/infiniband/core/

Lines Matching refs:context

85 static void ib_ucontext_notifier_start_account(struct ib_ucontext *context)
87 atomic_inc(&context->notifier_count);
94 static void ib_ucontext_notifier_end_account(struct ib_ucontext *context)
96 int zero_notifiers = atomic_dec_and_test(&context->notifier_count);
99 !list_empty(&context->no_private_counters)) {
106 down_write(&context->umem_rwsem);
110 if (!atomic_read(&context->notifier_count)) {
112 &context->no_private_counters,
122 up_write(&context->umem_rwsem);
138 item->context->invalidate_range(item, ib_umem_start(item),
146 struct ib_ucontext *context = container_of(mn, struct ib_ucontext, mn);
148 if (!context->invalidate_range)
151 ib_ucontext_notifier_start_account(context);
152 down_read(&context->umem_rwsem);
153 rbt_ib_umem_for_each_in_range(&context->umem_tree, 0,
157 up_read(&context->umem_rwsem);
164 item->context->invalidate_range(item, start, start + PAGE_SIZE);
173 struct ib_ucontext *context = container_of(mn, struct ib_ucontext, mn);
175 if (!context->invalidate_range)
178 ib_ucontext_notifier_start_account(context);
179 down_read(&context->umem_rwsem);
180 rbt_ib_umem_for_each_in_range(&context->umem_tree, address,
183 up_read(&context->umem_rwsem);
184 ib_ucontext_notifier_end_account(context);
191 item->context->invalidate_range(item, start, end);
200 struct ib_ucontext *context = container_of(mn, struct ib_ucontext, mn);
202 if (!context->invalidate_range)
205 ib_ucontext_notifier_start_account(context);
206 down_read(&context->umem_rwsem);
207 rbt_ib_umem_for_each_in_range(&context->umem_tree, start,
210 up_read(&context->umem_rwsem);
225 struct ib_ucontext *context = container_of(mn, struct ib_ucontext, mn);
227 if (!context->invalidate_range)
230 down_read(&context->umem_rwsem);
231 rbt_ib_umem_for_each_in_range(&context->umem_tree, start,
234 up_read(&context->umem_rwsem);
235 ib_ucontext_notifier_end_account(context);
245 int ib_umem_odp_get(struct ib_ucontext *context, struct ib_umem *umem)
259 if (context->tgid != our_pid) {
294 down_write(&context->umem_rwsem);
295 context->odp_mrs_count++;
298 &context->umem_tree);
299 if (likely(!atomic_read(&context->notifier_count)) ||
300 context->odp_mrs_count == 1)
304 &context->no_private_counters);
305 downgrade_write(&context->umem_rwsem);
307 if (context->odp_mrs_count == 1) {
310 * for this context!
312 atomic_set(&context->notifier_count, 0);
313 INIT_HLIST_NODE(&context->mn.hlist);
314 context->mn.ops = &ib_umem_notifiers;
319 ret_val = mmu_notifier_register(&context->mn, mm);
327 up_read(&context->umem_rwsem);
339 up_read(&context->umem_rwsem);
352 struct ib_ucontext *context = umem->context;
363 down_write(&context->umem_rwsem);
366 &context->umem_tree);
367 context->odp_mrs_count--;
380 downgrade_write(&context->umem_rwsem);
381 if (!context->odp_mrs_count) {
385 owning_process = get_pid_task(context->tgid,
401 mmu_notifier_unregister(&context->mn, owning_mm);
409 up_read(&context->umem_rwsem);
443 struct ib_device *dev = umem->context->device;
482 if (umem->context->invalidate_range || !stored_page)
485 if (remove_existing_mapping && umem->context->invalidate_range) {
548 owning_process = get_pid_task(umem->context->tgid, PIDTYPE_PID);
629 struct ib_device *dev = umem->context->device;
664 if (!umem->context->invalidate_range)