From owner-freebsd-x11@FreeBSD.ORG Thu Sep 8 23:38:49 2011 Return-Path: Delivered-To: freebsd-x11@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D65191065670 for ; Thu, 8 Sep 2011 23:38:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 77A818FC12 for ; Thu, 8 Sep 2011 23:38:48 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p88Nci97005898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 Sep 2011 02:38:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p88NciDD015724; Fri, 9 Sep 2011 02:38:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p88NciTI015723; Fri, 9 Sep 2011 02:38:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 9 Sep 2011 02:38:44 +0300 From: Kostik Belousov To: Andrey Kosachenko Message-ID: <20110908233844.GT17489@deviant.kiev.zoral.com.ua> References: <4E543828.2040703@gmail.com> <20110824081303.GG17489@deviant.kiev.zoral.com.ua> <4E61DF8F.1090206@gmail.com> <20110903082645.GR17489@deviant.kiev.zoral.com.ua> <20110903104701.GY17489@deviant.kiev.zoral.com.ua> <4E63983C.6000702@gmail.com> <20110904154615.GH17489@deviant.kiev.zoral.com.ua> <4E63B680.2060504@gmail.com> <20110904174333.GL17489@deviant.kiev.zoral.com.ua> <4E690971.8080208@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BmVtdJMX1rCPvWQQ" Content-Disposition: inline In-Reply-To: <4E690971.8080208@gmail.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-x11@freebsd.org Subject: Re: xorg-dev + intel driver + KMS X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Sep 2011 23:38:50 -0000 --BmVtdJMX1rCPvWQQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 08, 2011 at 09:29:05PM +0300, Andrey Kosachenko wrote: > Hi, Konstantin, >=20 > On 04.09.2011 20:43, Kostik Belousov wrote: > >On Sun, Sep 04, 2011 at 08:33:52PM +0300, Andrey Kosachenko wrote: > >>On 04.09.2011 18:46, Kostik Belousov wrote: > >>>Show me the output of procstat -kk and ps axlww. > >> > >>I believe you are interested in those listing in the context of the > >>hanged Xorg, right?. If so, then I've to wait for the next issue > >>occurrence and will provide outputs then. > >Right. >=20 > here you go: > http://pastebin.com/7mH62WBn >=20 > PS: > - unfortunately this was checked against all.8.3.patch (haven't had time= =20 > to employ all.9.0.patch); > - if you need ktrdump, please, let me know I'll send it to you. If you are not interested in the story, just try 9.1 patch. If you are, please stay with me. Apparently, your pagedaemon is sleeping in 915unm state, that made me very much worrying. I did not understand how this could happen, because I thought that this is caused by pagedaemon dropping the last reference on the gem object device pager. And pagedaemon must not see pages belonging to device pagers, the pages must not appear on any queue. I added assertions to make sure to get the panic if a fictitious page is found on queues, which did not fired. But, I was able to reproduce the situation with pagedaemon hang, by running gem_stress and performing active swapping in parallel. I forgot that I finally implemented the low memory handler for gem, which is called from pagedaemon and which also does purging on the gem buffers. After that, it was relatively easy to track the issue. See the comment at the beginning of i915_gem_pager_fault() about interaction with i915_gem_release_mmap() which describes the cause of the hang: /* * Remove the placeholder page inserted by vm_fault() from the * object before dropping the object lock. If * i915_gem_release_mmap() is active in parallel on this gem * object, then it owns the drm device sx and might find the * placeholder already. Then, since the page is busy, * i915_gem_release_mmap() sleeps waiting for the busy state * of the page cleared. We will be not able to acquire drm * device lock until i915_gem_release_mmap() is able to make a * progress. */ For me, the patched driver survived while doing 'sort /dev/zero' and gem_stress in parallel. --BmVtdJMX1rCPvWQQ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk5pUgQACgkQC3+MBN1Mb4jPzQCgwe12brR75peMeQzL6YfjfZYS fJwAoMV9HZsTQmrjFY70J5JqezYFa7Np =qVC6 -----END PGP SIGNATURE----- --BmVtdJMX1rCPvWQQ--