From: Eric Anholt Subject: Re: [PATCH 1/1] drm/i915: track first and last processes that touch gem objects Date: Mon, 06 Feb 2012 23:59:11 +0100 Message-ID: <87ehu78t6o.fsf@eliezer.anholt.net> References: <1328280205-1509-1-git-send-email-eugeni.dodonov@intel.com> <20120206161544.GD4066@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1753882910==" Return-path: In-Reply-To: <20120206161544.GD4066@phenom.ffwll.local> 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: Daniel Vetter , Chris Wilson Cc: intel-gfx@lists.freedesktop.org, Ben Widawsky , Eugeni Dodonov List-Id: intel-gfx@lists.freedesktop.org --===============1753882910== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Transfer-Encoding: quoted-printable 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 dea= th. > > > We record the 1st and last process to touch each object, to keep trac= k of > > > the process which created the object originally and the last process = to > > > touch it. > > >=20 > > > To simplify post-mortem analysis, we also search for the processes na= mes > > > when gathering the i915_error_state and when peeking at the list of a= ctive > > > gem objects in debugfs. This is not perfect for tracking all the > > > processes, as they can quit or die before their batchbuffers got exec= uted, > > > 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 created= by > > the driver outside of process context. And similarly for i915_add_reque= st, > > though I'd associate those with the owner of the file_priv. The import= ant > > 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 unle= ss > > the dispatch pid is tracked you do not know who submitted the erroneous > > 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 usa= ge > > 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 kind > 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. 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. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk8wWz8ACgkQHUdvYGzw6vfcugCeNE0l6b/ylgmNLB6IOH2fStDg lxMAni1WxJknAqdJVx2mns4Iwd8EDuBm =i4bo -----END PGP SIGNATURE----- --=-=-=-- --===============1753882910== 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 --===============1753882910==--