From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: Is guest OS oriented scheduling welcome? Date: Fri, 24 Apr 2009 08:16:54 -0500 Message-ID: <49F1BBC6.4010906@codemonkey.ws> References: <820ac2e90904232310g48a978f0wb482deae064aed97@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, kvm@vger.kernel.org To: alex Return-path: Received: from mail-gx0-f166.google.com ([209.85.217.166]:48585 "EHLO mail-gx0-f166.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756685AbZDXNQ6 (ORCPT ); Fri, 24 Apr 2009 09:16:58 -0400 Received: by gxk10 with SMTP id 10so2251652gxk.13 for ; Fri, 24 Apr 2009 06:16:57 -0700 (PDT) In-Reply-To: <820ac2e90904232310g48a978f0wb482deae064aed97@mail.gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: alex wrote: > just now, I tried cgroup. I admit that as far as only CPU share is > concerned, cgroup is enough. > > However, AFAIK Linux schedules each thread independently, ignoring the > upper level logic. > > for example, suppose VM1 is an SMP one, and it is used to receive > network packets, which causes it run the TCP/IP stack code frequently. > The use of spin-lock implies that the lock holder will release it > fast. However, when vcpu threads are scheduled independently, when one > vcpu is spinning, the lock holder might be off the CPU! This would > make the VM's SMP scalability bad. > Sure, but credit doesn't do gang scheduling either. Instead of gang scheduling, I think the best solution to this problem is spin lock paravirtualization. Regards, Anthony Liguori