From patchwork Tue Feb 3 15:44:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 44254 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f199.google.com (mail-we0-f199.google.com [74.125.82.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 57ADE21513 for ; Tue, 3 Feb 2015 15:45:04 +0000 (UTC) Received: by mail-we0-f199.google.com with SMTP id u56sf21522332wes.2 for ; Tue, 03 Feb 2015 07:45:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=0pbEr5OiNCgs9aQS8bq59LN4qRkcPkONGgBPqo2Bq9A=; b=UK/ETp2/b52iHcXbAJGcGP4iUbrHc7ne0iiE4TJsNzFTMtbRHeKw41K4Blu6Zhmo3/ mqVxI+2fEVJeIW6BhvkcwdO1l3nPvk+du8dd07nsS9KnSPkk+GqqoXCAKU4yTJWLflXU YkzQTvs+rarxj8eHRs81i7kNScgaL9sqeIHjvV5Rs9pU2CKfibiLhXW1VCGWikXdob6c GXQK0pCyxAomhV+Um44R6jffKPRTvqkEapaxwBFJfyNLCpkEHYpCyGrbR0Td+tnrvPUR DMFhDFMsml0dSv39zOnSPoM8JzcdkQM7TXwf2uiEADKvE9ilHZo3dgkJohpuzzROxHMq C5dA== X-Gm-Message-State: ALoCoQm/D1QdxjqhnSXn9KNXFhg6rRlF9DW+xmcw8iFpdf8QZH5jCaqMhW8ZFjFBB68XeEbfVM6F X-Received: by 10.112.35.135 with SMTP id h7mr3175932lbj.23.1422978303534; Tue, 03 Feb 2015 07:45:03 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.25.229 with SMTP id f5ls456802lag.15.gmail; Tue, 03 Feb 2015 07:45:03 -0800 (PST) X-Received: by 10.152.29.6 with SMTP id f6mr13941969lah.82.1422978303351; Tue, 03 Feb 2015 07:45:03 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id g8si19507047laf.55.2015.02.03.07.45.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 07:45:03 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id f15so39349629lbj.0 for ; Tue, 03 Feb 2015 07:45:03 -0800 (PST) X-Received: by 10.152.7.229 with SMTP id m5mr25521285laa.80.1422978303265; Tue, 03 Feb 2015 07:45:03 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp2018882lbj; Tue, 3 Feb 2015 07:45:02 -0800 (PST) X-Received: by 10.229.51.201 with SMTP id e9mr10631585qcg.4.1422978302078; Tue, 03 Feb 2015 07:45:02 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id h34si29269947qgf.2.2015.02.03.07.44.58 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 03 Feb 2015 07:45:02 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YIfer-0004vt-7s; Tue, 03 Feb 2015 15:44:57 +0000 Received: from mail-lb0-f181.google.com ([209.85.217.181]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YIfeR-0004sn-4I for lng-odp@lists.linaro.org; Tue, 03 Feb 2015 15:44:31 +0000 Received: by mail-lb0-f181.google.com with SMTP id u10so39339488lbd.12 for ; Tue, 03 Feb 2015 07:44:25 -0800 (PST) X-Received: by 10.112.98.202 with SMTP id ek10mr25283070lbb.30.1422978265621; Tue, 03 Feb 2015 07:44:25 -0800 (PST) Received: from localhost.localdomain (78-82-118-111.tn.glocalnet.net. [78.82.118.111]) by mx.google.com with ESMTPSA id k2sm325464lah.32.2015.02.03.07.44.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Feb 2015 07:44:24 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Tue, 3 Feb 2015 16:44:13 +0100 Message-Id: <1422978253-7721-7-git-send-email-ola.liljedahl@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422978253-7721-1-git-send-email-ola.liljedahl@linaro.org> References: <1422978253-7721-1-git-send-email-ola.liljedahl@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCHv4 6/6] validation: odp_timer.c: run at least one thread X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ola.liljedahl@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Ensure we run at least one worker thread. Signed-off-by: Ola Liljedahl Reviewed-by: Anders Roxell --- (This document/code contribution attached is provided under the terms of agreement LES-LTM-21309) test/validation/odp_timer.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c index 5218406..1f673c0 100644 --- a/test/validation/odp_timer.c +++ b/test/validation/odp_timer.c @@ -270,9 +270,13 @@ static void test_odp_timer_all(void) { odp_pool_param_t params; odp_timer_pool_param_t tparam; - /* This is a stressfull test - need to reserve some cpu cycles - * @TODO move to test/performance */ - int num_workers = min(odp_sys_cpu_count()-1, MAX_WORKERS); + /* Reserve at least one core for running other processes so the timer + * test hopefully can run undisturbed and thus get better timing + * results. */ + int num_workers = min(odp_sys_cpu_count() - 1, MAX_WORKERS); + /* On a single-CPU machine run at least one thread */ + if (num_workers < 1) + num_workers = 1; /* Create timeout pools */ params.tmo.num = (NTIMERS + 1) * num_workers;