From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [patch 3/3] kvm test: long rmap chains
Date: Tue, 06 Jul 2010 10:32:14 +0300 [thread overview]
Message-ID: <4C32DBFE.80302@redhat.com> (raw)
In-Reply-To: <20100705181654.755199987@amt.cnet>
On 07/05/2010 09:16 PM, Marcelo Tosatti wrote:
> test long rmap chains
>
> +
> +int main (void)
> +{
> + int i;
> + int nr_pages;
> + void *target_page, *virt_addr;
> +
> + setup_vm();
> +
> + nr_pages = inl(0xd1) / PAGE_SIZE;
> + nr_pages -= 1000;
>
No need to depend on the number of physical pages, since just one page
is used (+ 1/512 page for the pte).
> + target_page = alloc_page();
> +
> + virt_addr = (void *) 0xfffffa000;
> + for (i = 0; i< nr_pages; i++) {
> + install_page(phys_to_virt(read_cr3()), virt_to_phys(target_page),
> + virt_addr);
> + virt_addr += PAGE_SIZE;
> + }
> + printf("created %d mappings\n", nr_pages);
> +
> + virt_addr = (void *) 0xfffffa000;
> + for (i = 0; i< nr_pages; i++) {
> + unsigned long *touch = virt_addr;
> +
> + *touch = 0;
> + virt_addr += PAGE_SIZE;
> + }
> + printf("instantiated mappings\n");
> +
> + virt_addr += PAGE_SIZE;
> + install_pte(phys_to_virt(read_cr3()), 1, virt_addr,
> + 0 | PTE_PRESENT | PTE_WRITE, target_page);
> +
> + *(unsigned long *)virt_addr = 0;
> + printf("PASS\n");
> +
>
Would be nice to add measure the time for this, and fail above some
threshold. Of course it's problematic in automated scenarios where the
host can be overloaded, but still.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2010-07-06 7:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-05 18:16 [patch 0/3] [RESEND] kvm test: test rmap chains Marcelo Tosatti
2010-07-05 18:16 ` [patch 1/3] kvm test: protect fwfcg accesses with spinlock Marcelo Tosatti
2010-07-05 18:16 ` [patch 2/3] kvm test: export vm helpers Marcelo Tosatti
2010-07-05 18:16 ` [patch 3/3] kvm test: long rmap chains Marcelo Tosatti
2010-07-06 7:32 ` Avi Kivity [this message]
2010-07-06 7:27 ` [patch 0/3] [RESEND] kvm test: test " Avi Kivity
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=4C32DBFE.80302@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.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 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.