From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Hajnoczi Subject: Re: FW: cgroup blkio.weight working, but not for KVM guests Date: Wed, 24 Oct 2012 08:10:56 +0200 Message-ID: <20121024061056.GA2904@stefanha-thinkpad.redhat.com> References: <022401cdac8d$32565fa0$97031ee0$@ncsu.edu> <014201cdb05a$414e7b20$c3eb7160$@ncsu.edu> <20121023123502.GF19977@stefanha-thinkpad.redhat.com> <046b01cdb170$7c2b7a10$74826e30$@ncsu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Ben Clay Return-path: Received: from mail-ea0-f174.google.com ([209.85.215.174]:41630 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757619Ab2JXGLA (ORCPT ); Wed, 24 Oct 2012 02:11:00 -0400 Received: by mail-ea0-f174.google.com with SMTP id c13so30879eaa.19 for ; Tue, 23 Oct 2012 23:10:59 -0700 (PDT) Content-Disposition: inline In-Reply-To: <046b01cdb170$7c2b7a10$74826e30$@ncsu.edu> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Oct 23, 2012 at 04:48:13PM -0600, Ben Clay wrote: > Since this is not an issue, I guess another source of problems could be that > all the virtio threads attached to this domain are not being placed within > the cgroup. I will look through libvirt to see if they're setting the > guest's process's cgroup classification as sticky (I can't imagine they > wouldn't be), but this raises another question: are virtio kernel threads > child processes of the guest's main process? Virtio kernel threads? Depend on the qemu-kvm -drive ...,aio=native|threads setting you should either see: 1. For aio=native QEMU uses the Linux AIO API. I think this results in kernel threads that process I/O on behalf of the userspace process. 2. For aio=threads QEMU uses its own userspace threadpool to call preadv(2)/pwritev(2). These threads are spawned from QEMU's "iothread" event loop. I suggest you try switching between aio=native and aio=threads to check if this causes the result you have been seeing. > Are you aware of any other factor which I should be considering here? No, but I haven't played with the cgroups blkio controller much. Stefan