All of lore.kernel.org
 help / color / mirror / Atom feed
* why use _ucma_find_context in ucma_destroy_id?
@ 2020-02-05 10:41 Frank Huang
  2020-02-05 19:20 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Frank Huang @ 2020-02-05 10:41 UTC (permalink / raw)
  To: linux-rdma

hi, all

I found that in ucma_destroy_id when using struct ucma_context not use in pair.

1,
https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/tree/drivers/infiniband/core/ucma.c#n611

in line 611 ,use _ucma_find_context, do not call ucma_get_ctx

2,
https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/tree/drivers/infiniband/core/ucma.c#n629

in line 629, use ucma_put_ctx

will this cause an unexpect wait?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: why use _ucma_find_context in ucma_destroy_id?
  2020-02-05 10:41 why use _ucma_find_context in ucma_destroy_id? Frank Huang
@ 2020-02-05 19:20 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2020-02-05 19:20 UTC (permalink / raw)
  To: Frank Huang; +Cc: linux-rdma

On Wed, Feb 05, 2020 at 06:41:39PM +0800, Frank Huang wrote:
> hi, all
> 
> I found that in ucma_destroy_id when using struct ucma_context not use in pair.
> 
> 1,
> https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/tree/drivers/infiniband/core/ucma.c#n611
> 
> in line 611 ,use _ucma_find_context, do not call ucma_get_ctx
> 
> 2,
> https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/tree/drivers/infiniband/core/ucma.c#n629
> 
> in line 629, use ucma_put_ctx
> 
> will this cause an unexpect wait?

It deserves a comment, but the ucma_put_ctx() in ucma_destroy_id pairs
with the atomic_set(1) in ucma_alloc_ctx()

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-05 19:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 10:41 why use _ucma_find_context in ucma_destroy_id? Frank Huang
2020-02-05 19:20 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.