All of lore.kernel.org
 help / color / mirror / Atom feed
From: NISHIGUCHI Naoki <nisiguti@jp.fujitsu.com>
To: "Su, Disheng" <disheng.su@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"Ian.Pratt@eu.citrix.com" <Ian.Pratt@eu.citrix.com>,
	"aviv@neocleus.com" <aviv@neocleus.com>,
	"keir.fraser@eu.citrix.com" <keir.fraser@eu.citrix.com>,
	"sakaia@jp.fujitsu.com" <sakaia@jp.fujitsu.com>
Subject: Re: RE: [RFC][PATCH 0/4] Modification of credit scheduler rev2
Date: Thu, 15 Jan 2009 11:04:41 +0900	[thread overview]
Message-ID: <496E99B9.3010906@jp.fujitsu.com> (raw)
In-Reply-To: <BB1F052FCDB1EA468BD99786C8B1ED2C01D260D043@PDSMSX501.ccr.corp.intel.com>

Hi Disheng,

Thank you for evaluating patches and reporting results.

Su, Disheng wrote:
> Hi Naoki,
> 	Thanks for your excellent work.
> 	This days, I tested the playing audio/video with your patches. With the default credit scheduler, the audio effect is really bad(a lot of audio glitches). But I got a better result with your patches. I list my findings here, FYI.
> 
> 	1. What's the latency requirement for audio? I am not good at this one:) I find some links regarding to it( http://www.soundonsound.com/sos/jan05/articles/pcmusician.htm and http://www.podcomplex.com/blog/setting-buffers-and-latency-for-your-audio-interface/).  In native env, setting the buffer size of audio hardware to produce a latency of 23ms is acceptable even for many musicians. It's safe to say we have to schedule in the VM for each 23ms for such case in virtual env when playing audio in VM. Even worse for Vista, which has 10ms requirement ( http://blogs.technet.com/markrussinovich/archive/2007/08/27/1833290.aspx ). Apparently, the default credit scheduler can't handle well for this case.

Thanks for your information.
I'll see these links.

> 	2. Test env:
> 		hardware: 
> 			Cpu: INTEL Core 2 Duo E6850
> 			Chipset: 82G33
> 			Memory: 2G
> 		software:
> 			Xen upstream(cs: 18881)
> 		doms configuration:
> 			guest A: primary HVM guest(integreted graphic card, sound, USB controller directly assigned), playing mp3 with WMP in foreground + copying large files(e.g. 2G) in background. 2 vcpus, 1G memory. Guest OS is Windows XP or Vista.
> 			guest B: secondary HVM guest(also copying large files in guest, no devices assigned). 2 vcpus, 128M memory. Guest OS is Windows XP.
> 	
> 	3. Configure the scheduler and Xen:
> 		a. the weight of guest B must be lower as much as possible(e.g. 10 for it, but 256 for guest A and dom0). Guest B is competing with Guest A for dom0. The lower the weight, the lesser chance to be scheduled in. 
> 		b. the boost credit needs to be larger as much as possible.(e.g 1000 for both primary guest and dom0). To make sure the guest A stays in boost priority longer when doing heavy I/O.
> 		c. vcpus of guest A need to be pinned to physical cpu. Without pinned and guest is smp, the scheduler will dynamically migrate vcpus between physcial cpus, and the audio glitches is also obvious. One of possible reason is high freq of migration and the small runtime when the vcpu be scheduled in. The migration rate is about 60~110 per second, and each migration has the migration cost(such as cache, TLB miss, etc..). And the runtime is small, 90% of runtime is less than 30us. It sounds not reasonable to migrate a vcpu, but it just runs for a tens of microseconds.
> 	With this configuration, both xp/vista guest works well, no glitches usually.
> 	
> 	4. issues left:
> 		a. Abrupt glitches are still generated when the QEMU emulated mouse being used and moving mouse quickly in guest A. Passing-through USB mouse/keyboard to guest A, then no glitches.

I also noticed that. Though I don't know the precise cause, I found that 
dom0 and guest A would consume largely CPU time (hundreds of 
milliseconds) in such situation. In this case, the priority of dom0 and 
guest A falls rapidly, then guest B runs until the priority of dom0 and 
guest A becomes BOOST. In worst case, it will take about 120ms.

I tried to solve this issue as follows, but the scheduler correctly 
didn't schedule according to the weight of a domain.
- In csched_schedule(), if a vcpu runs over current time slice then the 
time slice is subtracted from the vcpu's credit.

I think to need investigate deeply.

> 		b. vcpu migration. As said before, without vcpu pinned, glitches are obvious.

I think that this issue would be solved by adding the condition for 
migrating the vcpu.
e.g. If the vcpu has boost credit, don't migrate the vcpu.

I'll try to test.

> 		c. the limitation of weight for guest B. I have to set the weight of guest B to 10. It may not be reasonable in real usage case.

Is copying large files in background on guest A indispensable?
In my test, guest A runs only video playing.
I think that my approach couldn't solve this issue.

> 	Do you have the experience with audio? I don't know I have properly configured your scheduler or not. Hope the your scheduler can solve the audio issues also.

Sorry, I don't have the experience with audio.
But I'll try to reproduce your configuration and investigate.

Regards,
Naoki Nishiguchi

> 
> NISHIGUCHI Naoki wrote:
>> Hi all,
>>
>> The patchset is revised version of patches that I was posted 10 days
>> ago. This patchset is consist of the following 4 patches.
>>
>> 1. Subtract credit consumed accurately and shorten cpu time per one
>> credit 
>> 2. Change the handling of credits over upper bound.
>> 3. Balance credits of each vcpu of a domain
>> 4. Introduce boost credit for latency-sensitive domain
>>
>> It was not possible to separate these cleanly.
>> Please apply these patches in numerical order.
>>
>> Please review these patches.
>> Any comments are appreciated.
>>
>> Best regards,
>> Naoki Nishiguchi
> 
> 
> 
> Best Regards,
> Disheng, Su
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

  reply	other threads:[~2009-01-15  2:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-18  2:57 [RFC][PATCH 0/4] Modification of credit scheduler rev2 NISHIGUCHI Naoki
2008-12-18  3:00 ` [RFC][PATCH 1/4] sched: more accurate credit scheduling NISHIGUCHI Naoki
2008-12-18  3:02 ` [RFC][PATCH 2/4] sched: change the handling of credits over upper bound NISHIGUCHI Naoki
2008-12-18  3:04 ` [RFC][PATCH 3/4] sched: balance credits of each vcpu of a domain NISHIGUCHI Naoki
2008-12-18  3:06 ` [RFC][PATCH 4/4] sched: introduce boost credit for latency-sensitive domain NISHIGUCHI Naoki
2009-01-13  8:10 ` [RFC][PATCH 0/4] Modification of credit scheduler rev2 Su, Disheng
2009-01-15  2:04   ` NISHIGUCHI Naoki [this message]
2009-01-15  2:56     ` Tian, Kevin
2009-01-15  4:42       ` NISHIGUCHI Naoki
2009-01-15  5:04         ` Tian, Kevin
2009-01-15  6:05           ` NISHIGUCHI Naoki
2009-01-15  6:41             ` Tian, Kevin
2009-01-15  7:01               ` NISHIGUCHI Naoki
2009-01-15  7:04                 ` Tian, Kevin
2009-01-15  4:55     ` Su, Disheng
2009-01-15  5:19       ` NISHIGUCHI Naoki

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=496E99B9.3010906@jp.fujitsu.com \
    --to=nisiguti@jp.fujitsu.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Pratt@eu.citrix.com \
    --cc=aviv@neocleus.com \
    --cc=disheng.su@intel.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=sakaia@jp.fujitsu.com \
    --cc=xen-devel@lists.xensource.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.