From: xinyue Subject: Re: Performance problem about address translation Date: Tue, 7 Jul 2015 11:24:30 +0800 (CST) Message-ID: <1067971165.109277.1436239470649.JavaMail.tomcat@nfs.iscas.ac.cn> Reply-To: xinyue@nfs.iscas.ac.cn Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2379832768111563737==" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZCJxq-0001o1-7T for xen-devel@lists.xenproject.org; Tue, 07 Jul 2015 03:54:34 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "andrew.cooper3" Cc: xen-devel List-Id: xen-devel@lists.xenproject.org --===============2379832768111563737== Content-Type: multipart/alternative; boundary="----=_Part_109276_869176637.1436239470636" ------=_Part_109276_869176637.1436239470636 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =09 =09=09 =09=09 =09=09 =09=09=E5=9C=A8 2015-07-06, Mon, 16:11:02 ,Andrew Cooper =E5=86=99=E5=88=B0= =EF=BC=9A =09 =09=09 =09=09=09On 06/07/2015 08:58, xinyue wrote: =09=09 =09=09=09  =09 =09 =09=09 =09=09=09 =09=09=09=09 =09=09=09=09 =09=09=09=09 =09=09=09=09=E5=9C=A8 2015-07-06, Mon, 15:44:53 ,Andrew Cooper =E5=86=99=E5= =88=B0=EF=BC=9A =09=09=09=09 =09=09=09=09=09On 06/07/2015 08:22, xinyue wrote: =09=09=09=09 =09=09=09=09=09  =09=09=09=09 =09=09=09=09=09 =09=09=09=09=09=09Hi, =09=09=09=09=09=09 =09=09=09=09=09=09    For I want to translate the virtual ad= dress in HVM DomU to virtual address in Xen. But when I use the function pa= ging_gva_to_gfn and get_gfn, I can feel the performance down quickly, the m= achine become very hot and then I have to force the machine shutting down. =09=09=09=09=09=09 =09=09=09=09 =09=09=09=09 =09=09=09=09Your machine clearly isn't cooled sufficiently, which is th= e first problem. =09=09=09=09 =09=09=09=09 =09=09=09=09=09 =09=09=09=09=09=09 =09=09=09=09=09=09The codes I used as below: =09=09=09=09=09=09    uint32_t pfec =3D PFEC_page_present; =09=09=09=09=09=09    unsigned long gfn; =09=09=09=09=09=09    unsigned long mfn; =09=09=09=09=09=09    unsigned long virtaddr; =09=09=09=09=09=09    struct vcpu *vcpu =3D current; =09=09=09=09=09=09    struct domain *d =3D vcpu->domain; =09=09=09=09=09=09    p2m_type_t t; =09=09=09=09=09=09 =09=09=09=09=09=09    gfn =3D paging_gva_to_gfn(current, 0xc= 0290000, &pfec); =09=09=09=09=09=09    mfn =3D get_gfn(d, gfn, &t); =09=09=09=09=09=09    virtaddr =3D map_domain_page(mfn_x(mfn= )); =09=09=09=09=09=09 =09=09=09=09=09=09I also use the dbg_hvm_va2mfn function in debug.c, perfor= mance problem still present. =09=09=09=09=09=09 =09=09=09=09 =09=09=09=09 =09=09=09=09Walking pagetables in software is slow.  There is no getti= ng around this. =09=09=09=09 =09=09=09=09Your performance problems will be caused by performing the oper= ation far too often.  You should find a way to reduce this. =09=09=09=09 =09=09=09=09 =09=09=09=09 =09=09=09=09 =09=09=09=09Thanks very much, I think I only do this for just once. And aft= er the thanslation is done, the performance is not turn to normal. Does tha= t mean that if I wait long enough it will recovery? =09=09 =09=09 =09=09It almost certainly means you are not doing it just once like you sup= pose. =09=09 =09=09~andrew     =09=09 =09=09    Yes, you are right. I added printk in get_gfn and = found it was call many times. I'll check why that happens. Thanks a lot= ! =09=09 =09=09Sorry for mistaking it, the calls of these functions in log appear be= fore I invoke them. These functions that I invoked are through hypercall in= HVM DomU, through the log I think I invoked them only once. Maybe the perf= ormance problem is caused by the parameters I used? Could you help me the c= heck if I used them unproperly as posted before. =09=09 =09=09Another question is when I add printk in paging_gva_to gfn function, = the performance alse down serioursly that it can't even boot hvm domu s= uccessfully. I am wondering why. =09=09 =09=09Thanks again and best regards! =09=09 =09=09And after analyzing the performance of hvm domu, I found a process na= med "evolution-data-" using almost 99.9% cpu. Does someone known = what's this and why it appears? =09=09 =09=09 =09=09 =09=09 =09=09xinyue ------=_Part_109276_869176637.1436239470636 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
=09
=09=09
=09=09
=09=09
=09=09=E5=9C=A8 2015-07-06, Mon, 16:11:02 ,Andrew Cooper =E5=86=99=E5=88=B0= =EF=BC=9A
=09
=09=09
=09=09=09On 06/07/2015 08:58, xinyue wrote:
=09=09
=09=09=09 
=09
=09
=09=09
=09=09=09
=09=09=09=09
=09=09=09=09
=09=09=09=09
=09=09=09=09=E5=9C=A8 2015-07-06, Mon, 15:44:53 ,Andrew Cooper =E5=86=99=E5= =88=B0=EF=BC=9A
=09=09=09=09
=09=09=09=09=09On 06/07/2015 08:22, xinyue wrote:
=09=09=09=09
=09=09=09=09=09 
=09=09=09=09
=09=09=09=09=09
=09=09=09=09=09=09Hi,
=09=09=09=09=09=09
=09=09=09=09=09=09    For I want to translate the virtual ad= dress in HVM DomU to virtual address in Xen. But when I use the function pa= ging_gva_to_gfn and get_gfn, I can feel the performance down quickly, the m= achine become very hot and then I have to force the machine shutting down.<= br /> =09=09=09=09=09=09
=09=09=09=09
=09=09=09=09
=09=09=09=09Your machine clearly isn't cooled sufficiently, which is th= e first problem.
=09=09=09=09
=09=09=09=09
=09=09=09=09=09
=09=09=09=09=09=09
=09=09=09=09=09=09The codes I used as belo= w:
=09=09=09=09=09=09    uint32_t pfec =3D PFEC_page_present; =09=09=09=09=09=09    unsigned long gfn;
=09=09=09=09=09=09    unsigned long mfn;
=09=09=09=09=09=09    unsigned long virtaddr;
=09=09=09=09=09=09    struct vcpu *vcpu =3D current;
=09=09=09=09=09=09    struct domain *d =3D vcpu->domain;<= br /> =09=09=09=09=09=09    p2m_type_t t;
=09=09=09=09=09=09
=09=09=09=09=09=09    gfn =3D paging_gva_to_gfn(current, 0xc= 0290000, &pfec);
=09=09=09=09=09=09    mfn =3D get_gfn(d, gfn, &t);
=09=09=09=09=09=09    virtaddr =3D map_domain_page(mfn_x(mfn= ));
=09=09=09=09=09=09
=09=09=09=09=09=09I also use the dbg_hvm_va2mfn function in debug.c, perfor= mance problem still present.
=09=09=09=09=09=09
=09=09=09=09
=09=09=09=09
=09=09=09=09Walking pagetables in software is slow.  There is no getti= ng around this.
=09=09=09=09
=09=09=09=09Your performance problems will be caused by performing the oper= ation far too often.  You should find a way to reduce this.
=09=09=09=09
=09=09=09=09
=09=09=09=09
=09=09=09=09
=09=09=09=09Thanks very much, I think I only do this for just once. And aft= er the thanslation is done, the performance is not turn to normal. Does tha= t mean that if I wait long enough it will recovery?
=09=09
=09=09
=09=09It almost certainly means you are not doing it just once like you sup= pose.
=09=09
=09=09~andrew    
=09=09
=09=09    Yes, you are right. I added printk in get_gfn and = found it was call many times. I'll check why that happens. Thanks a lot= !
=09=09
=09=09Sorry for mistaking it, the calls of these functions in log appea= r before I invoke them. These functions that I invoked are through hypercal= l in HVM DomU, through the log I think I invoked them only once. Maybe the = performance problem is caused by the parameters I used? Could you help me t= he check if I used them unproperly as posted before.
=09=09
=09=09Another question is when I add printk in paging_gva_to gfn function, = the performance alse down serioursly that it can't even boot hvm domu s= uccessfully. I am wondering why.
=09=09
=09=09Thanks again and best regards!

=09=09
=09=09And after analyzing the performance of hvm domu, I found a pr= ocess named "evolution-data-" using almost 99.9% cpu. Does someon= e known what's this and why it appears?
=09=09
=09=09
=09=09
=09=09
=09=09xinyue
------=_Part_109276_869176637.1436239470636-- --===============2379832768111563737== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============2379832768111563737==--