From patchwork Wed Aug 3 15:36:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Gordon X-Patchwork-Id: 9261523 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8955B60754 for ; Wed, 3 Aug 2016 15:37:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A98A27F60 for ; Wed, 3 Aug 2016 15:37:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F1E728236; Wed, 3 Aug 2016 15:37:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E05827F60 for ; Wed, 3 Aug 2016 15:37:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D79296E843; Wed, 3 Aug 2016 15:37:05 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A2246E845 for ; Wed, 3 Aug 2016 15:36:54 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 03 Aug 2016 08:36:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,466,1464678000"; d="scan'208";a="743683233" Received: from dsgordon-linux2.isw.intel.com ([10.102.226.88]) by FMSMGA003.fm.intel.com with ESMTP; 03 Aug 2016 08:36:54 -0700 From: Dave Gordon To: intel-gfx@lists.freedesktop.org Date: Wed, 3 Aug 2016 16:36:46 +0100 Message-Id: <1470238607-34415-2-git-send-email-david.s.gordon@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470238607-34415-1-git-send-email-david.s.gordon@intel.com> References: <1470238607-34415-1-git-send-email-david.s.gordon@intel.com> Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ Subject: [Intel-gfx] [PATCH 1/2] igt/gem_exec_nop: add burst submission to parallel execution test X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP The parallel execution test in gem_exec_nop chooses a pessimal distribution of work to multiple engines; specifically, it round-robins one batch to each engine in turn. As the workloads are trivial (NOPs), this results in each engine becoming idle between batches. Hence parallel submission is seen to take LONGER than the same number of batches executed sequentially. If on the other hand we send enough work to each engine to keep it busy until the next time we add to its queue, (i.e. round-robin some larger number of batches to each engine in turn) then we can get true parallel execution and should find that it is FASTER than sequential execuion. By experiment, burst sizes of between 8 and 256 are sufficient to keep multiple engines loaded, with the optimum (for this trivial workload) being around 64. This is expected to be lower (possibly as low as one) for more realistic (heavier) workloads. Signed-off-by: Dave Gordon Reviewed-by: John Harrison --- tests/gem_exec_nop.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c index 9b89260..c2bd472 100644 --- a/tests/gem_exec_nop.c +++ b/tests/gem_exec_nop.c @@ -166,14 +166,17 @@ static void all(int fd, uint32_t handle, int timeout) gem_sync(fd, handle); intel_detect_and_clear_missed_interrupts(fd); +#define BURST 64 + count = 0; clock_gettime(CLOCK_MONOTONIC, &start); do { - for (int loop = 0; loop < 1024; loop++) { + for (int loop = 0; loop < 1024/BURST; loop++) { for (int n = 0; n < nengine; n++) { execbuf.flags &= ~ENGINE_FLAGS; execbuf.flags |= engines[n]; - gem_execbuf(fd, &execbuf); + for (int b = 0; b < BURST; ++b) + gem_execbuf(fd, &execbuf); } } count += nengine * 1024;