linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Daisuke Matsuda (Fujitsu)" <matsuda-daisuke@fujitsu.com>
Cc: "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"leonro@nvidia.com" <leonro@nvidia.com>,
	"zyjzyj2000@gmail.com" <zyjzyj2000@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"rpearsonhpe@gmail.com" <rpearsonhpe@gmail.com>,
	"Xiao Yang (Fujitsu)" <yangx.jy@fujitsu.com>,
	"Zhijian Li (Fujitsu)" <lizhijian@fujitsu.com>,
	"Yasunori Gotou (Fujitsu)" <y-goto@fujitsu.com>
Subject: Re: [PATCH for-next v5 5/7] RDMA/rxe: Allow registering MRs for On-Demand Paging
Date: Fri, 21 Jul 2023 15:46:37 -0300	[thread overview]
Message-ID: <ZLrSjWDjQLUuREqY@nvidia.com> (raw)
In-Reply-To: <OS7PR01MB11804670384E92E0CAC2E5E32E539A@OS7PR01MB11804.jpnprd01.prod.outlook.com>

On Wed, Jul 19, 2023 at 06:00:50AM +0000, Daisuke Matsuda (Fujitsu) wrote:
> On Tue, June 13, 2023 1:19 AM Jason Gunthorpe wrote:
> 
> Sorry for my long silence.
> I must spend most of my time for other works these days,
> but I am still willing to complete this and subsequent works.
> 
> > 
> > On Thu, May 18, 2023 at 05:21:50PM +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 lower, upper, idx;
> > > +	struct page *page;
> > > +
> > > +	lower = rxe_mr_iova_to_index(mr, start);
> > > +	upper = rxe_mr_iova_to_index(mr, end);
> > > +
> > > +	/* make pages visible in xarray. no sleep while taking the lock */
> > > +	spin_lock(&mr->page_list.xa_lock);
> > > +	for (idx = lower; idx <= upper; idx++) {
> > > +		page = hmm_pfn_to_page(pfn_list[idx]);
> > > +		__xa_store(&mr->page_list, idx, page, GFP_ATOMIC);
> > 
> > All of these loops can be performance improved a lot by using xas
> > loops
> 
> Well, do you mean I should use 'xas_for_each()' here?
> That is the same 'for-loop' after all, so performance may not be improved.
> Additionally, the 'idx' value above must be counted separately in that case.

xa_store is O(n log(n)), xas_store()/xas_next() more like O(n) per
store operation.

Jason

  reply	other threads:[~2023-07-21 18:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18  8:21 [PATCH for-next v5 0/7] On-Demand Paging on SoftRoCE Daisuke Matsuda
2023-05-18  8:21 ` [PATCH for-next v5 1/7] RDMA/rxe: Always defer tasks on responder and completer to workqueue Daisuke Matsuda
2023-05-18  8:26   ` Daisuke Matsuda (Fujitsu)
2023-05-18 22:25   ` Bob Pearson
2023-05-18  8:21 ` [PATCH for-next v5 2/7] RDMA/rxe: Make MR functions accessible from other rxe source code Daisuke Matsuda
2023-05-18 22:28   ` Bob Pearson
2023-05-18  8:21 ` [PATCH for-next v5 3/7] RDMA/rxe: Move resp_states definition to rxe_verbs.h Daisuke Matsuda
2023-05-18 22:30   ` Bob Pearson
2023-05-18  8:21 ` [PATCH for-next v5 4/7] RDMA/rxe: Add page invalidation support Daisuke Matsuda
2023-05-19 17:08   ` Bob Pearson
2023-05-18  8:21 ` [PATCH for-next v5 5/7] RDMA/rxe: Allow registering MRs for On-Demand Paging Daisuke Matsuda
2023-05-19 17:09   ` Bob Pearson
2023-06-12 16:18   ` Jason Gunthorpe
2023-07-19  6:00     ` Daisuke Matsuda (Fujitsu)
2023-07-21 18:46       ` Jason Gunthorpe [this message]
2023-05-18  8:21 ` [PATCH for-next v5 6/7] RDMA/rxe: Add support for Send/Recv/Write/Read with ODP Daisuke Matsuda
2023-05-19 17:10   ` Bob Pearson
2023-05-19 17:10   ` Bob Pearson
2023-06-12 16:22   ` Jason Gunthorpe
2023-07-19  6:01     ` Daisuke Matsuda (Fujitsu)
2023-09-08  6:35     ` Daisuke Matsuda (Fujitsu)
2023-09-08 13:14       ` Jason Gunthorpe
2023-05-18  8:21 ` [PATCH for-next v5 7/7] RDMA/rxe: Add support for the traditional Atomic operations " Daisuke Matsuda
2023-05-22 18:49   ` Bob Pearson
2023-05-19  6:41 ` [PATCH for-next v5 0/7] On-Demand Paging on SoftRoCE Guoqing Jiang
2023-05-19  9:57   ` Daisuke Matsuda (Fujitsu)
2023-05-19 10:20     ` Guoqing Jiang

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=ZLrSjWDjQLUuREqY@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=leonro@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lizhijian@fujitsu.com \
    --cc=matsuda-daisuke@fujitsu.com \
    --cc=rpearsonhpe@gmail.com \
    --cc=y-goto@fujitsu.com \
    --cc=yangx.jy@fujitsu.com \
    --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;
as well as URLs for NNTP newsgroup(s).