From patchwork Wed Feb 21 12:00:01 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: 129043 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp543851ljc; Wed, 21 Feb 2018 04:05:23 -0800 (PST) X-Google-Smtp-Source: AH8x226NN5PPGShepLcdCj6m2SndI9wsUyuSevJcuK2bRvmnJOk1fjy6OJy2TWhYG/wwG3akLyof X-Received: by 2002:a25:a108:: with SMTP id z8-v6mr897877ybh.452.1519214723456; Wed, 21 Feb 2018 04:05:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519214723; cv=none; d=google.com; s=arc-20160816; b=bM96OBhZYAKphcaLjBK5U8rgYRJY2uMOZFIO207zidGh6KPQeibVzzGZ/ph/je82Sk bePWlXFX0uYdEkshN4L0w/UdORacyzkCq0/VmJrWaFNnK+ud8Vh8Q6phUMQGHHdpByFA dsY50CCp5kJaXJ7iCdrwetUz1Posi7fnBO3pOiRldAhyooi8DM7zoLPrjQhCF5BxlhuE WGi8Xka52FB1D8RW+lon4J/VDjuV7wvE8t37irruVJt8VVP9/stWvsa8HY5F59AXuv0V w7vb2d4j05UujLUeY0vIHeQcBfy0O+Lvl+2MJMrSIH50ielkQB3RoQJIQ7nbHdKfsw2m EWgA== 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=JXaDrqExLElfUcXycoBtWeR+bwdbzi5eFY00+VI/xbM=; b=JdO4dsRgjB2EoOKGIqgwNjddpVfll8Jv7R3QrtPqCRK9IUwK403IXZvFeIa8aPGGUt m15EA8FkxJdiVTTlXu5Ec7Wzl1RjQT53TWqUGPX59x9S9KnyX14qYCGk4vlc4J1nFdbj CGH2+dq1i5B3hD/IRSrNCL8DQN7BPmzeMDj3hRMU+ZBVYWSVuRhPLRakG97dpwirHXw5 w/onel2N3XbGZwmh+/53l+tXvjwfC2+yQb7HZYOk7bBIApHjIMtYuFTGQOoIBaphyu+8 OULbpN7WdfXVpSLqbC82Yd66cFRD2FY0hBp4NI1FvCsoNoHk379+bZRZkVLXxJst9IHa HKmQ== 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 y44si3167036qth.38.2018.02.21.04.05.23; Wed, 21 Feb 2018 04:05:23 -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 2294461728; Wed, 21 Feb 2018 12:05: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 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 D0D31616F3; Wed, 21 Feb 2018 12:02:09 +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 CE72560C40; Wed, 21 Feb 2018 12:01:49 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id E59A761728 for ; Wed, 21 Feb 2018 12:00:14 +0000 (UTC) Received: from mxback10o.mail.yandex.net (mxback10o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::24]) by forward106o.mail.yandex.net (Yandex) with ESMTP id F335C782789 for ; Wed, 21 Feb 2018 15:00:11 +0300 (MSK) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [2a02:6b8:0:801::ac]) by mxback10o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id CPKMVERsyM-0BbSVx7o; Wed, 21 Feb 2018 15:00:11 +0300 Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id a6UlmCoovI-0BviwwqU; Wed, 21 Feb 2018 15:00:11 +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, 21 Feb 2018 15:00:01 +0300 Message-Id: <1519214407-28047-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519214407-28047-1-git-send-email-odpbot@yandex.ru> References: <1519214407-28047-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 492 Subject: [lng-odp] [PATCH v1 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: 82a6bfe942419330a430b63149220e6b472f419c **/ 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;