Re: [PATCH 03/32] mlx5: Convert mkey_table to XArray

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

 



On Sun, Feb 24, 2019 at 04:11:30PM +0200, Moni Shoua wrote:
> On Thu, Feb 21, 2019 at 9:22 PM Jason Gunthorpe <jgg@xxxxxxxx> wrote:
> > On Thu, Feb 21, 2019 at 10:17:28AM -0800, Matthew Wilcox wrote:
> > > diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
> > > index 90f1b0bae5b5..3326e07ab7ae 100644
> > > +++ b/drivers/infiniband/hw/mlx5/cq.c
> > > @@ -522,7 +522,7 @@ static int mlx5_poll_one(struct mlx5_ib_cq *cq,
> > >       case MLX5_CQE_SIG_ERR:
> > >               sig_err_cqe = (struct mlx5_sig_err_cqe *)cqe64;
> > >
> > > -             read_lock(&dev->mdev->priv.mkey_table.lock);
> > > +             xa_lock(&dev->mdev->priv.mkey_table);
> > >               mmkey = __mlx5_mr_lookup(dev->mdev,
> > >                                        mlx5_base_mkey(be32_to_cpu(sig_err_cqe->mkey)));
> > >               mr = to_mibmr(mmkey);
> > > @@ -537,7 +537,7 @@ static int mlx5_poll_one(struct mlx5_ib_cq *cq,
> > >                            mr->sig->err_item.expected,
> > >                            mr->sig->err_item.actual);
> > >
> > > -             read_unlock(&dev->mdev->priv.mkey_table.lock);
> > > +             xa_unlock(&dev->mdev->priv.mkey_table);
> > >               goto repoll;
> > >       }
> >
> > I think this xa_lock() should really be
> >
> >   srcu_read_lock(&dev->mr_srcu)
> >
> > Moni?
> >
> When mkey table was implemented as radix_tree I believe that
> read_unlock needed to be replaces with srcu_read_lock() (like in all
> other places that lookup mkeys).
> When mkey table is implemented as xarray I'm not sure. It's not clear
> to me from the documentation what are the requirements.

Can you tell me what else you need from the documentation?
I'd like it to be clear.
https://www.kernel.org/doc/html/latest/core-api/xarray.html#normal-api
(there's unfortunately no anchor for the 'Locking' subsection, so you
have to scroll down a bit).




[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