[PATCH 0/6] Page faults to help user space debug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 28 June 2013 15:39, Chris Wilson <chris at chris-wilson.co.uk> wrote:

> On Fri, Jun 28, 2013 at 03:23:31PM -0700, Ben Widawsky wrote:
> > This series originated from the request from Paul, "can you enable page
> > faults"?  After some though and discussion, we came up with 3 debug
> features to
> > implement:
>
> The issue lies in that the CS and EU units like to prefetch 128 bytes
> and will cross page boundaries. Userspace is rather lax in providing the
> extra page (or preventing the read past the end of its bo) and so
> without adding a sentinel page behind every bo you quickly generate
> false positives. (Unless you also run a fixed userspace).
>
> If you are prepared to fix userspace, tweaking the kernel not to install
> scratch pages everywhere is trivial.
>

Mesa already adds the necessary padding to EU programs to ensure that
prefetch won't cause a page fault, and because of its "stack and heap"
model for batch buffers, CS prefetching shouldn't cause a page fault
either.  I don't know whether the 2D drivers do something similar, so they
might potentially need fixing.

Having tracked down a number of painful Mesa bugs over the last two years
where we supplied the GPU with an incorrect pointer, or we sized a buffer
incorrectly causing other buffers to be corrupted, I am fairly certain that
being able to turn off scratch pages will be a benefit in debugging--these
debug options should turn confusing, sporadic failures (and failures that
don't get noticed for months) into easily reproducible failures that get
noticed quickly.  So these debug flags will definitely be useful in
development.

If the 2D driver is lax about providing the necessary padding for prefetch,
then that will make things more difficult, but the debug flags should still
be useful.  It just means that when using the debug flags, I'll have to run
my piglit tests under gbm.

I'll try to give the patches a shot soon to make sure they work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20130702/08aae993/attachment-0001.html>


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux