Re: [PATCH rdma-next v1 5/6] RDMA/mlx5: Change check for cacheable user mkeys

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

 




On 31/01/2024 17:23, Jason Gunthorpe wrote:
On Wed, Jan 31, 2024 at 04:35:17PM +0200, Michael Guralnik wrote:
On 31/01/2024 16:18, Jason Gunthorpe wrote:
On Wed, Jan 31, 2024 at 02:50:03PM +0200, Michael Guralnik wrote:
On 29/01/2024 19:52, Jason Gunthorpe wrote:
On Sun, Jan 28, 2024 at 11:29:15AM +0200, Leon Romanovsky wrote:
From: Or Har-Toov <ohartoov@xxxxxxxxxx>

In the dereg flow, UMEM is not a good enough indication whether an MR
is from userspace since in mlx5_ib_rereg_user_mr there are some cases
when a new MR is created and the UMEM of the old MR is set to NULL.
Why is this a problem though? The only thing the umem has to do is to
trigger the UMR optimization. If UMR is not triggered then the mkey is
destroyed and it shouldn't be part of the cache at all.
The problem is that it doesn't trigger the UMR on mkeys that are dereged
from the rereg flow.
Optimally, we'd want them to return to the cache, if possible.
Right, so you suggest changing the umem and umr_can_load into
is_cacheable_mkey() and carefully ensuring the rb_key.ndescs is
zero for non-umrable?
Yes. The code is already written trying to ensure this and we've rephrased
a comment in the previous patch to describe this more accurately.
But then I wonder why does cache_ent become NULL but the rb_key.ndesc
is set? That seems pretty confusing.

I think we did it only in the flow where we destroy the mkey to mark mkeys
that were not returned to the cache.

Do you think it'll be better if we switch to marking this explicitly?
Add a flag to the mkey that marks it as a cachable mkey and we'll make this
decision per mkey creation.
Then we can stop relying on the value of other variables to decide what
goes back to cache.


Michael





[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