From patchwork Thu Feb 5 08:16:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 44409 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1690C21173 for ; Thu, 5 Feb 2015 08:16:51 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id u10sf4243777lbd.3 for ; Thu, 05 Feb 2015 00:16:50 -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=ez3+I+EWRKYjUvQ6eRzdXL8rptxnHlg5znV2MGC3ICGE1ZZOvJLE+UgxmHc4YwxXtB 44Otbc5wNMmzfvfKN+q03Bc3gbDF81XOtbk5g4Jnv+uXOizvr065YJz2bb8pZZaGJAdt oYHC7I2raeMVktNiHfl001+/Q2MrmlVl4CUpVJaUTDMHElYebtw945R47B148JEzldjV B/V54DhtexagJOZaxGFDEmT4hZbApeyCySAdO+GDO14uqUp7+z627x/NfXl4SG4gyhIY b+b78V2b/oeW/jlvB7On7mOGz4SJsImwu+3R7sgkAaydz5b4JdI4AdgiJEaMn7n0rlkx FRLA== X-Gm-Message-State: ALoCoQmj9MRiApz3MTvTugEULatOUoRWsAUamuWLrG3bzJby8/L5yrjPuaH4S7to+YQvKb1SY/Cr X-Received: by 10.112.148.198 with SMTP id tu6mr274481lbb.3.1423124210038; Thu, 05 Feb 2015 00:16:50 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.97 with SMTP id z1ls133104laz.35.gmail; Thu, 05 Feb 2015 00:16:49 -0800 (PST) X-Received: by 10.112.118.144 with SMTP id km16mr2037298lbb.75.1423124209889; Thu, 05 Feb 2015 00:16:49 -0800 (PST) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id rc4si3370537lac.23.2015.02.05.00.16.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Feb 2015 00:16:49 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by mail-la0-f44.google.com with SMTP id gf13so5922642lab.3 for ; Thu, 05 Feb 2015 00:16:49 -0800 (PST) X-Received: by 10.152.245.44 with SMTP id xl12mr2012833lac.81.1423124209805; Thu, 05 Feb 2015 00:16:49 -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 h5csp991949lbj; Thu, 5 Feb 2015 00:16:49 -0800 (PST) X-Received: by 10.224.151.140 with SMTP id c12mr5797194qaw.80.1423124208302; Thu, 05 Feb 2015 00:16:48 -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 g1si5302569qaa.77.2015.02.05.00.16.47 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 05 Feb 2015 00:16:48 -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 1YJHcD-0003d1-1Z; Thu, 05 Feb 2015 08:16:45 +0000 Received: from mail-la0-f51.google.com ([209.85.215.51]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YJHbm-0003aK-8G for lng-odp@lists.linaro.org; Thu, 05 Feb 2015 08:16:18 +0000 Received: by mail-la0-f51.google.com with SMTP id hv19so4630561lab.10 for ; Thu, 05 Feb 2015 00:16:12 -0800 (PST) X-Received: by 10.152.184.67 with SMTP id es3mr2193766lac.8.1423124172643; Thu, 05 Feb 2015 00:16:12 -0800 (PST) Received: from macmini.lan (78-82-118-111.tn.glocalnet.net. [78.82.118.111]) by mx.google.com with ESMTPSA id nq7sm807336lbb.49.2015.02.05.00.16.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Feb 2015 00:16:12 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Thu, 5 Feb 2015 09:16:01 +0100 Message-Id: <1423124161-18716-7-git-send-email-ola.liljedahl@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423124161-18716-1-git-send-email-ola.liljedahl@linaro.org> References: <1423124161-18716-1-git-send-email-ola.liljedahl@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCHv5 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.215.44 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 --- (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;