[Intel-gfx] [PATCH] drm/i915: avoid big kmallocs on reading error state
Daniel Vetter
daniel at ffwll.ch
Wed May 22 17:31:33 CEST 2013
On Wed, May 22, 2013 at 02:58:46PM +0100, Chris Wilson wrote:
> On Wed, May 22, 2013 at 04:42:53PM +0300, Mika Kuoppala wrote:
> > Sometimes when user is trying to get error state out from
> > debugfs after gpu hang, the memory is low and/or fragmented
> > enough that kmalloc in seq_file will fail.
> >
> > Prevent big kmalloc by avoiding seq_file and instead convert
> > error state to string in smaller chunks.
> >
> > v2: better alloc flags, better truncate, correct
> > locking, and error handling improvements (Chris Wilson)
> >
> > Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
>
> I am reasonably happy with this. Every attempt to see how we might
> shoe-horn iterating over the error state with seq_file has so far been
> overly complicated, and the only benefit it may bring is the focus on
> iterating at a higher level than characters.
>
> Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
Yeah, looks neat. One nitpick: Can you please add the gcc printf
annotations (like printk) so that gcc properly complains if we get format
specifiers wrong?
Thanks, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
More information about the Intel-gfx
mailing list