This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 40ac22bb63526e9a935d804513204a85a665d13a (commit) via 3239dd418ff3f02924fa71c0b805e709b6b6db63 (commit) via bfc31d006406481c26aa851257d643d480507e2c (commit) from 273fc3e2e0c92bbf22019ea7d686b061d640da78 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 40ac22bb63526e9a935d804513204a85a665d13a Author: Matias Elo matias.elo@nokia.com Date: Wed May 23 16:15:54 2018 +0300
test: scheduling: use queue capability
Running the application would fail on systems with less than NUM_PRIOS * QUEUES_PER_PRIO scheduled queues. Use odp_queue_capability() and adjust number of queues per priority accordingly.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 8dd86c3c..d2fbf894 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -68,6 +68,7 @@ typedef struct { odp_spinlock_t lock; odp_pool_t pool; int first_thr; + int queues_per_prio; test_args_t args; odp_queue_t queue[NUM_PRIOS][QUEUES_PER_PRIO]; queue_context_t queue_ctx[NUM_PRIOS][QUEUES_PER_PRIO]; @@ -85,7 +86,7 @@ static void print_stats(int prio, test_globals_t *globals)
printf("\nQueue fairness\n-----+--------\n");
- for (j = 0; j < QUEUES_PER_PRIO;) { + for (j = 0; j < globals->queues_per_prio;) { printf(" %2i | ", j);
for (k = 0; k < STATS_PER_LINE - 1; k++) { @@ -432,7 +433,7 @@ static int test_schedule_many(const char *str, int thr, uint32_t i; uint32_t tot;
- if (enqueue_events(thr, prio, QUEUES_PER_PRIO, 1, globals)) + if (enqueue_events(thr, prio, globals->queues_per_prio, 1, globals)) return -1;
/* Start sched-enq loop */ @@ -503,7 +504,8 @@ static int test_schedule_multi(const char *str, int thr, int num; uint32_t tot = 0;
- if (enqueue_events(thr, prio, QUEUES_PER_PRIO, MULTI_BUFS_MAX, globals)) + if (enqueue_events(thr, prio, globals->queues_per_prio, MULTI_BUFS_MAX, + globals)) return -1;
/* Start sched-enq loop */ @@ -808,6 +810,8 @@ int main(int argc, char *argv[]) int ret = 0; odp_instance_t instance; odph_odpthread_params_t thr_params; + odp_queue_capability_t capa; + uint32_t num_queues;
printf("\nODP example starts\n\n");
@@ -879,6 +883,27 @@ int main(int argc, char *argv[])
globals->pool = pool;
+ if (odp_queue_capability(&capa)) { + LOG_ERR("Fetching queue capabilities failed.\n"); + return -1; + } + + globals->queues_per_prio = QUEUES_PER_PRIO; + num_queues = globals->queues_per_prio * NUM_PRIOS; + if (num_queues > capa.sched.max_num) + globals->queues_per_prio = capa.sched.max_num / NUM_PRIOS; + + /* One plain queue is also used */ + num_queues = (globals->queues_per_prio * NUM_PRIOS) + 1; + if (num_queues > capa.max_queues) + globals->queues_per_prio--; + + if (globals->queues_per_prio <= 0) { + LOG_ERR("Not enough queues. At least 1 plain and %d scheduled " + "queues required.\n", NUM_PRIOS); + return -1; + } + /* * Create a queue for plain queue test */ @@ -890,7 +915,7 @@ int main(int argc, char *argv[]) }
/* - * Create queues for schedule test. QUEUES_PER_PRIO per priority. + * Create queues for schedule test. */ for (i = 0; i < NUM_PRIOS; i++) { char name[] = "sched_XX_YY"; @@ -912,7 +937,7 @@ int main(int argc, char *argv[]) param.sched.sync = ODP_SCHED_SYNC_ATOMIC; param.sched.group = ODP_SCHED_GROUP_ALL;
- for (j = 0; j < QUEUES_PER_PRIO; j++) { + for (j = 0; j < globals->queues_per_prio; j++) { name[9] = '0' + j / 10; name[10] = '0' + j - 10 * (j / 10);
@@ -962,7 +987,7 @@ int main(int argc, char *argv[]) for (i = 0; i < NUM_PRIOS; i++) { odp_queue_t queue;
- for (j = 0; j < QUEUES_PER_PRIO; j++) { + for (j = 0; j < globals->queues_per_prio; j++) { queue = globals->queue[i][j]; ret += odp_queue_destroy(queue); }
commit 3239dd418ff3f02924fa71c0b805e709b6b6db63 Author: Matias Elo matias.elo@nokia.com Date: Thu May 24 11:53:17 2018 +0300
validation: sched: adjust number of used queues based on capability
Scale down the number of test queues per priority based on odp_queue_capability.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index f1b61dfd..2e44d324 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -27,8 +27,6 @@ #define SHM_THR_ARGS_NAME "shm_thr_args"
#define ONE_Q 1 -#define MANY_QS QUEUES_PER_PRIO - #define ONE_PRIO 1
#define SCHD_ONE 0 @@ -57,6 +55,9 @@ typedef struct { odp_barrier_t barrier; int buf_count; int buf_count_cpy; + int queues_per_prio; + odp_pool_t pool; + odp_pool_t queue_ctx_pool; uint32_t max_sched_queue_size; odp_ticketlock_t lock; odp_spinlock_t atomic_lock; @@ -96,8 +97,7 @@ typedef struct { uint64_t seqno; } chaos_buf;
-odp_pool_t pool; -odp_pool_t queue_ctx_pool; +static test_globals_t *globals;
static int drain_queues(void) { @@ -1103,19 +1103,22 @@ static void scheduler_test_mq_1t_n(void) { /* Only one priority involved in these tests, but use the same number of queues the more general case uses */ - schedule_common(ODP_SCHED_SYNC_PARALLEL, MANY_QS, ONE_PRIO, SCHD_ONE); + schedule_common(ODP_SCHED_SYNC_PARALLEL, globals->queues_per_prio, + ONE_PRIO, SCHD_ONE); }
/* Many queues 1 thread ODP_SCHED_SYNC_ATOMIC */ static void scheduler_test_mq_1t_a(void) { - schedule_common(ODP_SCHED_SYNC_ATOMIC, MANY_QS, ONE_PRIO, SCHD_ONE); + schedule_common(ODP_SCHED_SYNC_ATOMIC, globals->queues_per_prio, + ONE_PRIO, SCHD_ONE); }
/* Many queues 1 thread ODP_SCHED_SYNC_ORDERED */ static void scheduler_test_mq_1t_o(void) { - schedule_common(ODP_SCHED_SYNC_ORDERED, MANY_QS, ONE_PRIO, SCHD_ONE); + schedule_common(ODP_SCHED_SYNC_ORDERED, globals->queues_per_prio, + ONE_PRIO, SCHD_ONE); }
/* Many queues 1 thread check priority ODP_SCHED_SYNC_PARALLEL */ @@ -1123,7 +1126,8 @@ static void scheduler_test_mq_1t_prio_n(void) { int prio = odp_schedule_num_prio();
- schedule_common(ODP_SCHED_SYNC_PARALLEL, MANY_QS, prio, SCHD_ONE); + schedule_common(ODP_SCHED_SYNC_PARALLEL, globals->queues_per_prio, prio, + SCHD_ONE); }
/* Many queues 1 thread check priority ODP_SCHED_SYNC_ATOMIC */ @@ -1131,7 +1135,8 @@ static void scheduler_test_mq_1t_prio_a(void) { int prio = odp_schedule_num_prio();
- schedule_common(ODP_SCHED_SYNC_ATOMIC, MANY_QS, prio, SCHD_ONE); + schedule_common(ODP_SCHED_SYNC_ATOMIC, globals->queues_per_prio, prio, + SCHD_ONE); }
/* Many queues 1 thread check priority ODP_SCHED_SYNC_ORDERED */ @@ -1139,7 +1144,8 @@ static void scheduler_test_mq_1t_prio_o(void) { int prio = odp_schedule_num_prio();
- schedule_common(ODP_SCHED_SYNC_ORDERED, MANY_QS, prio, SCHD_ONE); + schedule_common(ODP_SCHED_SYNC_ORDERED, globals->queues_per_prio, prio, + SCHD_ONE); }
/* Many queues many threads check priority ODP_SCHED_SYNC_PARALLEL */ @@ -1147,8 +1153,8 @@ static void scheduler_test_mq_mt_prio_n(void) { int prio = odp_schedule_num_prio();
- parallel_execute(ODP_SCHED_SYNC_PARALLEL, MANY_QS, prio, SCHD_ONE, - DISABLE_EXCL_ATOMIC); + parallel_execute(ODP_SCHED_SYNC_PARALLEL, globals->queues_per_prio, + prio, SCHD_ONE, DISABLE_EXCL_ATOMIC); }
/* Many queues many threads check priority ODP_SCHED_SYNC_ATOMIC */ @@ -1156,8 +1162,8 @@ static void scheduler_test_mq_mt_prio_a(void) { int prio = odp_schedule_num_prio();
- parallel_execute(ODP_SCHED_SYNC_ATOMIC, MANY_QS, prio, SCHD_ONE, - DISABLE_EXCL_ATOMIC); + parallel_execute(ODP_SCHED_SYNC_ATOMIC, globals->queues_per_prio, prio, + SCHD_ONE, DISABLE_EXCL_ATOMIC); }
/* Many queues many threads check priority ODP_SCHED_SYNC_ORDERED */ @@ -1165,8 +1171,8 @@ static void scheduler_test_mq_mt_prio_o(void) { int prio = odp_schedule_num_prio();
- parallel_execute(ODP_SCHED_SYNC_ORDERED, MANY_QS, prio, SCHD_ONE, - DISABLE_EXCL_ATOMIC); + parallel_execute(ODP_SCHED_SYNC_ORDERED, globals->queues_per_prio, prio, + SCHD_ONE, DISABLE_EXCL_ATOMIC); }
/* 1 queue many threads check exclusive access on ATOMIC queues */ @@ -1199,19 +1205,22 @@ static void scheduler_test_multi_mq_1t_n(void) { /* Only one priority involved in these tests, but use the same number of queues the more general case uses */ - schedule_common(ODP_SCHED_SYNC_PARALLEL, MANY_QS, ONE_PRIO, SCHD_MULTI); + schedule_common(ODP_SCHED_SYNC_PARALLEL, globals->queues_per_prio, + ONE_PRIO, SCHD_MULTI); }
/* Many queues 1 thread ODP_SCHED_SYNC_ATOMIC multi */ static void scheduler_test_multi_mq_1t_a(void) { - schedule_common(ODP_SCHED_SYNC_ATOMIC, MANY_QS, ONE_PRIO, SCHD_MULTI); + schedule_common(ODP_SCHED_SYNC_ATOMIC, globals->queues_per_prio, + ONE_PRIO, SCHD_MULTI); }
/* Many queues 1 thread ODP_SCHED_SYNC_ORDERED multi */ static void scheduler_test_multi_mq_1t_o(void) { - schedule_common(ODP_SCHED_SYNC_ORDERED, MANY_QS, ONE_PRIO, SCHD_MULTI); + schedule_common(ODP_SCHED_SYNC_ORDERED, globals->queues_per_prio, + ONE_PRIO, SCHD_MULTI); }
/* Many queues 1 thread check priority ODP_SCHED_SYNC_PARALLEL multi */ @@ -1219,7 +1228,8 @@ static void scheduler_test_multi_mq_1t_prio_n(void) { int prio = odp_schedule_num_prio();
- schedule_common(ODP_SCHED_SYNC_PARALLEL, MANY_QS, prio, SCHD_MULTI); + schedule_common(ODP_SCHED_SYNC_PARALLEL, globals->queues_per_prio, prio, + SCHD_MULTI); }
/* Many queues 1 thread check priority ODP_SCHED_SYNC_ATOMIC multi */ @@ -1227,7 +1237,8 @@ static void scheduler_test_multi_mq_1t_prio_a(void) { int prio = odp_schedule_num_prio();
- schedule_common(ODP_SCHED_SYNC_ATOMIC, MANY_QS, prio, SCHD_MULTI); + schedule_common(ODP_SCHED_SYNC_ATOMIC, globals->queues_per_prio, prio, + SCHD_MULTI); }
/* Many queues 1 thread check priority ODP_SCHED_SYNC_ORDERED multi */ @@ -1235,7 +1246,8 @@ static void scheduler_test_multi_mq_1t_prio_o(void) { int prio = odp_schedule_num_prio();
- schedule_common(ODP_SCHED_SYNC_ORDERED, MANY_QS, prio, SCHD_MULTI); + schedule_common(ODP_SCHED_SYNC_ORDERED, globals->queues_per_prio, prio, + SCHD_MULTI); }
/* Many queues many threads check priority ODP_SCHED_SYNC_PARALLEL multi */ @@ -1243,7 +1255,8 @@ static void scheduler_test_multi_mq_mt_prio_n(void) { int prio = odp_schedule_num_prio();
- parallel_execute(ODP_SCHED_SYNC_PARALLEL, MANY_QS, prio, SCHD_MULTI, 0); + parallel_execute(ODP_SCHED_SYNC_PARALLEL, globals->queues_per_prio, + prio, SCHD_MULTI, 0); }
/* Many queues many threads check priority ODP_SCHED_SYNC_ATOMIC multi */ @@ -1251,7 +1264,8 @@ static void scheduler_test_multi_mq_mt_prio_a(void) { int prio = odp_schedule_num_prio();
- parallel_execute(ODP_SCHED_SYNC_ATOMIC, MANY_QS, prio, SCHD_MULTI, 0); + parallel_execute(ODP_SCHED_SYNC_ATOMIC, globals->queues_per_prio, prio, + SCHD_MULTI, 0); }
/* Many queues many threads check priority ODP_SCHED_SYNC_ORDERED multi */ @@ -1259,7 +1273,8 @@ static void scheduler_test_multi_mq_mt_prio_o(void) { int prio = odp_schedule_num_prio();
- parallel_execute(ODP_SCHED_SYNC_ORDERED, MANY_QS, prio, SCHD_MULTI, 0); + parallel_execute(ODP_SCHED_SYNC_ORDERED, globals->queues_per_prio, prio, + SCHD_MULTI, 0); }
/* 1 queue many threads check exclusive access on ATOMIC queues multi */ @@ -1275,6 +1290,7 @@ static void scheduler_test_pause_resume(void) odp_buffer_t buf; odp_event_t ev; odp_queue_t from; + odp_pool_t pool; int i; int local_bufs = 0; int ret; @@ -1341,6 +1357,7 @@ static void scheduler_test_ordered_lock(void) odp_buffer_t buf; odp_event_t ev; odp_queue_t from; + odp_pool_t pool; int i; int ret; uint32_t lock_count; @@ -1408,11 +1425,16 @@ static int create_queues(test_globals_t *globals) { int i, j, prios, rc; odp_queue_capability_t capa; + odp_pool_t queue_ctx_pool; odp_pool_param_t params; odp_buffer_t queue_ctx_buf; queue_context *qctx, *pqctx; uint32_t ndx; odp_queue_param_t p; + unsigned int num_sched; + unsigned int num_plain; + int queues_per_prio; + int sched_types;
if (odp_queue_capability(&capa) < 0) { printf("Queue capability query failed\n"); @@ -1433,9 +1455,31 @@ static int create_queues(test_globals_t *globals) }
prios = odp_schedule_num_prio(); + + /* Adjust 'queues_per_prio' until all required queues can be created */ + sched_types = 3; + queues_per_prio = QUEUES_PER_PRIO; + num_sched = (prios * queues_per_prio * sched_types) + CHAOS_NUM_QUEUES; + num_plain = (prios * queues_per_prio); + while ((num_sched > capa.sched.max_num || + num_plain > capa.plain.max_num || + num_sched + num_plain > capa.max_queues) && queues_per_prio) { + queues_per_prio--; + num_sched = (prios * queues_per_prio * sched_types) + + CHAOS_NUM_QUEUES; + num_plain = (prios * queues_per_prio); + } + if (!queues_per_prio) { + printf("Not enough queues. At least %d scheduled queues and " + "%d plain queus required.\n", + ((prios * sched_types) + CHAOS_NUM_QUEUES), prios); + return -1; + } + globals->queues_per_prio = queues_per_prio; + odp_pool_param_init(¶ms); params.buf.size = sizeof(queue_context); - params.buf.num = prios * QUEUES_PER_PRIO * 2; + params.buf.num = prios * queues_per_prio * 2; params.type = ODP_POOL_BUFFER;
queue_ctx_pool = odp_pool_create(QUEUE_CTX_POOL_NAME, ¶ms); @@ -1444,13 +1488,14 @@ static int create_queues(test_globals_t *globals) printf("Pool creation failed (queue ctx).\n"); return -1; } + globals->queue_ctx_pool = queue_ctx_pool;
for (i = 0; i < prios; i++) { odp_queue_param_init(&p); p.type = ODP_QUEUE_TYPE_SCHED; p.sched.prio = i;
- for (j = 0; j < QUEUES_PER_PRIO; j++) { + for (j = 0; j < queues_per_prio; j++) { /* Per sched sync type */ char name[32]; odp_queue_t q, pq; @@ -1554,7 +1599,6 @@ static int scheduler_suite_init(void) odp_cpumask_t mask; odp_shm_t shm; odp_pool_t pool; - test_globals_t *globals; thread_args_t *args; odp_pool_param_t params;
@@ -1632,7 +1676,7 @@ static int destroy_queues(void) prios = odp_schedule_num_prio();
for (i = 0; i < prios; i++) { - for (j = 0; j < QUEUES_PER_PRIO; j++) { + for (j = 0; j < globals->queues_per_prio; j++) { char name[32];
snprintf(name, sizeof(name), "sched_%d_%d_n", i, j); @@ -1653,7 +1697,7 @@ static int destroy_queues(void) } }
- if (odp_pool_destroy(queue_ctx_pool) != 0) { + if (odp_pool_destroy(globals->queue_ctx_pool) != 0) { fprintf(stderr, "error: failed to destroy queue ctx pool\n"); return -1; }
commit bfc31d006406481c26aa851257d643d480507e2c Author: Matias Elo matias.elo@nokia.com Date: Fri May 18 10:35:26 2018 +0300
validation: queue: enable passing tests without ordered locks
Supporting ordered locks is not mandatory.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/queue/queue.c b/test/validation/api/queue/queue.c index d09586a8..304de021 100644 --- a/test/validation/api/queue/queue.c +++ b/test/validation/api/queue/queue.c @@ -122,7 +122,6 @@ static void queue_test_capa(void) CU_ASSERT(odp_queue_capability(&capa) == 0);
CU_ASSERT(capa.max_queues != 0); - CU_ASSERT(capa.max_ordered_locks != 0); CU_ASSERT(capa.max_sched_groups != 0); CU_ASSERT(capa.sched_prios != 0); CU_ASSERT(capa.plain.max_num != 0); @@ -432,10 +431,9 @@ static void queue_test_info(void) param.sched.prio = ODP_SCHED_PRIO_NORMAL; param.sched.sync = ODP_SCHED_SYNC_ORDERED; param.sched.group = ODP_SCHED_GROUP_ALL; - if (capability.max_ordered_locks) - param.sched.lock_count = 1; - else - param.sched.lock_count = 0; + param.sched.lock_count = capability.max_ordered_locks; + if (param.sched.lock_count == 0) + printf("\n Ordered locks NOT supported\n"); param.context = q_order_ctx; q_order = odp_queue_create(nq_order, ¶m); CU_ASSERT(ODP_QUEUE_INVALID != q_order); @@ -461,7 +459,7 @@ static void queue_test_info(void) CU_ASSERT(info.param.sched.sync == odp_queue_sched_type(q_order)); CU_ASSERT(info.param.sched.group == odp_queue_sched_group(q_order)); ret = odp_queue_lock_count(q_order); - CU_ASSERT(ret > 0); + CU_ASSERT(ret == param.sched.lock_count); lock_count = ret; CU_ASSERT(info.param.sched.lock_count == lock_count);
-----------------------------------------------------------------------
Summary of changes: test/performance/odp_scheduling.c | 37 +++++++++-- test/validation/api/queue/queue.c | 10 ++- test/validation/api/scheduler/scheduler.c | 104 +++++++++++++++++++++--------- 3 files changed, 109 insertions(+), 42 deletions(-)
hooks/post-receive