From patchwork Mon Sep 3 10:58:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10585767 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4ADD813AC for ; Mon, 3 Sep 2018 10:58:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B2F529604 for ; Mon, 3 Sep 2018 10:58:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EDBD29603; Mon, 3 Sep 2018 10:58:52 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 CEEA029603 for ; Mon, 3 Sep 2018 10:58:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727142AbeICPS1 (ORCPT ); Mon, 3 Sep 2018 11:18:27 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:53814 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726023AbeICPS1 (ORCPT ); Mon, 3 Sep 2018 11:18:27 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E0BC018A; Mon, 3 Sep 2018 03:58:49 -0700 (PDT) Received: from localhost (e113682-lin.copenhagen.arm.com [10.32.144.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 761413F614; Mon, 3 Sep 2018 03:58:49 -0700 (PDT) From: Christoffer Dall To: kvm@vger.kernel.org Cc: drjones@redhat.com, marc.zyngier@arm.com, kvmarm@lists.cs.columbia.edu, Christoffer Dall Subject: [PATCH kvm-unit-tests] scripts: Speedup MAX_SMP check Date: Mon, 3 Sep 2018 12:58:45 +0200 Message-Id: <20180903105845.13942-1-christoffer.dall@arm.com> X-Mailer: git-send-email 2.18.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The current MAX_SMP check launches QEMU for every value of the SMP parameter to check if the SMP parameter based on the native is higher than the QEMU maximum supported configuration. On something like a TX2, which has 224 threads, this takes a very long time where the test script just sits there with no output. Reduce the wait time by taking the log2 of MAX_SMP in each iteration of the loop instead. Signed-off-by: Christoffer Dall Reviewed-by: Andrew Jones --- scripts/runtime.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/runtime.bash b/scripts/runtime.bash index a31ae91..1e2c288 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -140,5 +140,5 @@ function run() # just remove it... while $RUNTIME_arch_run _NO_FILE_4Uhere_ -smp $MAX_SMP \ |& grep -qi 'exceeds max CPUs'; do - ((--MAX_SMP)) + MAX_SMP=$((MAX_SMP >> 1)) done