[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1720c440-719b-4bc9-9685-148c20d4cdfe@gmail.com>
Date: Mon, 19 May 2025 20:58:14 +0900
From: Daisuke Matsuda <dskmtsd@...il.com>
To: Leon Romanovsky <leon@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-rdma@...r.kernel.org, jgg@...pe.ca,
zyjzyj2000@...il.com, Zhu Yanjun <yanjun.zhu@...ux.dev>
Subject: Re: [PATCH for-next v3 2/2] RDMA/rxe: Enable asynchronous prefetch
for ODP MRs
On 2025/05/18 14:54, Leon Romanovsky wrote:
> On Tue, May 13, 2025 at 05:04:05AM +0000, Daisuke Matsuda wrote:
>> Calling ibv_advise_mr(3) with flags other than IBV_ADVISE_MR_FLAG_FLUSH
>> invokes asynchronous request. It is best-effort, and thus can safely be
>> deferred to the system-wide workqueue.
>>
>> Signed-off-by: Daisuke Matsuda <dskmtsd@...il.com>
>> Reviewed-by: Zhu Yanjun <yanjun.zhu@...ux.dev>
>> ---
>> drivers/infiniband/sw/rxe/rxe_odp.c | 84 ++++++++++++++++++++++++++++-
>> 1 file changed, 82 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/infiniband/sw/rxe/rxe_odp.c b/drivers/infiniband/sw/rxe/rxe_odp.c
>> index 4c98a02d572c..0f3b281a265f 100644
>> --- a/drivers/infiniband/sw/rxe/rxe_odp.c
>> +++ b/drivers/infiniband/sw/rxe/rxe_odp.c
>> @@ -425,6 +425,73 @@ enum resp_states rxe_odp_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)
>> return RESPST_NONE;
>> }
>
> <...>
>
>> +static int rxe_init_prefetch_work(struct ib_pd *ibpd,
>> + enum ib_uverbs_advise_mr_advice advice,
>> + u32 pf_flags, struct prefetch_mr_work *work,
>> + struct ib_sge *sg_list, u32 num_sge)
>
> There is no need one-time called function. It can be embedded into rxe_ib_advise_mr_prefetch().
Certainly.
>
>> +{
>
> <...>
>
>> @@ -475,6 +542,8 @@ static int rxe_ib_advise_mr_prefetch(struct ib_pd *ibpd,
>> u32 flags, struct ib_sge *sg_list, u32 num_sge)
>> {
>
> <...>
>
>> + queue_work(system_unbound_wq, &work->work);
>
> How do you ensure that this work isn't running after RXE is destroyed?
I think we can use per-pd reference counter in struct rxe_pd.
I will fix it in v4.
Thanks,
Daisuke
>
> Thanks
>
>> +
>> + return 0;
>> }
>>
>> int rxe_ib_advise_mr(struct ib_pd *ibpd,
>> --
>> 2.43.0
>>
Powered by blists - more mailing lists