From patchwork Thu Feb 22 10:00:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 129185 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp433398lja; Thu, 22 Feb 2018 02:19:24 -0800 (PST) X-Google-Smtp-Source: AH8x2267WGRA6UHOItCKIpN08j/YQB/cfnBMByPQ4db5NkMpHuzpXFP/V82TRRG+a2BbvG1Rzzwe X-Received: by 10.200.82.76 with SMTP id y12mr10438978qtn.75.1519294764241; Thu, 22 Feb 2018 02:19:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519294764; cv=none; d=google.com; s=arc-20160816; b=W1s/F3bzY1hd6sfv5d9bp8n+TeblnzgRKJ2J5TJS8MbUmdYJUSFqaNzqLJa6HsWJrG 3MkHXPU5s9riayEpPZdId2yM7GFljWdx1mtDnQnStcpdr6PZHF49gZfjQK1bKW8ex/Dw 6/SemgSHEUABlLh/N5NOExVEzxWCk5x2XGw96OjLcW8l74CPH1FP6ZLipWwWF1GTogYi Jb8nxWscyvfD6cFJctLyKT58Jm/AK2NuKYzue5P6kjBK3mlJhOXcU3DF6z7D50YXVKxZ tOSOcmgGpL69zhaWntJYjJVwfDPfZXSopX4QWSo+9ydAwJrieZhLQacpDQrF2GIyAotv +UAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=btI3q9k+lUBYXo0KO395WlKu3+yTLyXgfyawWxYIUzU=; b=R7nkmeL5Uq70nGGS8UXRZLQETlKsNWMXJOUjeDGJYKVJpyPQ2tGNYGtlEHplGuCI0C A45+UVeetEqWroYNRDRqGso5L7Cle0TiUCH5z3Wht/Vq/y+sVKMWeQSUT5vb5ZwUk96i NLfkXFi6elf/TiZNV9z5uKX9U5aP8XaQlCfkFV1fL+ZpgNFnpPLQN/n6LHTrCeXM6lIp QMK1RWEwVN4zDYQzaWfyHCk2pvbkCVNNy3oVypZWCsKHSPYzWrCCMC7W/4quWnTO2pvs wQp3+ZLe5fD3V9UTAeiDInW3c9v2IrKlOTUQX52OPuSHiYsz7y7cXNaCOUUFolmkbact fZVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id h124si155129qkf.108.2018.02.22.02.19.23; Thu, 22 Feb 2018 02:19:24 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id D9A0461508; Thu, 22 Feb 2018 10:19:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id BFDAD61522; Thu, 22 Feb 2018 10:06:00 +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 3007D61522; Thu, 22 Feb 2018 10:05:50 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id CF87E60591 for ; Thu, 22 Feb 2018 10:01:26 +0000 (UTC) Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10d]) by forward105p.mail.yandex.net (Yandex) with ESMTP id EB2D84080E36 for ; Thu, 22 Feb 2018 13:00:25 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ZXiDoofCyR-0PxOatsI; Thu, 22 Feb 2018 13:00:25 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id azPEnBhLoH-0PvCWwxa; Thu, 22 Feb 2018 13:00:25 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 22 Feb 2018 13:00:16 +0300 Message-Id: <1519293622-14665-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519293622-14665-1-git-send-email-odpbot@yandex.ru> References: <1519293622-14665-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 492 Subject: [lng-odp] [PATCH v2 4/10] validation: sched: honour max queue size X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen When needed, scale down atomic queue size requirement to maximum queue size capability. Signed-off-by: Petri Savolainen --- /** Email created from pull request 492 (psavol:master-sched-optim) ** https://github.com/Linaro/odp/pull/492 ** Patch: https://github.com/Linaro/odp/pull/492.patch ** Base sha: 5a58bbf2bb331fd7dde2ebbc0430634ace6900fb ** Merge commit sha: b29563293c1bca56419d2dc355a8e64d961e024a **/ test/validation/api/scheduler/scheduler.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index 9d1e08ca1..d95766734 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -57,6 +57,7 @@ typedef struct { odp_barrier_t barrier; int buf_count; int buf_count_cpy; + uint32_t max_sched_queue_size; odp_ticketlock_t lock; odp_spinlock_t atomic_lock; struct { @@ -1060,7 +1061,7 @@ static void parallel_execute(odp_schedule_sync_t sync, int num_queues, args->num_queues = num_queues; args->num_prio = num_prio; if (enable_excl_atomic) - args->num_bufs = BUFS_PER_QUEUE_EXCL; + args->num_bufs = globals->max_sched_queue_size; else args->num_bufs = BUFS_PER_QUEUE; args->num_workers = globals->num_workers; @@ -1405,7 +1406,7 @@ static void scheduler_test_ordered_lock(void) CU_ASSERT(ret == 0); } -static int create_queues(void) +static int create_queues(test_globals_t *globals) { int i, j, prios, rc; odp_queue_capability_t capa; @@ -1427,6 +1428,12 @@ static int create_queues(void) capa.max_ordered_locks); } + globals->max_sched_queue_size = BUFS_PER_QUEUE_EXCL; + if (capa.sched.max_size && capa.sched.max_size < BUFS_PER_QUEUE_EXCL) { + printf("Max sched queue size %u\n", capa.sched.max_size); + globals->max_sched_queue_size = capa.sched.max_size; + } + prios = odp_schedule_num_prio(); odp_pool_param_init(¶ms); params.buf.size = sizeof(queue_context); @@ -1455,17 +1462,17 @@ static int create_queues(void) q = odp_queue_create(name, &p); if (q == ODP_QUEUE_INVALID) { - printf("Schedule queue create failed.\n"); + printf("Parallel queue create failed.\n"); return -1; } snprintf(name, sizeof(name), "sched_%d_%d_a", i, j); p.sched.sync = ODP_SCHED_SYNC_ATOMIC; - p.size = BUFS_PER_QUEUE_EXCL; + p.size = globals->max_sched_queue_size; q = odp_queue_create(name, &p); if (q == ODP_QUEUE_INVALID) { - printf("Schedule queue create failed.\n"); + printf("Atomic queue create failed.\n"); return -1; } @@ -1501,7 +1508,7 @@ static int create_queues(void) q = odp_queue_create(name, &p); if (q == ODP_QUEUE_INVALID) { - printf("Schedule queue create failed.\n"); + printf("Ordered queue create failed.\n"); return -1; } if (odp_queue_lock_count(q) != @@ -1598,7 +1605,7 @@ static int scheduler_suite_init(void) odp_ticketlock_init(&globals->lock); odp_spinlock_init(&globals->atomic_lock); - if (create_queues() != 0) + if (create_queues(globals) != 0) return -1; return 0;