From patchwork Thu Feb 9 15:43:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 13134792 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38F88C61DA4 for ; Thu, 9 Feb 2023 15:43:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2A56B10EB2E; Thu, 9 Feb 2023 15:43:31 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4DDA110EB31; Thu, 9 Feb 2023 15:43:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675957409; x=1707493409; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=yUxaVyOttCF+S0o7lkih7Kt4RQxuND25MupPhCYfjrs=; b=LqUAuwU8ZIhzuXlEf99NuyluycL1nZydfB8250I2+PbyqHK7WVrXxW0E SzHdpOUAWzVbTnCx+BKzZ5C1wywOi5YDzyA2YtoMN5zC9VsPlWWUjBynO 1LymJROxwZPEmofiXooYTHBIJlCTHaSSaG74gKMTxOlTFAM4iATcuRYY/ UAsj0DW0rG3kNxXRioEGDK8curF1xdPw4kAXvqZ6oG77XdMk/d4mm3IN3 Yj6qZ5AxyXhMhU/PO6A1MASYfD/msnUJPiCpq5yKGRS/y+kFYDjWvub6r XS1WqV86nrhiQrap6RBiInm36u2T0Xe1c0AD01Dnhb2Q6Cb9Jx0U6nfjB w==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="331440704" X-IronPort-AV: E=Sophos;i="5.97,284,1669104000"; d="scan'208";a="331440704" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2023 07:43:28 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="645308786" X-IronPort-AV: E=Sophos;i="5.97,284,1669104000"; d="scan'208";a="645308786" Received: from jptoner-mobl2.ger.corp.intel.com (HELO localhost.localdomain) ([10.213.192.123]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2023 07:43:27 -0800 From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Thu, 9 Feb 2023 15:43:12 +0000 Message-Id: <20230209154315.468682-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [Intel-gfx] [RFC 0/3] Waitboost drm syncobj waits X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Tvrtko Ursulin In i915 we have this concept of "wait boosting" where we give a priority boost for instance to fences which are actively waited upon from userspace. This has it's pros and cons and can certainly be discussed at lenght. However fact is some workloads really like it. Problem is that with the arrival of drm syncobj and a new userspace waiting entry point it added, the waitboost mechanism was bypassed. Hence I cooked up this mini series really (really) quickly to see if some discussion can be had. It adds a concept of "wait count" to dma fence, which is incremented for every explicit dma_fence_enable_sw_signaling and dma_fence_add_wait_callback (like dma_fence_add_callback but from explicit/userspace wait paths). Individual drivers can then inspect this via dma_fence_wait_count() and decide to wait boost the waits on such fences. Again, quickly put together and smoke tested only - no guarantees whatsoever and I will rely on interested parties to test and report if it even works or how well. Tvrtko Ursulin (3): dma-fence: Track explicit waiters drm/syncobj: Mark syncobj waits as external waiters drm/i915: Waitboost external waits drivers/dma-buf/dma-fence.c | 102 ++++++++++++++++++++-------- drivers/gpu/drm/drm_syncobj.c | 6 +- drivers/gpu/drm/i915/i915_request.c | 13 +++- include/linux/dma-fence.h | 14 ++++ 4 files changed, 101 insertions(+), 34 deletions(-)