From patchwork Tue Jan 3 10:10:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 710442 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tt8tM54J4z9s3s for ; Tue, 3 Jan 2017 21:14:03 +1100 (AEDT) Received: from localhost ([::1]:32904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cOM6T-00082I-HH for incoming@patchwork.ozlabs.org; Tue, 03 Jan 2017 05:14:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cOM2r-0005cP-HV for qemu-devel@nongnu.org; Tue, 03 Jan 2017 05:10:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cOM2q-0007kG-9l for qemu-devel@nongnu.org; Tue, 03 Jan 2017 05:10:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56644) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cOM2q-0007k5-1C for qemu-devel@nongnu.org; Tue, 03 Jan 2017 05:10:16 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3691261B8E; Tue, 3 Jan 2017 10:10:16 +0000 (UTC) Received: from pxdev.xzpeter.org (vpn1-4-159.pek2.redhat.com [10.72.4.159]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v03AA6Wv005623; Tue, 3 Jan 2017 05:10:13 -0500 From: Peter Xu To: qemu-devel@nongnu.org, kvm@vger.kernel.org Date: Tue, 3 Jan 2017 18:10:05 +0800 Message-Id: <1483438205-31110-3-git-send-email-peterx@redhat.com> In-Reply-To: <1483438205-31110-1-git-send-email-peterx@redhat.com> References: <1483438205-31110-1-git-send-email-peterx@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 03 Jan 2017 10:10:16 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [kvm-unit-tests PATCH v2 2/2] run_tests: allow run tests in parallel X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Andrew Jones , peterx@redhat.com, =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" run_task.sh is getting slow. This patch is trying to make it faster by running the tests concurrently. We provide a new parameter "-j" for the run_tests.sh, which can be used to specify how many run queues we want for the tests. Default queue length is 1, which is the old behavior. Quick test on my laptop (4 cores, 2 threads each) shows 3x speed boost: |-----------------+-----------| | command | time used | |-----------------+-----------| | run_test.sh | 75s | | run_test.sh -j8 | 27s | |-----------------+-----------| Suggested-by: Radim Krčmář Signed-off-by: Peter Xu --- run_tests.sh | 12 ++++++++++-- scripts/functions.bash | 15 ++++++++++++++- scripts/global.bash | 11 +++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index e1bb3a6..a4fc895 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -14,10 +14,11 @@ function usage() { cat <