[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] XEN PV Linux performance



At 22:26 +0800 on 01 Jul (1341181569), Zhou Jacky wrote:
> Hello,
> 
> I see what's the gettimeofday behavior depends on the glic config macro &
> compile.
> I just demonstrate the issue that 64bit PV DomU performance is very poor
> using   gettimeofday .
> In fact, the performance is poor when call read,write, fork,exec and almost
> all system calls.

Yes, system calls from 64-bit PV guests are expensive.  If your guest
doesn't have a lot of memory (less than about 4GB) it's probably faster
to use a 32-bit kernel, which doesn't have this problem.  If it has a
lot of memory, the cost of extra pagetable manipulations may mean that
the 32-bit kernel is actually slower, though.

If you have modern hardware with NPT/EPT, it may be faster to run your
guests in HVM mode with PV drivers (either 32-bit or 64-bit).

As always, it really depends on your workload, and micro-benchamrks
might not be a good predictor of full-system performance.

> A few days ago someone report related issue to xen-devel that fork system
> call has very poor performance.

AIUI that's a particular issue with fork() on PV kernels because of how
the pagetables are updated; I'll leave it to more linuxy people to go
into more detail.

Tim.

> The link as:
> http://lists.xen.org/archives/html/xen-devel/2012-06/msg01010.html
> 
> 2012/7/1 Tim Deegan <tim@xxxxxxx>
> 
> > At 22:54 +0800 on 30 Jun (1341096874), Zhou Jacky wrote:
> > > I re-post this from Xen-User maillist.
> > >
> > > I found that xen PV linux performance is very poor comparing with native
> > > linux or HVMPV linux in some case such as system call (which will cause
> > > context switch).
> > > Here is a very simple sample:
> > >
> > > double geTime() {
> > >         struct timeval t;
> > >         gettimeofday(&t, 0);
> > >         return (double) t.tv_sec + (double) t.tv_usec / 1000000.0;
> > > }
> > >
> > > int geInc(int sum) {
> > >        return sum+1;
> > > }
> > >
> > > int main() {
> > >        for (i=0; i<; i++) {
> > >      geTime();
> > > }
> > >
> > > In PV linux guest, It will be 10 times slower than PVHVM linux guest.
> > >  While call getInc()  10000000 times, PV guest is a little faster then
> > > HVMPV.
> >
> > gettimeofday() is often a vsyscall on native/HVM linux (i.e. it doesn't
> > actually make a system call), and I'm not sure that's the case on PV.
> > You could try coding up an actual system call (in assembly), or using a
> > libc wrapper that always makes a system call (I think getppid() is a
> > good choice but you should use strace to confirm it's making system
> > calls).
> >
> > > So it seems that PV linux guest has poor performance in context switch
> > case.
> >
> > By context switch people usually mean changing from one process to
> > another, which is not what's happening here.
> >
> > > How can I tune this or if there's any plan fixing this issue?
> >
> > That depends -- what's your actual goal?  Do you actually care about
> > gettimeofday() performance or is there some other workload that's
> > running slowly for you?
> >
> > Tim.
> >

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.