• Jason Gunthorpe's avatar
    RDMA/mlx5: Use SRCU properly in ODP prefetch · fb985e27
    Jason Gunthorpe authored
    When working with SRCU protected xarrays the xarray itself should be the
    SRCU 'update' point. Instead prefetch is using live as the SRCU update
    point and this prevents switching the locking design to use the xarray
    instead.
    
    To solve this the prefetch must only read from the xarray once, and hold
    on to the actual MR pointer for the duration of the async
    operation. Incrementing num_pending_prefetch delays destruction of the MR,
    so it is suitable.
    
    Prefetch calls directly to the pagefault_mr using the MR pointer and only
    does a single xarray lookup.
    
    All the testing if a MR is prefetchable or not is now done only in the
    prefetch code and removed from the pagefault critical path.
    
    Link: https://lore.kernel.org/r/20191009160934.3143-2-jgg@ziepe.caReviewed-by: default avatarArtemy Kovalyov <artemyko@mellanox.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
    fb985e27
odp.c 45.1 KB