From: Ben Widawsky Subject: Re: [PATCH 1/1] drm/i915: track first and last processes that touch gem objects Date: Tue, 7 Feb 2012 09:49:45 +0100 Message-ID: <20120207084944.GA5652@seagal.ffwll.local> References: <1328280205-1509-1-git-send-email-eugeni.dodonov@intel.com> <20120206161544.GD4066@phenom.ffwll.local> <87ehu78t6o.fsf@eliezer.anholt.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0134623859==" Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id 0DA909E9E7 for ; Tue, 7 Feb 2012 00:50:53 -0800 (PST) In-Reply-To: <87ehu78t6o.fsf@eliezer.anholt.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Eric Anholt Cc: intel-gfx@lists.freedesktop.org, Eugeni Dodonov List-Id: intel-gfx@lists.freedesktop.org --===============0134623859== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 06, 2012 at 11:59:11PM +0100, Eric Anholt wrote: > On Mon, 6 Feb 2012 17:15:44 +0100, Daniel Vetter wrote: > > On Fri, Feb 03, 2012 at 06:02:38PM +0000, Chris Wilson wrote: > > > On Fri, 3 Feb 2012 12:43:25 -0200, Eugeni Dodonov wrote: > > > > This allows to hopefully find out who was responsible for the GPU d= eath. > > > > We record the 1st and last process to touch each object, to keep tr= ack of > > > > the process which created the object originally and the last proces= s to > > > > touch it. > > > >=20 > > > > To simplify post-mortem analysis, we also search for the processes = names > > > > when gathering the i915_error_state and when peeking at the list of= active > > > > gem objects in debugfs. This is not perfect for tracking all the > > > > processes, as they can quit or die before their batchbuffers got ex= ecuted, > > > > but having to track them during the entire object lifetime would be > > > > excessively memcpy hungry. > > >=20 > > > I think you've slightly missed here. Tracking who created a buffer is > > > interesting and who last used it, but you really need to also track= =20 > > > on whose behalf the request (i.e. each batch) is executing. > > >=20 > > > For the goal of recording creator, you could just use: > > >=20 > > > obj->creator =3D current ? current->pid : 0; > > >=20 > > > in i915_gem_object_init with 0 as the special value for objects creat= ed by > > > the driver outside of process context. And similarly for i915_add_req= uest, > > > though I'd associate those with the owner of the file_priv. The impo= rtant > > > point here is that a buffer may be associated with multiple batches > > > submitted by one or more clients before a hang is detected, and so un= less > > > the dispatch pid is tracked you do not know who submitted the erroneo= us > > > batch. (Even a batch may be submitted more than once by many clients, > > > given sufficient pathology.) So adding the request queue to the > > > i915_error_state would also be interesting, especially with the jiffie > > > and ring->tail. > > >=20 > > > Also note that there is no direct link between i915_gem_fault() and u= sage > > > of the object, the point at which you want to add the obj->last_used_= by > > > tracking to is domain management - which catches the usage of CPU > > > mappings as well as move-to-active. > >=20 > > I'll second Chris here - I think the interesting stuff is to add some k= ind > > of cheap ownership tracking, not who exactly created the buffer. The > > latter is imo only really interesting for resource accounting, and that > > would require it to be somewhat more solid. And we don't do any resource > > accounting atm anyway. >=20 > Having the creator associated with the buffer should be nice. I agree > that for hang debugging, making the pid association part of the request > struct makes more sense than tracking it per-object. With those two, I > don't see much use for "last pwriter/executer" with the buffer. Could I recommend storing drm_file instead of the PID. That is what I have, and required for forced-throttling. You should be able to get to a pid from the file descriptor. --jI8keyz6grp/JLjh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJPMOWoAAoJEL9nTIiJEj0pHU0IAKclT10yyZ9ez/ahLUo6DK3n tj+00BJEe3KSwdbE8raG8T28gyACwvhsEEg/BH94Co+XU9wJ9gVnNKNMAyTynrWq y8o1KSJ1QhmYZMcwys+Teo4iq4JV9sbU327x6Dp8Ss6xDj2ATN1ZuZ/QhMm/cMji ozmIfwzrGn6rn3QzCHrurba2Hktz1PZVcVhhcovh27jzfrz7Gz00rL+3q77upg1d uN6ATJtVEnXA5ABHGkc711+Gxn7yh5dij74joNIemo2oDhMqRSrRtD5P50oaaecT 78l9IuJIS/7Gp7dw6Pi7AbRwYa1RyVupr27vk4ihdeoHB3jl0uTyB4T01rCqju4= =cxld -----END PGP SIGNATURE----- --jI8keyz6grp/JLjh-- --===============0134623859== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0134623859==--