From patchwork Fri Jul 22 10:04:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elo, Matias \(Nokia - FI/Espoo\)" X-Patchwork-Id: 72606 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp911641qga; Fri, 22 Jul 2016 03:06:03 -0700 (PDT) X-Received: by 10.129.135.5 with SMTP id x5mr2355352ywf.114.1469181963585; Fri, 22 Jul 2016 03:06:03 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 41si8216102qkq.172.2016.07.22.03.06.03; Fri, 22 Jul 2016 03:06:03 -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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE dis=NONE) header.from=nokia.com Received: by lists.linaro.org (Postfix, from userid 109) id DD56A68254; Fri, 22 Jul 2016 10:06:02 +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=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, URIBL_BLOCKED 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 1848668257; Fri, 22 Jul 2016 10:05:58 +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 D452C68257; Fri, 22 Jul 2016 10:05:55 +0000 (UTC) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00115.outbound.protection.outlook.com [40.107.0.115]) by lists.linaro.org (Postfix) with ESMTPS id B58DA68251 for ; Fri, 22 Jul 2016 10:05:54 +0000 (UTC) Received: from VI1PR07CA0029.eurprd07.prod.outlook.com (10.163.160.167) by AM4PR07MB1476.eurprd07.prod.outlook.com (10.165.248.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.544.10; Fri, 22 Jul 2016 10:05:52 +0000 Received: from DB3FFO11FD053.protection.gbl (2a01:111:f400:7e04::108) by VI1PR07CA0029.outlook.office365.com (2a01:111:e400:533d::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.544.10 via Frontend Transport; Fri, 22 Jul 2016 10:05:51 +0000 Received-SPF: Pass (protection.outlook.com: domain of nokia.com designates 131.228.2.241 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.2.241; helo=fihe3nok0735.emea.nsn-net.net; Received: from fihe3nok0735.emea.nsn-net.net (131.228.2.241) by DB3FFO11FD053.mail.protection.outlook.com (10.47.217.125) with Microsoft SMTP Server (TLS) id 15.1.539.16 via Frontend Transport; Fri, 22 Jul 2016 10:05:52 +0000 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u6MA5WCB013424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 22 Jul 2016 13:05:32 +0300 Received: from 10.144.19.15 ([10.144.104.111]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u6MA5MWV013147 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 22 Jul 2016 13:05:32 +0300 X-HPESVCS-Source-Ip: 10.144.104.111 From: Matias Elo To: Date: Fri, 22 Jul 2016 13:04:57 +0300 Message-ID: <1469181897-19168-4-git-send-email-matias.elo@nokia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1469181897-19168-1-git-send-email-matias.elo@nokia.com> References: <1469181897-19168-1-git-send-email-matias.elo@nokia.com> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.241; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(68736007)(8676002)(586003)(16796002)(2351001)(229853001)(2950100001)(450100001)(19580395003)(50226002)(19580405001)(77096005)(106466001)(356003)(81166006)(7846002)(81156014)(33646002)(8936002)(305945005)(36756003)(107886002)(110136002)(5003940100001)(92566002)(50986999)(76176999)(189998001)(97736004)(2906002)(47776003)(48376002)(11100500001)(87936001)(6806005)(50466002)(42882005); DIR:OUT; SFP:1102; SCL:1; SRVR:AM4PR07MB1476; H:fihe3nok0735.emea.nsn-net.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD053; 1:ZyaaZh0SaPL0kwvTGtYanXXl/W0Q0nTd9SLbJ+KO/uiG4xU/sBKdIz+zXsdnADHpiaybHt501T3rEqRtmQWqXtPqeqaOIIXDKyutVqplKPQVvfhkVlO0aT+w4t8xzZaxHHwHgnAUpyo0lYmWSCOKSC9F6lbO2zAoFIXp3FnJOAw/uXxcO2Se8KvUv/dIfsDNcQkRAIrd/2qGot4HoDovb8osyto0z4icfU/NgQVGpCdS0gp/QZdlXGMnDUFwT+SLXhXQ3pwN4QvKK/D3ZYAMVa70EBvyJsUIO1bPDwaOU1XAvrcEffNPosLd2G8JtrK1Lreu8EqwnK0zm7G/QB/Zg86UJjarniw0pKV4HOzi0kPq5WAyUMyOFEAHqotC7EDEjlcGJCOERM1hWufdd8YUddFh6ISckC1pup/8RRTT6LNCr3CunOfy/mbHhRq7DltKu6Zt5McOzFCvUi6fZJVSQsstjMBXxYpy71zqJirdJw0FzxtH8xj18S6MYmEglMkV MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 8a37e753-8b26-4ef2-f71f-08d3b217c39c X-Microsoft-Exchange-Diagnostics: 1; AM4PR07MB1476; 2:MyVqnc1nF4qek3bvSdt98R/0u7/K9JLi/ugSPlAde3bbcp+C5tihi8Zs1Sai/CkjC0N0PndtccTTXa+2EaeH+7YdiIAiQg0jGm1vz15CRE+Y4nJvw6HtA1nySOisxQ7fs3Ib+zJ+3pzgDp/8S4paWGgvfiNWGqo8vVoVKkbCB9+iy0ZvAhW6aLdTO+SRl1Wf; 3:BLr2lBbOjllg9ED0EF1h+JhUJj+T9EJdU2mbrheX0/nJgwQXZGRt78W2E/ihFbg5qm9PuAUeSL93vbh5HMb+2SSRagJ7tR5kuoTqY7XR9FKcxY35dDy6pxxddCaqqSN75t3l2qJFeo+W/WEVIVn6rCOc8Q1Qby5RsDSVjLFBRry5tdY+zI2SjBd+GphOOaxxQvZC1xKK+WoFLUJBXWS4Za3SJ2PVapJpSqXXzN3JEATk1/k/valjoc3cjUyKYH9iTuoHuOcFIzm6t/+Zyy94Tg== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:AM4PR07MB1476; X-Microsoft-Exchange-Diagnostics: 1; AM4PR07MB1476; 25:1xvtpl+tEkdSi9YwogTHvi+phuZI7VHcZeeOGBBGHPCpb9jMk2v8PG5KbnWFhV2V6QR3yglmilC/SqJ/EIfNlcK45jZHHioDaPumk6jjMCKJs8PMTiJkF9w653OEvOo1rZ6gXY16QIUZm77bYkU1Imuq9j1FxQmEW44Det8oqmGW3Wh1TneTNOYsijjDR7SZz2Jj080vB+DkUYDnW65bJbtF5UIK0cY7vojjEGLU7gLe6oHQ96RceOR4ls3bNVwTxtLhTznifBU8hlZ2jYWKQG+aEctfLFHJtDen7eJZgLA7WpmaF8rA3tZ6T+A0RJHQYAsJP3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CwAXDKvdo1sDChW9nqgw4s21H5dgquzUVe32WsxHx4RiLFyD6ZAu4EXOfMtn5uNO5eGBA0oMYb1c2wp1WSonNBMGNNz6tS/EgrGU8A7hh6fnrSXdOzB+KOaIkTW9DACn9AFZqtK7/1pK8EymeBqTsoSuBf5woMHwxQwbSmFGOlmg0nmbuPiiiwScGVDT1cL8EOHkNiJpsuHx0HQNBqjfRr522GSGNnzB+T9vuhC7tS2IHVIWgp+5havFcXFQtiiQR7EWtVvK+1QM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(13018025)(13016025)(3002001)(10201501046)(6055026); SRVR:AM4PR07MB1476; BCL:0; PCL:0; RULEID:; SRVR:AM4PR07MB1476; X-Microsoft-Exchange-Diagnostics: 1; AM4PR07MB1476; 4:Lz5x+7J56+hxjYxUr2+zBDLF9c2uLuauk3uGKVhpePsoNOrpqvufQqXMWEWeacqdyFKuMh4gD8lE0j+OgjgVaPFPptLc22o7wUk5iLqkVUJa6HR64tHMi/RcnI2R3d/2bC/g2GtXqRdRi3c6W4zOTSD+grH2AhIhNWBd78m0wMYyT2Lj4JT3jBvKbTIgyKBNS4aGNe4Zz4UGHPEPPAx0Pu1dDrbw0APijX4Zei0lCWvW5E1wQ6n2T6edr/lOnfybNJDt+c85A3DlPPPwJyPZrrIqrr7sR6w9BDINwZIS57HFuYWFiwaW9Ab47l4VnoDfJKqA0fM4oT96sbcRnZhPd3qD+Cr+tZVemqR5FtVQUEbImg6Bk/zpBWeTBcKNiQ6VEQCBqaeYdmIgo3pyHf/ywOGit6ZfGNbJ2hrLuk7gDSDWYtcieZaIpjDqyo0xUZjgnLaYdxQc3Xq/Vr2MFlnXrw== X-Forefront-PRVS: 0011612A55 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR07MB1476; 23:m5zWrcnTlMp2+sM+A22qz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aJaA524h0DCUWr3skCoBhypRbrT42fN5jPLn5UxNtBGu8Cy25o1FIEax8GI04zaD/oQEtpme9s3P/SViq+roWU5XXtddKiEO7xVywv58B SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2016 10:05:52.3335 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.241]; Helo=[fihe3nok0735.emea.nsn-net.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR07MB1476 X-Topics: patch Subject: [lng-odp] [PATCH v3 4/4] performance: odp_scheduling: use multi alloc/free buffer functions 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" Use odp_buffer_alloc_multi() and odp_buffer_free_multi() functions where appropriate for improved performance. Signed-off-by: Matias Elo --- test/common_plat/performance/odp_scheduling.c | 50 ++++++++++++++++++--------- 1 file changed, 33 insertions(+), 17 deletions(-) -- 2.7.4 diff --git a/test/common_plat/performance/odp_scheduling.c b/test/common_plat/performance/odp_scheduling.c index 5a2997f..1d1bf01 100644 --- a/test/common_plat/performance/odp_scheduling.c +++ b/test/common_plat/performance/odp_scheduling.c @@ -29,7 +29,7 @@ #include #define MSG_POOL_SIZE (4 * 1024 * 1024) /**< Message pool size */ -#define MAX_ALLOCS 35 /**< Alloc burst size */ +#define MAX_ALLOCS 32 /**< Alloc burst size */ #define QUEUES_PER_PRIO 64 /**< Queue per priority */ #define NUM_PRIOS 2 /**< Number of tested priorities */ #define QUEUE_ROUNDS (512 * 1024) /**< Queue test rounds */ @@ -131,9 +131,10 @@ static void clear_sched_queues(void) static int enqueue_events(int thr, int prio, int num_queues, int num_events, test_globals_t *globals) { - odp_buffer_t buf; + odp_buffer_t buf[num_events]; + odp_event_t ev[num_events]; odp_queue_t queue; - int i, j, k; + int i, j, k, ret; if (prio == ODP_SCHED_PRIO_HIGHEST) i = 0; @@ -144,19 +145,28 @@ static int enqueue_events(int thr, int prio, int num_queues, int num_events, for (j = 0; j < num_queues; j++) { queue = globals->queue[i][j]; + ret = odp_buffer_alloc_multi(globals->pool, buf, num_events); + if (ret != num_events) { + LOG_ERR(" [%i] buffer alloc failed\n", thr); + ret = ret < 0 ? 0 : ret; + odp_buffer_free_multi(buf, ret); + return -1; + } for (k = 0; k < num_events; k++) { - buf = odp_buffer_alloc(globals->pool); - - if (!odp_buffer_is_valid(buf)) { + if (!odp_buffer_is_valid(buf[k])) { LOG_ERR(" [%i] buffer alloc failed\n", thr); + odp_buffer_free_multi(buf, num_events); return -1; } + ev[k] = odp_buffer_to_event(buf[k]); + } - if (odp_queue_enq(queue, odp_buffer_to_event(buf))) { - LOG_ERR(" [%i] Queue enqueue failed.\n", thr); - odp_buffer_free(buf); - return -1; - } + ret = odp_queue_enq_multi(queue, ev, num_events); + if (ret != num_events) { + LOG_ERR(" [%i] Queue enqueue failed.\n", thr); + ret = ret < 0 ? 0 : ret; + odp_buffer_free_multi(&buf[ret], num_events - ret); + return -1; } } @@ -210,24 +220,30 @@ static int test_alloc_single(int thr, test_globals_t *globals) */ static int test_alloc_multi(int thr, test_globals_t *globals) { - int i, j; + int i, j, ret; odp_buffer_t temp_buf[MAX_ALLOCS]; uint64_t c1, c2, cycles; c1 = odp_cpu_cycles(); for (i = 0; i < ALLOC_ROUNDS; i++) { + ret = odp_buffer_alloc_multi(globals->pool, temp_buf, + MAX_ALLOCS); + if (ret != MAX_ALLOCS) { + LOG_ERR(" [%i] buffer alloc failed\n", thr); + ret = ret < 0 ? 0 : ret; + odp_buffer_free_multi(temp_buf, ret); + return -1; + } + for (j = 0; j < MAX_ALLOCS; j++) { - temp_buf[j] = odp_buffer_alloc(globals->pool); - if (!odp_buffer_is_valid(temp_buf[j])) { LOG_ERR(" [%i] alloc_multi failed\n", thr); + odp_buffer_free_multi(temp_buf, MAX_ALLOCS); return -1; } } - - for (; j > 0; j--) - odp_buffer_free(temp_buf[j - 1]); + odp_buffer_free_multi(temp_buf, MAX_ALLOCS); } c2 = odp_cpu_cycles();