From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CD44C28CBC for ; Wed, 6 May 2020 07:48:52 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4D29A206D5 for ; Wed, 6 May 2020 07:48:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D29A206D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=chris-wilson.co.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E0AA389C21; Wed, 6 May 2020 07:48:47 +0000 (UTC) Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id 28BAE89C21 for ; Wed, 6 May 2020 07:48:46 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from localhost (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP (TLS) id 21123111-1500050 for ; Wed, 06 May 2020 08:48:45 +0100 MIME-Version: 1.0 In-Reply-To: <20200505215214.9690-9-chris@chris-wilson.co.uk> References: <20200505215214.9690-1-chris@chris-wilson.co.uk> <20200505215214.9690-9-chris@chris-wilson.co.uk> From: Chris Wilson To: intel-gfx@lists.freedesktop.org Message-ID: <158875132117.927.14561998764093526782@build.alporthouse.com> User-Agent: alot/0.8.1 Date: Wed, 06 May 2020 08:48:41 +0100 Subject: Re: [Intel-gfx] [PATCH 09/14] drm/i915/gem: Teach execbuf how to wait on future syncobj 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Quoting Chris Wilson (2020-05-05 22:52:09) > +bool i915_sched_node_verify_dag(struct i915_sched_node *waiter, > + struct i915_sched_node *signaler) > +{ > + struct i915_dependency *dep, *p; > + struct i915_dependency stack; > + bool result = false; > + LIST_HEAD(dfs); > + > + if (list_empty(&waiter->waiters_list)) > + return true; > + > + spin_lock_irq(&schedule_lock); > + > + stack.signaler = signaler; > + list_add(&stack.dfs_link, &dfs); > + > + list_for_each_entry(dep, &dfs, dfs_link) { > + struct i915_sched_node *node = dep->signaler; > + > + if (node_signaled(node)) > + continue; > + > + list_for_each_entry(p, &node->signalers_list, signal_link) { > + if (p->signaler == waiter) > + goto out; > + > + if (list_empty(&p->dfs_link)) > + list_add_tail(&p->dfs_link, &dfs); > + } > + } Food for thought. With the timeline tracking we have a means to see the latest sync points and then we only need to compare the edges between timelines, rather than the whole graph. We need to kill this global serialisation, not just here but for rescheduling as well. But the only alternative to using dfs_link would be a local temporary iterator, which has yet to appeal. There must be a good way of doing concurrent iterative dag traversals with no memory allocations... -Chris _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx