public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Daisuke Matsuda <dskmtsd@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
	jgg@ziepe.ca, zyjzyj2000@gmail.com,
	Zhu Yanjun <yanjun.zhu@linux.dev>
Subject: Re: [PATCH for-next v3 2/2] RDMA/rxe: Enable asynchronous prefetch for ODP MRs
Date: Sun, 18 May 2025 08:54:05 +0300	[thread overview]
Message-ID: <20250518055405.GA7435@unreal> (raw)
In-Reply-To: <20250513050405.3456-3-dskmtsd@gmail.com>

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@gmail.com>
> Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.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().

> +{

<...>

> @@ -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?

Thanks

> +
> +	return 0;
>  }
>  
>  int rxe_ib_advise_mr(struct ib_pd *ibpd,
> -- 
> 2.43.0
> 

  reply	other threads:[~2025-05-18  5:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13  5:04 [PATCH for-next v3 0/2] RDMA/rxe: Prefetching pages with explicit ODP Daisuke Matsuda
2025-05-13  5:04 ` [PATCH for-next v3 1/2] RDMA/rxe: Implement synchronous prefetch for ODP MRs Daisuke Matsuda
2025-05-13  5:04 ` [PATCH for-next v3 2/2] RDMA/rxe: Enable asynchronous " Daisuke Matsuda
2025-05-18  5:54   ` Leon Romanovsky [this message]
2025-05-19 11:58     ` Daisuke Matsuda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250518055405.GA7435@unreal \
    --to=leon@kernel.org \
    --cc=dskmtsd@gmail.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=yanjun.zhu@linux.dev \
    --cc=zyjzyj2000@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox