From owner-svn-src-head@freebsd.org Wed Oct 21 22:09:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 149E8A1BBCA; Wed, 21 Oct 2015 22:09:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7C8B1527; Wed, 21 Oct 2015 22:09:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 43641B98F; Wed, 21 Oct 2015 18:09:40 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r289719 - head/sys/dev/drm2/i915 Date: Wed, 21 Oct 2015 14:13:05 -0700 Message-ID: <1544184.b1AHehjrnL@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-PRERELEASE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201510212049.t9LKnkkj002445@repo.freebsd.org> References: <201510212049.t9LKnkkj002445@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 21 Oct 2015 18:09:40 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2015 22:09:42 -0000 On Wednesday, October 21, 2015 08:49:46 PM John Baldwin wrote: > Author: jhb > Date: Wed Oct 21 20:49:45 2015 > New Revision: 289719 > URL: https://svnweb.freebsd.org/changeset/base/289719 > > Log: > i915_gem_do_execbuffer() holds the pages backing each relocation region for > various reasons while executing user commands. After these commands are > completed, the pages backing the relocation regions are unheld. > > Since relocation regions do not have to be page aligned, the code in > validate_exec_list() allocates 2 extra page pointers in the array of > held pages populated by vm_fault_quick_hold_pages(). However, the cleanup > code that unheld the pages always assumed that only the buffer size / > PAGE_SIZE pages were used. This meant that non-page aligned buffers would > not unheld the last 1 or 2 pages in the list. Fix this by saving the > number of held pages returned by vm_fault_quick_hold_pages() for each > relocation region and using this count during cleanup. > > Reviewed by: dumbbell, kib > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D3965 I have been getting panics on my x220 due to vm_page_unhold() finding a reference count on a page of 0 every 2-3 days for the past month or so. When I examined the dumps I would find other pages backing the relocation regions that had insanely high hold counts (like 30 to 60 thousand). Given that hold_count is a unsigned short I figured it was overflowing. The first attempt to fix this was the changes in r288452. However, even with that in place I was still seeing the same panics. I've only run this for a day, but it "looks" correct. If you have been getting vm_page_unhold panics with i915kms loaded this is worth trying. I'm not sure why my x220 was so prone to this when other people have been able to run X with i915kms without any problems. I do have CPUTYPE set to enable AVX, but I don't know that that would suddenly make lots of buffers non-page aligned that would be page-aligned otherwise. -- John Baldwin