From patchwork Fri Nov 17 15:14:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 166215 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp599720vqn; Fri, 17 Nov 2023 07:14:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKyUWbNiV2R6m3NJli66NpgL9PLz3J1YYPmiKZj/VL05urmJ+NksRqaS5rhmWmzMk0FRoK X-Received: by 2002:a4a:7658:0:b0:57b:86f5:701c with SMTP id w24-20020a4a7658000000b0057b86f5701cmr21549881ooe.4.1700234075582; Fri, 17 Nov 2023 07:14:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700234075; cv=none; d=google.com; s=arc-20160816; b=jw66XQ1OVQxuJNv+KHKhKhRf9JfggUZ+QooHnUQhH/rq+fwY1qvTy6kAccXwUvkInA MtpiqtLQXaAzXOZ6mkgF3psfv7XsVHuVWWdCwrQA5Z/YkfLyaJjUgl4Zyoqrnbs5sBVz oMG1bD22WdGxxxVT9oyrM0AWB6Gh8nipk2vl3oLZ3fvzNoDhZ3nzG7yBz59/e7z5929h 09YWzwmbpFvLGeeThIKVOgBBcxRWLh0VSRl6ACHpIV52qpVQocZarqP5Z76LQgD9NckF THYOO6061ggfsxKvoa6gs1aiz2PjYslU4q3tC3pJ6L5IRPGa5PLykNDD9zvydLt1TpEk /IyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=neKamCZO2wHDVbcksPS6RZHdFnPapK4yzUpgs5f2M5Y=; fh=D+EPs4f1tbcirM+xOcOZ25ESgeHsz4zHs+gyKhf0s0I=; b=s4pLAJqO3isifmetp+aHr/UcTZ73iTiKSGQpxY6iSoyMsszXbN9j/rrslDvULqp5gf 3jG8LYDYVcznWsfBTnuxVwGD9dgNpeKgjvfEmBvOaMcsiymqBO09na3c5YFceYrOacHW lcGFEtvcdo/wyUdMbP/F9bxkuuJAbGS9WAQZ66/iYEUW9D/clDMyMz8jSLameknuSiPp LfLcqqNgtJgXlYBGILDBrBfQ5b9WoEOITC07YJzgHQlTNHjE4w4o5ATF1rJ2jNYVvQmb urbR/ahOoOozIzz7Jb7OUUQqKIXSV9Nqb+Lv7uM4qKuJyNQzB86b7Zsi8JLE/oKVdwL2 9iJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TqwlhRIu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id u21-20020a4a6155000000b0058a02e959a6si683730ooe.12.2023.11.17.07.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 07:14:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TqwlhRIu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id BC4328273314; Fri, 17 Nov 2023 07:14:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231470AbjKQPO3 (ORCPT + 30 others); Fri, 17 Nov 2023 10:14:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjKQPO2 (ORCPT ); Fri, 17 Nov 2023 10:14:28 -0500 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B20CED56; Fri, 17 Nov 2023 07:14:25 -0800 (PST) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6c4eaa5202aso2089633b3a.1; Fri, 17 Nov 2023 07:14:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700234065; x=1700838865; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=neKamCZO2wHDVbcksPS6RZHdFnPapK4yzUpgs5f2M5Y=; b=TqwlhRIu/qlRj1E2yMaU2KztJPTJAzUDVU6qbaujEogaWRUIqjKOfUbZfCNq894odJ IrkkPXnzxW1Hny3uCQXD2qniXz2BGnd6vNudC5PH86gpBb43M9Ad+JBFWDzAfEBdae87 4gXLHl3EVIw6mb8HYIBsckvnDc9xWDngTeuaTAb5k8Gt5ew68RhuSMB4UeKXR+aJo6gC vePc338mvZssNi3B/Gw95ASvZTqEI/iWvpfMt/ufamFWZZdoRXWen2pNFxjt5vzturt9 +H/706WOFcBj8FdWVKvHWKQCjM87Atfub92tpRbGoFuM2JUgfkMZJ1xH2yRYqX9Jpef4 5ZIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700234065; x=1700838865; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=neKamCZO2wHDVbcksPS6RZHdFnPapK4yzUpgs5f2M5Y=; b=fKSJthGixcujM2Y7N/J/cN8jmA0oWtwRmhTjyW/OYm3HYov3kTYkgVbdWRl1Q5Q9Nm daAnpsZ6NwnvuPryjRvoswRqJRWhntavmEusn1ABjYYL9NVagAsJi9TVEiXxQOzfNJWz ROKiv35JY+vqirr8+BSGi9lMMFDl3O4PPIy65s5a5fMqLpwaqU4yQKVjtsO8DHu7H5tv qKt6LfcPHv2d9OvxcuamUf+bEvF32L4dGErB4PhXj03p6prxGqYjl525il4W0LgYm8ej 8us5FOe+jUNxpMMuZnnScw3YytVzYzm5AaP6ZgnYkTPuzctDJR/OCuZp6pQhWfoF6eFy OnwQ== X-Gm-Message-State: AOJu0YykajZqmG/RhYnViMNCAiME7LOBoeIPNFyB7jXILelse3v8UvyV laX55ULhTdEqonHJTIRrKfo= X-Received: by 2002:a17:902:d4cb:b0:1cc:5a74:b1df with SMTP id o11-20020a170902d4cb00b001cc5a74b1dfmr13978668plg.2.1700234064990; Fri, 17 Nov 2023 07:14:24 -0800 (PST) Received: from localhost ([2a00:79e1:2e00:1301:e1c5:6354:b45d:8ffc]) by smtp.gmail.com with ESMTPSA id m18-20020a170902db1200b001c8a0879805sm1474315plx.206.2023.11.17.07.14.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 07:14:24 -0800 (PST) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Rob Clark , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] drm/msm: Reduce fallout of fence signaling vs reclaim hangs Date: Fri, 17 Nov 2023 07:14:19 -0800 Message-ID: <20231117151420.351995-1-robdclark@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 17 Nov 2023 07:14:31 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782824645928060146 X-GMAIL-MSGID: 1782824645928060146 From: Rob Clark Until various PM devfreq/QoS and interconnect patches land, we could potentially trigger reclaim from gpu scheduler thread, and under enough memory pressure that could trigger a sort of deadlock. Eventually the wait will timeout and we'll move on to consider other GEM objects. But given that there is still a potential for deadlock/stalling, we should reduce the timeout to contain the damage. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_gem_shrinker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_gem_shrinker.c b/drivers/gpu/drm/msm/msm_gem_shrinker.c index 5a7d48c02c4b..07ca4ddfe4e3 100644 --- a/drivers/gpu/drm/msm/msm_gem_shrinker.c +++ b/drivers/gpu/drm/msm/msm_gem_shrinker.c @@ -75,7 +75,7 @@ static bool wait_for_idle(struct drm_gem_object *obj) { enum dma_resv_usage usage = dma_resv_usage_rw(true); - return dma_resv_wait_timeout(obj->resv, usage, false, 1000) > 0; + return dma_resv_wait_timeout(obj->resv, usage, false, 10) > 0; } static bool