From patchwork Wed Feb 28 12:00:12 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: 129968 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp942383lja; Wed, 28 Feb 2018 04:04:55 -0800 (PST) X-Google-Smtp-Source: AG47ELv/GDapYg+QUoVyMpxBZBLCF7CHK2/0n+fI0zqMoI351Xr/iWIF/Tv7WD7s6iLkJEGDSujG X-Received: by 10.237.63.28 with SMTP id p28mr28809737qtf.104.1519819494927; Wed, 28 Feb 2018 04:04:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519819494; cv=none; d=google.com; s=arc-20160816; b=ul68Gfw57mQMuJj/cWEJ82/j+JCfAJLL5z2g4f4Hg7z+KC7AmTzvCZybVDVyTxAKOM cpuL2tjsRK+w7Qp0/EsFCgUpRi8gxErTjlXG/jVc6n+kDaCx+5bIem2L2h42YYhBveFC tMRn65348J8hd9V9DFZuAYzOly7zTjyf7W4/iT4w3rXd6ollg88v4tvWQXJBWaAG9h28 X6SnTjGZ+GUEOCcqfCwgrsunDMp3AAw+S0p5uoRnZe4ackxBilT5if2EasFuP0sBhEvH 3N9rBksVagPcmot1MvNacdBf197mbGZfYaMoyfDX1IEsbwYsIAYZkdgjMAG9Fye2Jg2F tA9w== 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=/hB/cpJkFNjaMkv28IRBWolTHcjNGJ4jyH6NR9a+TDw=; b=tloMon5cLWnzlU/5e4K7CRk07JZBsAB3jF0xtxWCUyRLtxFQBiVQpPiQx7/I+DDPyP b9gGb6Ik78J8BQPDueMwkplZ5K4kosI5JljTsfn63POY6lBYWSnNIarttp/zxnH+IFB9 Ay8tWTErulAxMNq9KK/XjDhBhG2OIVqfvLySR4luHX5n+/UjqctvZrGtAU085lB3QRLH qSQ8P7ASjqvVP10o7MZ9EUhrvuhBdpCZXjIaS0kQ6vpRXK3delZJuWUavRwYZCQ+lBWR Hd2dz9SpwubN9p5FIqg5UrRl0nE5m2Qwn+2mJywvK4dsohea82+C/lRgvZiP1/H1OPQU WQQw== 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 s25si1799772qtn.209.2018.02.28.04.04.54; Wed, 28 Feb 2018 04:04:54 -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 87C6361789; Wed, 28 Feb 2018 12:04:54 +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 97E7961754; Wed, 28 Feb 2018 12:01:43 +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 E6CDA61747; Wed, 28 Feb 2018 12:01:29 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id C05C261700 for ; Wed, 28 Feb 2018 12:00:25 +0000 (UTC) Received: from mxback9o.mail.yandex.net (mxback9o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::23]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 22CBF4084104 for ; Wed, 28 Feb 2018 15:00:24 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback9o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ODnoCRKvTo-0OlimqZC; Wed, 28 Feb 2018 15:00:24 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id iE1m40jcci-0NS4UQe4; Wed, 28 Feb 2018 15:00:23 +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: Wed, 28 Feb 2018 15:00:12 +0300 Message-Id: <1519819218-27901-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519819218-27901-1-git-send-email-odpbot@yandex.ru> References: <1519819218-27901-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 492 Subject: [lng-odp] [PATCH v3 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: f5e12df388352b27f09787028a0040afb28564f4 ** Merge commit sha: 56e6340663c8679516a24dc81df13a53488b86b8 **/ 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 098c03a0a..d5783b4d2 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;