From: David Vrabel <david.vrabel@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xenproject.org,
Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCHv6 3/3] xen/privcmd: improve performance of MMAPBATCH_V2
Date: Mon, 9 Mar 2015 15:25:01 +0000 [thread overview]
Message-ID: <54FDBB4D.1000606@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1503061754300.9880@kaball.uk.xensource.com>
On 09/03/15 12:25, Stefano Stabellini wrote:
> On Fri, 6 Mar 2015, David Vrabel wrote:
>>
>> +/*
>> + * Similar to traverse_pages, but use each page as a "block" of
>> + * data to be processed as one unit.
>> + */
>> +static int traverse_pages_block(unsigned nelem, size_t size,
>> + struct list_head *pos,
>> + int (*fn)(void *data, int nr, void *state),
>> + void *state)
>> +{
>> + void *pagedata;
>> + unsigned pageidx;
>> + int ret = 0;
>> +
>> + BUG_ON(size > PAGE_SIZE);
>
> I looks like that PAGE_SIZE needs to be a multiple of size. Maybe we can
> add a BUG_ON for that too.
There is no such requirement because...
>> + pageidx = PAGE_SIZE;
>> +
>> + while (nelem) {
>> + int nr = (PAGE_SIZE/size);
...the number of elements per pages is rounded down here.
>> + struct page *page;
>> + if (nr > nelem)
>> + nr = nelem;
>> + pos = pos->next;
>> + page = list_entry(pos, struct page, lru);
>> + pagedata = page_address(page);
>> + ret = (*fn)(pagedata, nr, state);
>> + if (ret)
>> + break;
>> + nelem -= nr;
>> + }
>> +
>> + return ret;
>> +}
David
prev parent reply other threads:[~2015-03-09 15:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 12:58 [PATCHv6 0/3] xen: improve migration performance David Vrabel
2015-03-06 12:58 ` [PATCHv6 1/3] arm: make __get_user() work for 8 byte values David Vrabel
2015-03-06 12:58 ` David Vrabel
2015-03-09 19:04 ` Russell King - ARM Linux
2015-03-09 19:04 ` Russell King - ARM Linux
2015-03-06 12:58 ` [PATCHv6 2/3] xen: unify foreign GFN map/unmap for auto-xlated physmap guests David Vrabel
2015-03-06 15:51 ` Konrad Rzeszutek Wilk
2015-03-06 17:37 ` David Vrabel
2015-03-06 17:51 ` Stefano Stabellini
2015-03-06 17:58 ` David Vrabel
2015-03-09 11:16 ` Stefano Stabellini
2015-03-06 12:58 ` [PATCHv6 3/3] xen/privcmd: improve performance of MMAPBATCH_V2 David Vrabel
2015-03-09 12:25 ` Stefano Stabellini
2015-03-09 13:18 ` David Vrabel
2015-03-09 15:53 ` Stefano Stabellini
2015-03-09 15:25 ` David Vrabel [this message]
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=54FDBB4D.1000606@citrix.com \
--to=david.vrabel@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.