From patchwork Mon Aug 5 15:45:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 11085871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9EFB814F7 for ; Fri, 9 Aug 2019 09:17:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DE5028BBC for ; Fri, 9 Aug 2019 09:17:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8216728C3E; Fri, 9 Aug 2019 09:17:28 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4521528BBC for ; Fri, 9 Aug 2019 09:17:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C04F6EDBC; Fri, 9 Aug 2019 09:16:24 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id D08FD6E492; Mon, 5 Aug 2019 15:45:57 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id f9so5985422wre.12; Mon, 05 Aug 2019 08:45:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=r9iyE3YOKUeG5ZizxulW4D4UK5rsERFOEpq/DiuLZko=; b=W4OH4rrWHtt8VnJ/1hWHz0MAt+P/xZ87cwMuevsXSfVZbSAhNpFPAWIHfbt4dc6UW4 eKTigP7KUkHOxJ7jtWqUGI5djxwZUwLtiTaMIIcNc/ywRNtNIOiVAZI1YHpmsbI95lh4 pETgB8dkaT3ZbtsNUDSZc+d8SNheUyeKdb6N5B5QZzh74ncaaKdqChuybFayWdGi82Ct qOwkSH0JGKtQemjp+sA5e5x/oC7bHUuBEANuwcrENWJeLE08/fnNFSUPYFE4RCav8R5q eBkvkN4+F3MquIoYSppwQFjeUow4JPXjFWttuQXjZPthASVWdpmZCrUnFV9ssAqpS7vf JUmg== X-Gm-Message-State: APjAAAVPnrjRbDXpG0W5S4nau+IF2NyKIX7T2Dlt8J7Qp0F6sTVEdTUC Q9FQED3lzHx+Px6UuokBMwStGNiH X-Google-Smtp-Source: APXvYqwCfN2jELpOVXfZqazfG5tJI+AkZ8uPPiqhfPSXd+Hfql7qg3WBGsEluL6UnV4wSsPytaVFDA== X-Received: by 2002:a05:6000:14b:: with SMTP id r11mr11212622wrx.196.1565019956350; Mon, 05 Aug 2019 08:45:56 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:fdbd:6233:4990:5a8d]) by smtp.gmail.com with ESMTPSA id 91sm171836865wrp.3.2019.08.05.08.45.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Aug 2019 08:45:55 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: intel-gfx@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, chris@chris-wilson.co.uk Date: Mon, 5 Aug 2019 17:45:50 +0200 Message-Id: <20190805154554.3476-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 09 Aug 2019 09:15:44 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=r9iyE3YOKUeG5ZizxulW4D4UK5rsERFOEpq/DiuLZko=; b=r9V02blzsn/6sU9/5govctOIYa39rlzhhnCWUYpMiBr5RPzdlvmSKgAYjBwfpWrye3 GIK3Z0ZsnMO+mIW7sB6C9vQSUBjvGPMf9zOz9aEj6gdIUn3pcZ/tQ0qooolgGvNZepz8 FaPAT4RqE1dpCNs8ZzPAtC773iHBIz96czJ0t6bBJzOnt4p+Q+2D2+ZnCttlZ6+jO4Pa 8aPnXDJe/Z0fJtACdcGBKFxrlejBuusaM+n5JrCM4ta2LG/MSd9uho9HFVxSEJa9JkTj yFCpY3TQfzmD8E024Pzjk7wIcO7LSPBYD8jj6yKYumTylx2nIs0rWabchkJmVBZDT81z 1mvw== Subject: [Intel-gfx] [PATCH 1/5] drm/i915: stop pruning reservation object after wait X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 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" X-Virus-Scanned: ClamAV using ClamSMTP The reservation object should be capable of handling its internal memory management itself. And since we search for a free slot to add the fence from the beginning this is actually a waste of time and only minimal helpful. Drop it to allow removal of the seqno handling in the reservation object. This essentially reverts commit "drm/i915: Remove completed fences after a wait". Signed-off-by: Christian König --- drivers/gpu/drm/i915/gem/i915_gem_wait.c | 27 ------------------------ 1 file changed, 27 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_wait.c b/drivers/gpu/drm/i915/gem/i915_gem_wait.c index 26ec6579b7cd..bb64ec6bef8e 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_wait.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_wait.c @@ -35,9 +35,7 @@ i915_gem_object_wait_reservation(struct reservation_object *resv, unsigned int flags, long timeout) { - unsigned int seq = __read_seqcount_begin(&resv->seq); struct dma_fence *excl; - bool prune_fences = false; if (flags & I915_WAIT_ALL) { struct dma_fence **shared; @@ -61,17 +59,6 @@ i915_gem_object_wait_reservation(struct reservation_object *resv, for (; i < count; i++) dma_fence_put(shared[i]); kfree(shared); - - /* - * If both shared fences and an exclusive fence exist, - * then by construction the shared fences must be later - * than the exclusive fence. If we successfully wait for - * all the shared fences, we know that the exclusive fence - * must all be signaled. If all the shared fences are - * signaled, we can prune the array and recover the - * floating references on the fences/requests. - */ - prune_fences = count && timeout >= 0; } else { excl = reservation_object_get_excl_rcu(resv); } @@ -80,20 +67,6 @@ i915_gem_object_wait_reservation(struct reservation_object *resv, timeout = i915_gem_object_wait_fence(excl, flags, timeout); dma_fence_put(excl); - - /* - * Opportunistically prune the fences iff we know they have *all* been - * signaled and that the reservation object has not been changed (i.e. - * no new fences have been added). - */ - if (prune_fences && !__read_seqcount_retry(&resv->seq, seq)) { - if (reservation_object_trylock(resv)) { - if (!__read_seqcount_retry(&resv->seq, seq)) - reservation_object_add_excl_fence(resv, NULL); - reservation_object_unlock(resv); - } - } - return timeout; }