From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Theurer Subject: Re: patch for virtual machine oriented scheduling(1) Date: Thu, 23 Apr 2009 11:18:37 -0500 Message-ID: <49F094DD.6080703@linux.vnet.ibm.com> References: <820ac2e90904220749p70564f5bof51eb975a5b80959@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: avi@redhat.com, anthony@codemonkey.ws, kvm@vger.kernel.org, mingo@elte.hu To: alex Return-path: Received: from e34.co.us.ibm.com ([32.97.110.152]:38223 "EHLO e34.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753079AbZDWQSl (ORCPT ); Thu, 23 Apr 2009 12:18:41 -0400 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e34.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id n3NGGGPw008391 for ; Thu, 23 Apr 2009 10:16:16 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n3NGIcXD079774 for ; Thu, 23 Apr 2009 10:18:39 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n3NGIbha028112 for ; Thu, 23 Apr 2009 10:18:38 -0600 In-Reply-To: <820ac2e90904220749p70564f5bof51eb975a5b80959@mail.gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: alex wrote: > the following patchs provide an extra control(besides the control of > Linux scheduler) over the execution of vcpu threads. > > In this patch, Xen's credit > scheduler(http://wiki.xensource.com/xenwiki/CreditScheduler) is used. > User can use "cat" and > "echo" command to view and control a guest os' credit. > e.g., > [root@localhost ~]# echo "weight=500" > /proc/kvm/12345 > will change the credit of guest whose qemu process has the pid 12345 to be 500. > > The patch consists of 3 parts: > 1. modification to the standard KVM > 2. modification to the Xen scheduler > 3. helper functions > Just wondering, was it not possible to introduce a new scheduling class in the current scheduler? My impression was that the current scheduler was fairly modular and should allow this. -Andrew > However, some are unnecessary in the latest Linux kernel. > > The difficulties in the ports lie in: > 1. Linux does not provide timer mechanism that the timer function is > bind to a dedicate CPU: > in case of one cpu receives another cpu's schedule timer > expiration, IPI is used to relay it. > 2. before linux 2.6.27, the smp_call_function_xxx() can not be re-entered. > if kvm is sending ipi at the time of relaying timer expiration > information, deadlock would occur in kernel versions below 2.6.27 > > In my implementation, tasklets are used to run the function of > scheduling, and kernel thread is used to send IPI(in kernels above > 2.6.27, this is unnecessary) > > Originally, this code is developed at the release version of KVM-83. > In order to post it, I ported to the latest .git tree. As a result, > modifications to files like external-module-compat-comm.h are omited. > > NOTE: > 1. Because my not having an AMD machine, only intel platforms are tested. > 2. Because sched_setaffinity() is used (while Linux does not export > this symbol), the way of loading kvm modules are changed to be > ./myins > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >