From: Atsushi SAKAI Subject: [PATCH] Accurate vcpu weighting for credit scheduler Date: Mon, 08 Dec 2008 15:34:34 +0900 Message-ID: <20081208063436.E2C1118062@m025.s.css.fujitsu.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------Boundary_9eDXJllzV8Tx=Rc" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --------------Boundary_9eDXJllzV8Tx=Rc Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi, This patch intends to accurate vcpu weighting for CPU intensive job. The reason of this problem is that vcpu round-robin queue blocks large weight vcpus by small weight vcpus. For example, we assume following case on 2pcpu environment. (with 4domains (each domain has 2vcpus)) dom1 vcpu0,1 w128 credit 4 dom2 vcpu0,1 w128 credit 4 dom3 vcpu0,1 w256 credit 8 dom4 vcpu0,1 w512 credit 15 d4v0 gets 15ms credit each time. but if 3vcpus are blocking,(like d1v0, d2v0, d3v0) d4v0 credit becomes over 30msec(45msec=15x3times). Then d4v0 credit cleared. This makes d4v0 uses smaller credit than expected. This problem also occurs on d4v1 case. (blocked by d1v1, d2v1, d3v1) In my case, xentop shows following % for each domain. dom1 27 dom2 28 dom3 53 dom4 88 After this patch applied, each domain has following %. dom1 25 dom2 25 dom3 49 dom4 99 This patch adds condition that "credit clear function" should work when vcpu is not runnable. sched_credit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) Signed-off-by: Atsushi SAKAI Thanks Atsushi SAKAI --------------Boundary_9eDXJllzV8Tx=Rc Content-Type: application/octet-stream; name="xen-upper-bound-check-when-not-in-runqueue.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="xen-upper-bound-check-when-not-in-runqueue.patch" ZGlmZiAtciAxYjE3MzM5NGY4MTUgeGVuL2NvbW1vbi9zY2hlZF9jcmVkaXQuYwotLS0gYS94 ZW4vY29tbW9uL3NjaGVkX2NyZWRpdC5jCVRodSBEZWMgMDQgMTY6MzY6NDMgMjAwOCArMDAw MAorKysgYi94ZW4vY29tbW9uL3NjaGVkX2NyZWRpdC5jCUZyaSBEZWMgMDUgMjM6Mjg6MDAg MjAwOCArMDkwMApAQCAtOTkxLDggKzk5MSwxMSBAQCBjc2NoZWRfYWNjdCh2b2lkKQogICAg ICAgICAgICAgICAgICAgICBzdmMtPmZsYWdzICY9IH5DU0NIRURfRkxBR19WQ1BVX1BBUktF RDsKICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICAvKiBVcHBlciBib3Vu ZCBvbiBjcmVkaXRzIG1lYW5zIFZDUFUgc3RvcHMgZWFybmluZyAqLwotICAgICAgICAgICAg ICAgIGlmICggY3JlZGl0ID4gQ1NDSEVEX0NSRURJVFNfUEVSX1RTTElDRSApCisgICAgICAg ICAgICAgICAgLyogVXBwZXIgYm91bmQgb24gY3JlZGl0cyBtZWFucyBWQ1BVIHN0b3BzIGVh cm5pbmcsCisgICAgICAgICAgICAgICAgICogd2hlbiBWQ1BVIGlzIG5vdCBpbiBydW5xdWV1 ZS4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBpZiAoIGNyZWRpdCA+ IENTQ0hFRF9DUkVESVRTX1BFUl9UU0xJQ0UgJiYKKyAgICAgICAgICAgICAgICAgICAgICF2 Y3B1X3J1bm5hYmxlKHN2Yy0+dmNwdSkgKQogICAgICAgICAgICAgICAgIHsKICAgICAgICAg ICAgICAgICAgICAgX19jc2NoZWRfdmNwdV9hY2N0X3N0b3BfbG9ja2VkKHN2Yyk7CiAgICAg ICAgICAgICAgICAgICAgIGNyZWRpdCA9IDA7Cg== --------------Boundary_9eDXJllzV8Tx=Rc 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.xensource.com http://lists.xensource.com/xen-devel --------------Boundary_9eDXJllzV8Tx=Rc--