From: Lukas Doktor Subject: [kvm-autotest] tests.cgroup: Add CpuShare test Date: Mon, 28 Nov 2011 17:39:37 +0100 Message-ID: <1322498378-11707-1-git-send-email-ldoktor@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE To: autotest@test.kernel.org, kvm@vger.kernel.org, kvm-autotest@redhat.com, lmr@redhat.com, ldoktor@redhat.com, jzupka@redhat.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50647 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750981Ab1K1Qjp (ORCPT ); Mon, 28 Nov 2011 11:39:45 -0500 Sender: kvm-owner@vger.kernel.org List-ID: Hi guys, I have a new kvm cgroup test for you. This time it's in cpu cgroup and it uses cpu.shares capability. It modi= fies the number of shares/time_slices which each process gets from the sched= uler As the verification is kind of tricky I'm testing only three different scenerios and only symetrical solutions: 1) #threads =3D=3D #CPUs 2) #threads + 1 =3D=3D #CPUs, +1thread have the lowest priority (or equ= al) 3) #threads * #cgroups =3D=3D #CPUs ad1) When less threads are occupied, the utilisation should be equal. ad2) When there is +1 thread with lower priority, it fight with the second thread from the lowest priority group, thus the utilisation= s are still equal. If you try it other way around (higher utilisatio= n) this current thread forces the utilisation in cgroups ratios. This is not tested as it would be trickier with multiple cgroups/thread= s ad3) When each cgroup have multiple threads it can fight for it's share thus in the end they all should settle on cgroup ratio utilisation= s. To minimalize system impact I'm using 10-100times bigger slices/priorit= y then other processes. Still when are you running other processes on the system the test might fail. Keep in mind it should run on clean test machine. Anyway, be my guests at github pull request: https://github.com/autotest/autotest/pull/94 Regards, Luk=C3=A1=C5=A1 Doktor