Re: [PATCH rdma-next v1 09/10] RDMA/core: Update core documentation for locking

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

 



On Mon, Nov 26, 2018 at 11:59:15AM +0200, Gal Pressman wrote:
> On 26-Nov-18 09:48, Leon Romanovsky wrote:
> > From: Parav Pandit <parav@xxxxxxxxxxxx>
> >
> > Describe core documentation for ib_device_mutex, ib_list_rwsem,
> > net_rwsem and compat_dev_sem.
> >
> > Signed-off-by: Parav Pandit <parav@xxxxxxxxxxxx>
> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> > ---
> >  Documentation/infiniband/core_devices.txt | 73 ++++++++++++++++++++++-
> >  1 file changed, 70 insertions(+), 3 deletions(-)
> >
> > diff --git a/Documentation/infiniband/core_devices.txt b/Documentation/infiniband/core_devices.txt
> > index ff28def49ff4..fd98b27dd3d9 100644
> > --- a/Documentation/infiniband/core_devices.txt
> > +++ b/Documentation/infiniband/core_devices.txt
> > @@ -51,7 +51,7 @@ All ib_core_device(s) points to one owner ib_device using driver_data.
> >    | |          | |
> >    | |          | |
> >    | +----------+ |                         (init_net)
> > -  |              |                         ib_device
> > +  | *net         |                         ib_device
> >    | *owner-------------------------+------>+--------------------+<--+
> >    +--------------+                 |       |                    |   |
> >                                     |       |  ib_core_device    |   |
> > @@ -63,12 +63,12 @@ All ib_core_device(s) points to one owner ib_device using driver_data.
> >     +--------------+                |       |  | |          | |  |   |
> >     |              |                |       |  | |          | |  |   |
> >     | device       |                |       |  | +----------+ |  |   |
> > -   | +----------+ |                |       |  |              |  |   |
> > +   | +----------+ |                |       |  | *net         |  |   |
> >     | |          | |                |       |  | *owner--------------+
> >     | |          | |                |       |  +--------------+  |
> >     | |          | |                |       +--------------------+
> >     | +----------+ |                |
> > -   |              |                |
> > +   | *net         |                |
> >     | *owner------------------------+
> >     +--------------+
> >
> > @@ -96,6 +96,73 @@ ib_device
> >  |  | |          | |  |
> >  |  | +----------+ |  |
> >  |  |              |  |
> > +|  | *net         |  |
> >  |  | *owner       |  |
> >  |  +--------------+  |
> >  +--------------------+
> > +
> > +2.3 locking scheme
> > +--------------------------------------------------------
> > +There are three locks involved to provide synchronization between four
> > +operations.
> > +These four operations are
> > +(a) device addition using ib_register_device()
> > +(b) device removal using ib_unregister_device()
> > +(c) net namespace addition using _init_net() notifier
> > +(d) net namespace removal using _exit_net() notifier
> > +
> > +ib_register_device() and ib_unregister_device() work on all net namespaces
> > +to add/remove compat devices. Therefore, they need to hold net_rwsem read
> > +lock so that net namespace doesn't disappear while this compat devices
> > +add/remove occurs.
> > +
> > +Multiple rdma devices of same or different vendors can be enumerated in
> > +parallel trying to add/remove compat devices for a net namespace.
> > +Therefore, protect compat device list operations using compat_rwsem read/write
> > +semaphore.
> > +Even though multiple device enumration is currently guarded using
>
> Hi Leon,

Thanks Gal, I'm resending fixed version now.

Attachment: signature.asc
Description: PGP signature


[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