lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZLrSjWDjQLUuREqY@nvidia.com>
Date:   Fri, 21 Jul 2023 15:46:37 -0300
From:   Jason Gunthorpe <jgg@...dia.com>
To:     "Daisuke Matsuda (Fujitsu)" <matsuda-daisuke@...itsu.com>
Cc:     "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
        "leonro@...dia.com" <leonro@...dia.com>,
        "zyjzyj2000@...il.com" <zyjzyj2000@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "rpearsonhpe@...il.com" <rpearsonhpe@...il.com>,
        "Xiao Yang (Fujitsu)" <yangx.jy@...itsu.com>,
        "Zhijian Li (Fujitsu)" <lizhijian@...itsu.com>,
        "Yasunori Gotou (Fujitsu)" <y-goto@...itsu.com>
Subject: Re: [PATCH for-next v5 5/7] RDMA/rxe: Allow registering MRs for
 On-Demand Paging

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ