From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch 3/3] kvm test: long rmap chains Date: Tue, 06 Jul 2010 10:32:14 +0300 Message-ID: <4C32DBFE.80302@redhat.com> References: <20100705181608.720014170@amt.cnet> <20100705181654.755199987@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:19500 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753155Ab0GFHcP (ORCPT ); Tue, 6 Jul 2010 03:32:15 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o667WF08000693 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 6 Jul 2010 03:32:15 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o667WEJo019304 for ; Tue, 6 Jul 2010 03:32:15 -0400 In-Reply-To: <20100705181654.755199987@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: 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