[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241209193358.GE2368570@nvidia.com>
Date: Mon, 9 Dec 2024 15:33:58 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: Daisuke Matsuda <matsuda-daisuke@...itsu.com>
Cc: linux-rdma@...r.kernel.org, leon@...nel.org, zyjzyj2000@...il.com,
linux-kernel@...r.kernel.org, rpearsonhpe@...il.com,
lizhijian@...itsu.com
Subject: Re: [PATCH for-next v8 4/6] RDMA/rxe: Allow registering MRs for
On-Demand Paging
On Wed, Oct 09, 2024 at 10:59:01AM +0900, Daisuke Matsuda wrote:
> +static void rxe_mr_set_xarray(struct rxe_mr *mr, unsigned long start,
> + unsigned long end, unsigned long *pfn_list)
> +{
> + unsigned long upper = rxe_mr_iova_to_index(mr, end - 1);
> + unsigned long lower = rxe_mr_iova_to_index(mr, start);
> + void *page, *entry;
> +
> + XA_STATE(xas, &mr->page_list, lower);
> +
> + xas_lock(&xas);
> + while (xas.xa_index <= upper) {
> + if (pfn_list[xas.xa_index] & HMM_PFN_WRITE) {
> + page = xa_tag_pointer(hmm_pfn_to_page(pfn_list[xas.xa_index]),
> + RXE_ODP_WRITABLE_BIT);
> + } else
> + page = hmm_pfn_to_page(pfn_list[xas.xa_index]);
Like here:
> + rxe_mr_set_xarray(mr, user_va, user_va + bcnt, umem_odp->pfn_list);
So this is just copying the pfn_list to the xarray? Why not just
directly use pfn_list instead?
Though, you'd have to lock it with the mutex, is that the issue?
Jason
Powered by blists - more mailing lists