From patchwork Tue Jan 21 13:31:42 2020 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: 11343875 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4604E6C1 for ; Tue, 21 Jan 2020 13:31:51 +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 2439F217F4 for ; Tue, 21 Jan 2020 13:31:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="evPs1aDN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2439F217F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 72B426ECEB; Tue, 21 Jan 2020 13:31:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id B07576ECEB for ; Tue, 21 Jan 2020 13:31:46 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id a5so2980404wmb.0 for ; Tue, 21 Jan 2020 05:31:46 -0800 (PST) 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=LCez1RWpkSYZX+SQqc5BY0aPqdFLfLcrLpCezMG9G1U=; b=evPs1aDN4XgdkM3QAq0Vt3zo9Zwf43OBhgqIcXmgNiyLJxTUGHMKEg/Q+B7/zi0cGT /rsGclHd1Rgfpon12GVdqs3oDyzI+7doJHvMKxOHV5wJ5bf78FDmXA0ueaXnh3FyIEch AFFopbx3USU45HE1RCuLdgvP7BCJ4Tu9LgRNXywPtzBa+86OCYeIRJxzQVvg9BUs1Klf yriZbJ+3FhBDD6mh3Cqbt6YKOxhPZvuALF7cDuBFFxrnZ4dZ72+gV4T8n0Ti5hTkG/SX cAOD5IgSnUEtAssKSH0JR5OrC2+onCXef44thwG7aG0g66Zi6LYXPg6vnVNRSdRm1Qtw gv+A== 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=LCez1RWpkSYZX+SQqc5BY0aPqdFLfLcrLpCezMG9G1U=; b=Fd1kwfqDRdNDyCuYZrHVSiMc5+5OU/Ixx1S8pHt/EsNFDYzQiqBo2A9TJNBQWB+wfZ ErViXjC57GoZLssE0WcgfDJQcqy5+ar+XbZ5SrRKp/5ILV2mVCpycrnaIrefSC9YXTjX 3nyK/x5Q/rCmyJpFI5pAbE9lBdLGuFq7e/xhd4XsQMFax43EKwhYVQOzfS+B9sMQKRPM h9qWnb4L21/EaCt7dQ1TyNPJQz3UjapgbpEB52DAJnIahYgTs9yhACBqWVTN+LOogyxc qRt9AJIhalsJu5esFjzKTQkNj/KC/XAmEhQSkim8z7r4cJJxFf0AR3DnwAbhMCjmommE sw4g== X-Gm-Message-State: APjAAAUqvebS6NUJyBaH4IBU9ouQ+4CpM3oNq0Czf4Uq28dhgYzDZo6W 4NhXo6AxrsOZcK7yWmqR2Z0B6Bwu X-Google-Smtp-Source: APXvYqwbpFyuXdPc0OzUce1GbmXL9Ncw4P0r1XmDWJJXqKBj4pmqPvyJ47/giEK1Mke/F6hJ8ellvw== X-Received: by 2002:a05:600c:108a:: with SMTP id e10mr4292921wmd.38.1579613505247; Tue, 21 Jan 2020 05:31:45 -0800 (PST) Received: from laptop.fritz.box ([2a02:908:1252:fb60:be8a:bd56:1f94:86e7]) by smtp.gmail.com with ESMTPSA id x11sm3955284wmg.46.2020.01.21.05.31.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 05:31:44 -0800 (PST) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/ttm: flush the fence on the bo after we individualize the reservation object Date: Tue, 21 Jan 2020 14:31:42 +0100 Message-Id: <20200121133142.928-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: xinhui pan As we move the ttm_bo_individualize_resv() upwards, we need flush the copied fence too. Otherwise the driver keeps waiting for fence. run&Kill kfdtest, then perf top. 25.53% [ttm] [k] ttm_bo_delayed_delete 24.29% [kernel] [k] dma_resv_test_signaled_rcu 19.72% [kernel] [k] ww_mutex_lock Fix: 378e2d5b("drm/ttm: fix ttm_bo_cleanup_refs_or_queue once more") Signed-off-by: xinhui pan Reviewed-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 06f6d650827f..1fbc36f05d89 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -491,8 +491,10 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo) dma_resv_unlock(bo->base.resv); } - if (bo->base.resv != &bo->base._resv) + if (bo->base.resv != &bo->base._resv) { + ttm_bo_flush_all_fences(bo); dma_resv_unlock(&bo->base._resv); + } error: kref_get(&bo->list_kref);