Re: a strange lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 03, 2020 at 08:31:10PM +0800, Frank Huang wrote:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/infiniband/core/cma.c#n1832
>
> /*
> * Wait for any active callback to finish.  New callbacks will find
> * the id_priv state set to destroying and abort.
> */
> mutex_lock(&id_priv->handler_mutex);
> mutex_unlock(&id_priv->handler_mutex);
>
> It does nothing between the lock, what 's the meaning of it?

It is a way to implement wait_for_completion paradigm, by ensuring
that all cm_id works or will see RDMA_CM_DESTROYING state (they need
to take handler_mutex, before every call to cma_exch), or will
complete their execution and release handler_mutex.

Thanks



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux