From patchwork Thu Jan 12 03:36:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 9511967 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B9593601E7 for ; Thu, 12 Jan 2017 03:36:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABE8A2860C for ; Thu, 12 Jan 2017 03:36:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F4EE28657; Thu, 12 Jan 2017 03:36:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 458C72860C for ; Thu, 12 Jan 2017 03:36:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751864AbdALDgs (ORCPT ); Wed, 11 Jan 2017 22:36:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45166 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751840AbdALDgr (ORCPT ); Wed, 11 Jan 2017 22:36:47 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 A20903B74F; Thu, 12 Jan 2017 03:36:47 +0000 (UTC) Received: from pxdev.xzpeter.org.com (ovpn-8-25.pek2.redhat.com [10.72.8.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0C3aUOg022851; Wed, 11 Jan 2017 22:36:44 -0500 From: Peter Xu To: qemu-devel@nongnu.org, kvm@vger.kernel.org Cc: Paolo Bonzini , Andrew Jones , peterx@redhat.com, =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [kvm-unit-tests PATCH v6 3/3] run_tests: allow run tests in parallel Date: Thu, 12 Jan 2017 11:36:22 +0800 Message-Id: <1484192182-13760-4-git-send-email-peterx@redhat.com> In-Reply-To: <1484192182-13760-1-git-send-email-peterx@redhat.com> References: <1484192182-13760-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 12 Jan 2017 03:36:47 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 | |-----------------+-----------| Signed-off-by: Peter Xu Reviewed-by: Andrew Jones --- run_tests.sh | 12 ++++++++++-- scripts/common.bash | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index afd3d95..4d57ff9 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -13,10 +13,11 @@ function usage() { cat <