From patchwork Wed Mar 29 09:10:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9651053 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C7A89602C8 for ; Wed, 29 Mar 2017 09:10:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B328A28447 for ; Wed, 29 Mar 2017 09:10:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A77FF2845B; Wed, 29 Mar 2017 09:10:59 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham 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 5030228447 for ; Wed, 29 Mar 2017 09:10:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A9E626E703; Wed, 29 Mar 2017 09:10:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 62F206E703; Wed, 29 Mar 2017 09:10:57 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id p52so1197338wrc.2; Wed, 29 Mar 2017 02:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=qCoiP6GFxgSym5sZrFQ2EyxnQvjRPE6oicW+va5bLOI=; b=f12DfWYuKB6LpNj58yWPJTTQVOr5LY7dAKHDkZrpulFNlY9sstkokaWZVNcAwt7+Zz cIA1Gty1AMzAB9FGYMvEqQxS4LlqxhCRgAS1IYQFxCafgiEPUsiHTqR+8SEc3vwzS5Gc 33JiJRMJoxernt6K/oMK54IrzRuC+pzHtjenlarw/h/XSzdcOxn9iw9UzyrI0efC5sUq yHyTNXH5MABjoImiGwhdmnN1TJDf3BNXqrN2DcIWNjeYGqDFL3MSbceNy+mMgfZqJ12j FfcbHxYXYcarNIrao/8W+MAUjFQgSPhsewozt2GsfX7qkMB4E5LmIUV4jL+R4JC9JbPT Y9zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=qCoiP6GFxgSym5sZrFQ2EyxnQvjRPE6oicW+va5bLOI=; b=ikQDNDggzDsgm4Myi2mPhrZELA/gjRUtXiq0QEyC6Em8Xc4jgA1tIcBFfgzhhvzql8 92/Z+nr3sns7xVkiuAB7K1iLtB3CSSiYMDLTIbp3ZDpYa5eY9OM9FbcrUSdmFW6YDOFF YSXKEpbjj3UPVsdy7x8Bb7jkECHa+ELMW2rKX3uR8NmZ2x1OT/G3ozKc69OKxPaVvQyI 3kLtv5I1UTXOG+KyMnptA+zdMEskHuY34FJeAr+sw+7x16m0tfvczE177iWat3YlIz4Z 69YV5W9/5eBo/jSqtCsvAxP9mk/x3yC9vbLTLaOCXoDKoaAH/lx3EOro2B8ZSCGviLKV qYZQ== X-Gm-Message-State: AFeK/H0TS7/sET2wUkCEIIKscRmUHBHD/0XjxAYRIRk509ajDMzgpkzvzOOyTpSZnR8caQ== X-Received: by 10.223.133.196 with SMTP id 4mr1423293wru.166.1490778656039; Wed, 29 Mar 2017 02:10:56 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id l65sm7228576wmf.27.2017.03.29.02.10.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Mar 2017 02:10:55 -0700 (PDT) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/mm: Split up long running selftests with cond_resched() Date: Wed, 29 Mar 2017 10:10:53 +0100 Message-Id: <20170329091053.13837-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 Cc: intel-gfx@lists.freedesktop.org, Joonas Lahtinen X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Scatter a few cond_resched() in between phases of the drm_mm selftests to try and prevent us incurring the wrath of the NMI watchdog. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/selftests/test-drm_mm.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/selftests/test-drm_mm.c b/drivers/gpu/drm/selftests/test-drm_mm.c index fa356f5dae27..dfdd858eda0a 100644 --- a/drivers/gpu/drm/selftests/test-drm_mm.c +++ b/drivers/gpu/drm/selftests/test-drm_mm.c @@ -514,6 +514,8 @@ static int igt_reserve(void *ignored) ret = __igt_reserve(count, size + 1); if (ret) return ret; + + cond_resched(); } return 0; @@ -712,6 +714,10 @@ static int igt_insert(void *ignored) return ret; ret = __igt_insert(count, size + 1, false); + if (ret) + return ret; + + cond_resched(); } return 0; @@ -741,6 +747,10 @@ static int igt_replace(void *ignored) return ret; ret = __igt_insert(count, size + 1, true); + if (ret) + return ret; + + cond_resched(); } return 0; @@ -1011,6 +1021,8 @@ static int igt_insert_range(void *ignored) ret = __igt_insert_range(count, size, max/4+1, 3*max/4-1); if (ret) return ret; + + cond_resched(); } return 0; @@ -1056,6 +1068,7 @@ static int igt_align(void *ignored) drm_mm_for_each_node_safe(node, next, &mm) drm_mm_remove_node(node); DRM_MM_BUG_ON(!drm_mm_clean(&mm)); + cond_resched(); } ret = 0; @@ -1097,6 +1110,8 @@ static int igt_align_pot(int max) align, bit); goto out; } + + cond_resched(); } ret = 0; @@ -1471,6 +1486,8 @@ static int igt_evict(void *ignored) goto out; } } + + cond_resched(); } ret = 0; @@ -1566,6 +1583,8 @@ static int igt_evict_range(void *ignored) goto out; } } + + cond_resched(); } ret = 0; @@ -1683,6 +1702,7 @@ static int igt_topdown(void *ignored) drm_mm_for_each_node_safe(node, next, &mm) drm_mm_remove_node(node); DRM_MM_BUG_ON(!drm_mm_clean(&mm)); + cond_resched(); } ret = 0; @@ -1783,6 +1803,7 @@ static int igt_bottomup(void *ignored) drm_mm_for_each_node_safe(node, next, &mm) drm_mm_remove_node(node); DRM_MM_BUG_ON(!drm_mm_clean(&mm)); + cond_resched(); } ret = 0; @@ -1970,6 +1991,8 @@ static int igt_color(void *ignored) drm_mm_remove_node(node); kfree(node); } + + cond_resched(); } ret = 0; @@ -2047,6 +2070,7 @@ static int evict_color(struct drm_mm *mm, } } + cond_resched(); return 0; } @@ -2132,6 +2156,8 @@ static int igt_color_evict(void *ignored) goto out; } } + + cond_resched(); } ret = 0; @@ -2231,6 +2257,8 @@ static int igt_color_evict_range(void *ignored) goto out; } } + + cond_resched(); } ret = 0;