From patchwork Wed Jul 29 14:09:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 51664 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id A9AA2214B7 for ; Wed, 29 Jul 2015 14:09:28 +0000 (UTC) Received: by lafd3 with SMTP id d3sf4254660laf.1 for ; Wed, 29 Jul 2015 07:09:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id: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=D4CFwl45cBidhn77tK3PBDDGP6OxWXvQwE4D5U/9etc=; b=Rl7Kd3sZlMExvRLqcSKns5dfRlURXJ7jMOINZfaVXs1PaVtgB80a7Y3Oa5zI4ESqgV GiRO0rN/1aA+iwjgU8H22HBlbd42I/8Hxd52kyOopMgycFyokYcE47o2i2bG4SINoAo7 bM52Zs6o5wPbumqgvd1hnUXhI0GWFWcfDgDN0znc8tSvJlo+H/1ET7HFGhs5AALiy8SI 8bOqB3cOwYvFuhMAnw8IxEP2tNbcFIQ3urPB63Ks+2OBB0mcl0dAKbKbMK1cAEn6IouQ cAWaMV5RwyC1Z5CLu59B1Brr/1JkdQuT1kmb/ikeX+bYFa29ateaCyCJsbxaOkKvdq2s FOpQ== X-Gm-Message-State: ALoCoQkwEZV35OslkOVX5sSo5nq6MBun5I3k3a+gyt0imDeQzO5yNnfZzmymAfQCLfWoSbqi/Xi6 X-Received: by 10.180.96.137 with SMTP id ds9mr1146151wib.2.1438178967634; Wed, 29 Jul 2015 07:09:27 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.36 with SMTP id g4ls51546lah.33.gmail; Wed, 29 Jul 2015 07:09:27 -0700 (PDT) X-Received: by 10.152.5.197 with SMTP id u5mr38871041lau.94.1438178967330; Wed, 29 Jul 2015 07:09:27 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id p5si21589032lap.109.2015.07.29.07.09.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2015 07:09:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by laah7 with SMTP id h7so7029129laa.0 for ; Wed, 29 Jul 2015 07:09:27 -0700 (PDT) X-Received: by 10.112.166.2 with SMTP id zc2mr38781818lbb.29.1438178967102; Wed, 29 Jul 2015 07:09:27 -0700 (PDT) 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.7.198 with SMTP id l6csp2777597lba; Wed, 29 Jul 2015 07:09:25 -0700 (PDT) X-Received: by 10.107.4.6 with SMTP id 6mr1821424ioe.49.1438178965082; Wed, 29 Jul 2015 07:09:25 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 79si688038iod.146.2015.07.29.07.09.20; Wed, 29 Jul 2015 07:09:25 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id AC61561E2E; Wed, 29 Jul 2015 14:09:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 028C761B34; Wed, 29 Jul 2015 14:09:17 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id F286461DC6; Wed, 29 Jul 2015 14:09:09 +0000 (UTC) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by lists.linaro.org (Postfix) with ESMTPS id 265936181D for ; Wed, 29 Jul 2015 14:09:09 +0000 (UTC) Received: by wibud3 with SMTP id ud3so28068268wib.0 for ; Wed, 29 Jul 2015 07:09:08 -0700 (PDT) X-Received: by 10.180.91.134 with SMTP id ce6mr18319439wib.60.1438178948407; Wed, 29 Jul 2015 07:09:08 -0700 (PDT) Received: from localhost.localdomain ([87.120.178.39]) by smtp.gmail.com with ESMTPSA id i6sm38199141wjf.29.2015.07.29.07.09.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Jul 2015 07:09:07 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 29 Jul 2015 17:09:00 +0300 Message-Id: <1438178940-13557-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] validation: synchronizers: use number of workers instead of threads X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@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.50 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 Use number of workers to not deadlock on barrier. Signed-off-by: Maxim Uvarov Tested-by: Zoltan Kiss --- test/validation/synchronizers/synchronizers.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/validation/synchronizers/synchronizers.c b/test/validation/synchronizers/synchronizers.c index 6b354b6..7c521ca 100644 --- a/test/validation/synchronizers/synchronizers.c +++ b/test/validation/synchronizers/synchronizers.c @@ -1054,8 +1054,9 @@ int synchronizers_suite_init(void) int synchronizers_init(void) { - uint32_t core_count, max_threads; + uint32_t workers_count, max_threads; int ret = 0; + odp_cpumask_t mask; if (0 != odp_init_global(NULL, NULL)) { fprintf(stderr, "error: odp_init_global() failed.\n"); @@ -1081,9 +1082,10 @@ int synchronizers_init(void) global_mem->g_iterations = MAX_ITERATIONS; global_mem->g_verbose = VERBOSE; - core_count = odp_cpu_count(); + workers_count = odp_cpumask_def_worker(&mask, 0); - max_threads = (core_count >= MAX_WORKERS) ? MAX_WORKERS : core_count; + max_threads = (workers_count >= MAX_WORKERS) ? + MAX_WORKERS : workers_count; if (max_threads < global_mem->g_num_threads) { printf("Requested num of threads is too large\n");