From: "Ben Clay" Subject: RE: FW: cgroup blkio.weight working, but not for KVM guests Date: Tue, 23 Oct 2012 16:48:13 -0600 Message-ID: <046b01cdb170$7c2b7a10$74826e30$@ncsu.edu> References: <022401cdac8d$32565fa0$97031ee0$@ncsu.edu> <014201cdb05a$414e7b20$c3eb7160$@ncsu.edu> <20121023123502.GF19977@stefanha-thinkpad.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: To: "'Stefan Hajnoczi'" Return-path: Received: from na3sys009aog129.obsmtp.com ([74.125.149.142]:47480 "HELO na3sys009aog129.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S933587Ab2JWWs0 convert rfc822-to-8bit (ORCPT ); Tue, 23 Oct 2012 18:48:26 -0400 Received: by mail-ia0-f174.google.com with SMTP id y32so3383386iag.19 for ; Tue, 23 Oct 2012 15:48:25 -0700 (PDT) In-Reply-To: <20121023123502.GF19977@stefanha-thinkpad.redhat.com> Content-Language: en-us Sender: kvm-owner@vger.kernel.org List-ID: Stefan- Thanks for the hand-holding, it looks like the disk file is indeed open= with O_DIRECT: [root@host ~]# grep ^flags: /proc/$PID/fdinfo/$FD flags: 02140002 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 wit= hin 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 threa= ds child processes of the guest's main process? Are you aware of any other factor which I should be considering here? = I reran the dd tests inside the guest with iflag=3Dfullblock set to make = sure the guest buffer cache wasn't messing with throughput values (based on = this: http://git.savannah.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommitdiff;h=3D= 5929322cc b1f9d27c1b07b746d37419d17a7cbf6), and got the same results listed earli= er. Thanks again! Ben Clay rbclay@ncsu.edu -----Original Message----- =46rom: Stefan Hajnoczi [mailto:stefanha@gmail.com]=20 Sent: Tuesday, October 23, 2012 6:35 AM To: Ben Clay Cc: kvm@vger.kernel.org Subject: Re: FW: cgroup blkio.weight working, but not for KVM guests On Mon, Oct 22, 2012 at 07:36:34AM -0600, Ben Clay wrote: > Forwarding this to the KVM general list.=A0 I doubt you folks can hel= p=20 > me with libvirt, but I was wondering if there=92s some way to verify = if=20 > the cache=3Dnone parameter is being respected for my KVM guest=92s di= sk=20 > image, or if there are any other configuration/debug steps appropriat= e for KVM + virtio + cgroup. Here's how you can double-check the O_DIRECT flag: =46ind the QEMU process PID on the host: ps aux | grep qemu Then find the file descriptor of the image file which the QEMU process = has open: ls -l /proc/$PID/fd =46inally look at the file descriptor flags to confirm it is O_DIRECT: grep ^flags: /proc/$PID/fdinfo/$FD Note the flags field is in octal and you're looking for: #define O_DIRECT 00040000 /* direct disk access hint */ Stefan