From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lucas Meneghel Rodrigues Subject: Re: [Autotest] [PATCH 2/3] KVM test: Create ksm scanner through pre_command Date: Thu, 6 May 2010 14:05:48 -0300 Message-ID: References: <20100426100726.26501.73186.stgit@localhost.localdomain> <20100426100734.26501.22279.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: autotest@test.kernel.org, kvm@vger.kernel.org To: Jason Wang Return-path: Received: from mail-ww0-f46.google.com ([74.125.82.46]:44953 "EHLO mail-ww0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751444Ab0EFRFu convert rfc822-to-8bit (ORCPT ); Thu, 6 May 2010 13:05:50 -0400 Received: by wwb39 with SMTP id 39so152035wwb.19 for ; Thu, 06 May 2010 10:05:49 -0700 (PDT) In-Reply-To: <20100426100734.26501.22279.stgit@localhost.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Apr 26, 2010 at 7:07 AM, Jason Wang wrote= : > KSM may have various control interface for different distributions,so > this patch launch ksm through pre_command instead of the hard-coded > bits in the test. User may specify their owner suitable commands or > paramteres. Applied, thanks! > Signed-off-by: Jason Wang > --- > =A0client/tests/kvm/tests/ksm_overcommit.py | =A0 15 --------------- > =A0client/tests/kvm/tests_base.cfg.sample =A0 | =A0 =A02 ++ > =A02 files changed, 2 insertions(+), 15 deletions(-) > > diff --git a/client/tests/kvm/tests/ksm_overcommit.py b/client/tests/= kvm/tests/ksm_overcommit.py > index 2dd46c4..4aa6deb 100644 > --- a/client/tests/kvm/tests/ksm_overcommit.py > +++ b/client/tests/kvm/tests/ksm_overcommit.py > @@ -412,21 +412,6 @@ def run_ksm_overcommit(test, params, env): > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0(3100 - 64.0))) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mem =3D int(math.floor(host_mem * ove= rcommit / vmsc)) > > - =A0 =A0logging.debug("Checking KSM status...") > - =A0 =A0ksm_flag =3D 0 > - =A0 =A0for line in os.popen('ksmctl info').readlines(): > - =A0 =A0 =A0 =A0if line.startswith('flags'): > - =A0 =A0 =A0 =A0 =A0 =A0ksm_flag =3D int(line.split(' ')[1].split(',= ')[0]) > - =A0 =A0if int(ksm_flag) !=3D 1: > - =A0 =A0 =A0 =A0logging.info("KSM module is not loaded! Trying to lo= ad module and " > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "start ksmctl...") > - =A0 =A0 =A0 =A0try: > - =A0 =A0 =A0 =A0 =A0 =A0utils.run("modprobe ksm") > - =A0 =A0 =A0 =A0 =A0 =A0utils.run("ksmctl start 5000 100") > - =A0 =A0 =A0 =A0except error.CmdError, e: > - =A0 =A0 =A0 =A0 =A0 =A0raise error.TestFail("Failed to load KSM: %s= " % e) > - =A0 =A0logging.debug("KSM module loaded and ksmctl started") > - > =A0 =A0 swap =3D int(utils.read_from_meminfo("SwapTotal")) / 1024 > > =A0 =A0 logging.debug("Overcommit =3D %f", overcommit) > diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kv= m/tests_base.cfg.sample > index e73ba44..2db0d2c 100644 > --- a/client/tests/kvm/tests_base.cfg.sample > +++ b/client/tests/kvm/tests_base.cfg.sample > @@ -285,6 +285,8 @@ variants: > =A0 =A0 =A0 =A0 catch_uuid_cmd =3D dmidecode | awk -F: '/UUID/ {print= $2}' > > =A0 =A0 - ksm_overcommit: > + =A0 =A0 =A0 =A0pre_command =3D "[ -e /dev/ksm ] && true || modprobe= ksm && ksmctl start 5000 50" > + =A0 =A0 =A0 =A0pre_command_critical =3D yes > =A0 =A0 =A0 =A0 # Don't preprocess any vms as we need to change its p= arams > =A0 =A0 =A0 =A0 vms =3D '' > =A0 =A0 =A0 =A0 image_snapshot =3D yes > > _______________________________________________ > Autotest mailing list > Autotest@test.kernel.org > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest > --=20 Lucas