From patchwork Fri Jun 17 16:38:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 100830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 8DCD5B6FC5 for ; Sat, 18 Jun 2011 02:38:52 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QXc4C-0007QU-1z; Fri, 17 Jun 2011 16:38:44 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QXc49-0007Pl-MI for kernel-team@lists.ubuntu.com; Fri, 17 Jun 2011 16:38:41 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QXc49-0008E5-Hv for ; Fri, 17 Jun 2011 16:38:41 +0000 Received: from c-69-254-227-224.hsd1.ks.comcast.net ([69.254.227.224] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1QXc48-0007Gc-Q0 for kernel-team@lists.ubuntu.com; Fri, 17 Jun 2011 16:38:41 +0000 Date: Fri, 17 Jun 2011 11:38:38 -0500 From: Seth Forshee To: Ubuntu Kernel Team Subject: [Pull Request][Lucid] Fix Xorg hangs with some i915 chipsets Message-ID: <20110617163838.GB27800@thinkpad-t410> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com This is a rather large series of non-trivial backports to fix a Xorg hang caused by the i915 driver. Patches 5 and 6 are the key patches that implement an LRU-based eviction algorithm; patches 1-4 are prerequisites, patch 7 fixes some of the clean-up, and patch 8 adds a periodic flush to retire active buffers. This is a pretty severe bug for those affected by it, but it's also a huge amount of change for a stable kernel, so let me know if it's beyond hope for an SRU. SRU Justification: Impact: When the GPU aperture becomes sufficiently fragmented two or more mmapped buffers in active use can repeatedly push each other out of the aperture. This results in a sort of livelock situation, with Xorg appearing to be hung with high CPU utilization. Fix: Backport of a series of patches that convert the i915 eviction algorithm from a best-fit approach to one based on evicting the least recently used objects and a patch that adds a periodic flush requests to retire active buffers when no client is active. Testcase: Without these patches this scenario can be triggered ocassionally when visiting certain web pages that utilize Flash or viewing certain images in Firefox, as described on bugs #599017 and #330460. Testing the same pages/images with these patches does not induce the hang. The following changes since commit 9cc333d02cb4620561e91a63ed86a2159ec32638: UBUNTU: Ubuntu-2.6.32-33.67 (2011-06-16 11:26:04 -0500) are available in the git repository at: git://kernel.ubuntu.com/sforshee/ubuntu-lucid.git lp599017 Chris Wilson (5): drm/i915: Move the eviction logic to its own file. drm/i915: Implement fair lru eviction across both rings. (v2) drm/i915: Maintain LRU order of inactive objects upon access by CPU (v2) drm/i915/evict: Ensure we completely cleanup on failure drm/i915: Periodically flush the active lists and requests Daniel Vetter (3): drm_mm: extract check_free_mm_node drm: implement helper functions for scanning lru list drm/i915: prepare for fair lru eviction drivers/gpu/drm/drm_mm.c | 236 +++++++++++++++++++++++++----- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/i915_drv.h | 13 ++ drivers/gpu/drm/i915/i915_gem.c | 228 ++++------------------------- drivers/gpu/drm/i915/i915_gem_evict.c | 253 +++++++++++++++++++++++++++++++++ include/drm/drm_mm.h | 15 ++- 6 files changed, 510 insertions(+), 236 deletions(-) create mode 100644 drivers/gpu/drm/i915/i915_gem_evict.c Acked-by: Tim Gardner