From patchwork Thu Apr 6 23:23:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Arcangeli X-Patchwork-Id: 9668611 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 92EAB601EB for ; Thu, 6 Apr 2017 23:29:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACC5028595 for ; Thu, 6 Apr 2017 23:29:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A02BB285EC; Thu, 6 Apr 2017 23:29:20 +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.2 required=2.0 tests=BAYES_00, 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 69BBC28595 for ; Thu, 6 Apr 2017 23:29:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C3F606EA60; Thu, 6 Apr 2017 23:27:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id BADBC6E1D7; Thu, 6 Apr 2017 23:23:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A00E351EE7; Thu, 6 Apr 2017 23:23:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A00E351EE7 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=aarcange@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A00E351EE7 Received: from mail.random (ovpn-116-18.ams2.redhat.com [10.36.116.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B8C172D653; Thu, 6 Apr 2017 23:23:48 +0000 (UTC) From: Andrea Arcangeli To: Martin Kepplinger , Thorsten Leemhuis , daniel.vetter@intel.com, Dave Airlie , Chris Wilson Subject: [PATCH 0/5] Re: [Intel-gfx] [BUG][REGRESSION] i915 gpu hangs under load Date: Fri, 7 Apr 2017 01:23:42 +0200 Message-Id: <20170406232347.988-1-aarcange@redhat.com> In-Reply-To: <87pogtplxr.fsf@intel.com> References: <87pogtplxr.fsf@intel.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 06 Apr 2017 23:23:50 +0000 (UTC) X-Mailman-Approved-At: Thu, 06 Apr 2017 23:26:54 +0000 Cc: intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org 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 I'm also getting kernel hangs every couple of days. For me it's still not fixed here in 4.11-rc5. It's hard to reproduce, the best reproducer is to build lineageos 14.1 on host while running LTP in a guest to stress the guest VM. Initially I thought it was related to the fact I upgraded the xf86 intel driver just a few weeks ago (I deferred any upgrade of the userland intel driver since last July because of a regression that never got fixed and broke xterm for me). After I found a workaround for the userland regression (appended at the end for reference) I started getting kernel hangs but they are separate issues as far as I can tell. It's not well tested so beware... (it survived a couple of builds and some VM reclaim but that's it). The first patch 1/5 is the potential fix for the i915 kernel hang. The rest are incremental improvements. And I've no great solution for when the shrinker was invoked with the struct_mutex held and and recurse on the lock. I don't think we can possibly wait in such case (other than flush work that the second patch does) but then practically it shouldn't be a big deal, the big RAM eater is unlikely to be i915 when the system is low on memory. Andrea Arcangeli (5): i915: avoid kernel hang caused by synchronize rcu struct_mutex deadlock i915: flush gem obj freeing workqueues to add accuracy to the i915 shrinker i915: initialize the free_list of the fencing atomic_helper i915: schedule while freeing the lists of gem objects i915: fence workqueue optimization drivers/gpu/drm/i915/i915_gem.c | 15 +++++++++++++++ drivers/gpu/drm/i915/i915_gem_shrinker.c | 15 +++++++++++---- drivers/gpu/drm/i915/intel_display.c | 7 ++++--- 3 files changed, 30 insertions(+), 7 deletions(-) === Userland workaround for unusable xterm after commit 3d3d18f086cdda72ee18a454db70ca72c6e3246c (unrelated to this kernel issue, just for reference of what I'm running in userland). diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 11beb90..d349203 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -17430,11 +17430,15 @@ sna_flush_callback(CallbackListPtr *list, pointer user_data, pointer call_data) { struct sna *sna = user_data; +#if 0 if (!sna->needs_dri_flush) return; +#endif sna_accel_flush(sna); +#if 0 sna->needs_dri_flush = false; +#endif } static void