From patchwork Wed May 19 10:15:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 443127 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 C96CFC43460 for ; Wed, 19 May 2021 10:15:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A82F66135C for ; Wed, 19 May 2021 10:15:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347474AbhESKQz (ORCPT ); Wed, 19 May 2021 06:16:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345568AbhESKQx (ORCPT ); Wed, 19 May 2021 06:16:53 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97ED9C06175F for ; Wed, 19 May 2021 03:15:33 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id q5so13395742wrs.4 for ; Wed, 19 May 2021 03:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DLSDac+zFZCvuOxhlqODKoOPK9Xt9GPFhoNCyvTD8Gg=; b=VE3Te1/ELmmu2l86Lyr6KvezntZCLWf3JxFRLBAdIc98DxKufyJcGGYNgU6jEpk1us MePhBlWICyHVnWm6snPH7aXxkaEjHarlT8pnHfK0kBuBwRXIdYViL8BJYIifkmOzh/iC 57UyC4tMTfhAVC1r/33TyCzLN6Qwpars8fO4w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DLSDac+zFZCvuOxhlqODKoOPK9Xt9GPFhoNCyvTD8Gg=; b=T+vw+2u/A94969IkBQo0IEOLbdmOIuzoLqhmJg1Lw1fohSlT82LNQ0OZpdpppfoDkG EJ2CTfc8HFubRzudNAu7BEzTGud8CSDfFbJGJ5PiLH9mY1PtoR/VZlSF39LcWP+WdrYi 5LTv4rIf+Uu+0b0LL4zNuAJ4hd8CVuwWDGOkr93hSd74m0hr7D/cxAvzLDQZgu1v3Syu N0YMLVW/rlOobQyA7Wbw89geqZOUJD4wMlmghQe1+GKD5G+lCtw0MOQgUnWqV6ntTTuC D3jUGgDUP4F7QaZCtjoM08MYfzCWR+8wr+Ye7OlM+syu0xQ0T5qU4vMg3s41PFSMVPrT Y6jw== X-Gm-Message-State: AOAM533D1sjwjhsiid4E1GbT+AWkGgXuruDtjeR9s42J15f2ITNRqLmX OmdLVUaAddwhbb7g8GdhQ8fkOw== X-Google-Smtp-Source: ABdhPJyO4uSwCzhB8EODPl4WGgU0IKdKHfwW8l5xIaB3JUwY+ZsaqHCkvbPehwjj6lBFCrttZTHPBQ== X-Received: by 2002:adf:f309:: with SMTP id i9mr13931576wro.307.1621419332273; Wed, 19 May 2021 03:15:32 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id d3sm25215307wrs.41.2021.05.19.03.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 03:15:31 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development , DRI Development Cc: Jason Ekstrand , Jason Ekstrand , Marcin Slusarz , stable@vger.kernel.org, Jon Bloomfield , Daniel Vetter Subject: [PATCH] Revert "drm/i915: Propagate errors on awaiting already signaled fences" Date: Wed, 19 May 2021 12:15:23 +0200 Message-Id: <20210519101523.688398-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210519074323.665872-2-daniel.vetter@ffwll.ch> References: <20210519074323.665872-2-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jason Ekstrand This reverts commit 9e31c1fe45d555a948ff66f1f0e3fe1f83ca63f7. Ever since that commit, we've been having issues where a hang in one client can propagate to another. In particular, a hang in an app can propagate to the X server which causes the whole desktop to lock up. Error propagation along fences sound like a good idea, but as your bug shows, surprising consequences, since propagating errors across security boundaries is not a good thing. What we do have is track the hangs on the ctx, and report information to userspace using RESET_STATS. That's how arb_robustness works. Also, if my understanding is still correct, the EIO from execbuf is when your context is banned (because not recoverable or too many hangs). And in all these cases it's up to userspace to figure out what is all impacted and should be reported to the application, that's not on the kernel to guess and automatically propagate. What's more, we're also building more features on top of ctx error reporting with RESET_STATS ioctl: Encrypted buffers use the same, and the userspace fence wait also relies on that mechanism. So it is the path going forward for reporting gpu hangs and resets to userspace. So all together that's why I think we should just bury this idea again as not quite the direction we want to go to, hence why I think the revert is the right option here.Signed-off-by: Jason Ekstrand v2: Augment commit message. Also restore Jason's sob that I accidentally lost. Signed-off-by: Jason Ekstrand (v1) Reported-by: Marcin Slusarz Cc: # v5.6+ Cc: Jason Ekstrand Cc: Marcin Slusarz Cc: Jon Bloomfield Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3080 Fixes: 9e31c1fe45d5 ("drm/i915: Propagate errors on awaiting already signaled fences") Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_request.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c index 970d8f4986bb..b796197c0772 100644 --- a/drivers/gpu/drm/i915/i915_request.c +++ b/drivers/gpu/drm/i915/i915_request.c @@ -1426,10 +1426,8 @@ i915_request_await_execution(struct i915_request *rq, do { fence = *child++; - if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) { - i915_sw_fence_set_error_once(&rq->submit, fence->error); + if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) continue; - } if (fence->context == rq->fence.context) continue; @@ -1527,10 +1525,8 @@ i915_request_await_dma_fence(struct i915_request *rq, struct dma_fence *fence) do { fence = *child++; - if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) { - i915_sw_fence_set_error_once(&rq->submit, fence->error); + if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) continue; - } /* * Requests on the same timeline are explicitly ordered, along From patchwork Wed May 19 07:43:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 443130 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 19C68C43460 for ; Wed, 19 May 2021 07:43:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE294613AD for ; Wed, 19 May 2021 07:43:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240604AbhESHo5 (ORCPT ); Wed, 19 May 2021 03:44:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240620AbhESHox (ORCPT ); Wed, 19 May 2021 03:44:53 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBBB1C061760 for ; Wed, 19 May 2021 00:43:32 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id x8so12872858wrq.9 for ; Wed, 19 May 2021 00:43:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XREiNZvCt6m1Dz1Oz10kerKOA32xyw0gcDqrFl0Jar4=; b=YhbZIvlwlURfAY2JJWuFzVGxB9Q6qk/356Juc+n9uPixFDUJtEab9cjJ4rMEoq7RPu YkLCt0La26xbLf/28C/O6O7EXaUiroCs0qN+IIU8fHVXvNQ2ejJdrrm/wpaBWUAvoYw6 ZwDR3gFKoVWA56fRO/9uoZhA4GaqqLwpsm/t0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XREiNZvCt6m1Dz1Oz10kerKOA32xyw0gcDqrFl0Jar4=; b=d/QUH60NmkFZiyeTtgs9k3sfFZItMAVKzK2e4xaZ0scYN3Fcaq0OK4+V8wryh96J2A pXunfOjGWdx+1p19gk6d4B/uPZzDJ5U+Wrm1NJWjszGHKQ44jVJPRAmqYelI1MubmZN6 FeRkGIHSSpwFmYiznVQXoTDuoUD9H2A18yOdTq8jTVEz0U4tGR4RrkXPA6Vv4fxk+6Qj ZBae81CpyzL+uQbFvV7KOiD6H0sIE/tu30d6snlkuFpcuYpgavNrvbd0ZFOGJ/e9jBLL Oz4BVHJfFvRUcGSmIickjGIQC3VeamTiN9RhUim5vGa/hSdRpqx7eVBwEcTg/0P4AGhN lYlQ== X-Gm-Message-State: AOAM532UDN/DlODbWYa++iIt40E6FkHlnuWq+shhIJqEo1VDB15ypLDs /ZmGaN+GYT5caSBLhMO/18JoRA== X-Google-Smtp-Source: ABdhPJz8JhBGQu/oYkUVZ03JmiiNYW+/5RKbEJ8XJyjhgFE0mMNWQ6MBSBe4JIXo63fHTQldZkVr8w== X-Received: by 2002:a5d:4a4f:: with SMTP id v15mr12954340wrs.154.1621410211567; Wed, 19 May 2021 00:43:31 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id h13sm21189986wml.26.2021.05.19.00.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 00:43:31 -0700 (PDT) From: Daniel Vetter To: DRI Development , Intel Graphics Development Cc: Jason Ekstrand , Jason Ekstrand , Marcin Slusarz , stable@vger.kernel.org, Jon Bloomfield , Daniel Vetter Subject: [PATCH 2/2] Revert "drm/i915: Propagate errors on awaiting already signaled fences" Date: Wed, 19 May 2021 09:43:23 +0200 Message-Id: <20210519074323.665872-2-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210519074323.665872-1-daniel.vetter@ffwll.ch> References: <20210519074323.665872-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jason Ekstrand This reverts commit 9e31c1fe45d555a948ff66f1f0e3fe1f83ca63f7. Ever since that commit, we've been having issues where a hang in one client can propagate to another. In particular, a hang in an app can propagate to the X server which causes the whole desktop to lock up. Signed-off-by: Jason Ekstrand Reported-by: Marcin Slusarz Cc: # v5.6+ Cc: Jason Ekstrand Cc: Marcin Slusarz Cc: Jon Bloomfield Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3080 Fixes: 9e31c1fe45d5 ("drm/i915: Propagate errors on awaiting already signaled fences") Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_request.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c index 970d8f4986bb..b796197c0772 100644 --- a/drivers/gpu/drm/i915/i915_request.c +++ b/drivers/gpu/drm/i915/i915_request.c @@ -1426,10 +1426,8 @@ i915_request_await_execution(struct i915_request *rq, do { fence = *child++; - if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) { - i915_sw_fence_set_error_once(&rq->submit, fence->error); + if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) continue; - } if (fence->context == rq->fence.context) continue; @@ -1527,10 +1525,8 @@ i915_request_await_dma_fence(struct i915_request *rq, struct dma_fence *fence) do { fence = *child++; - if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) { - i915_sw_fence_set_error_once(&rq->submit, fence->error); + if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) continue; - } /* * Requests on the same timeline are explicitly ordered, along