[Intel-gfx] [PATCH 2/2] drm/i915: properly prefault for pread/pwrite

Daniel Vetter daniel at ffwll.ch
Mon Oct 24 00:11:57 CEST 2011


On Sun, Oct 23, 2011 at 12:23:47PM -0700, Keith Packard wrote:
> On Sun, 23 Oct 2011 12:18:30 +0200, Daniel Vetter <daniel at ffwll.ch> wrote:
> > Hi Keith,
> > 
> > This patch isn't in your -next pull. This papers over a spurious -EFAULT
> > in the pwrite/pread paths that actually gets hit in the wild. The real fix
> > in the form of a almost complete rewrite of the pwrite/pread paths won't
> > be ready for 3.2.
> 
> We had several comments wondering whether writing zeros was OK as this
> occurs before some potential error returns that should leave the buffer
> unmodified. I didn't have a better suggestion, but that seems pretty
> sketchy to me.

This patch only fixes things up so that we prefault the entire page range
and not just the first PAGE_SIZE bytes (i.e. at most 2 pages). So I don't
see the risk of extending the current behaviour to all pages. Userspace
can already see these zero writes, but only when doing something stupid.
-Daniel
-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48



More information about the Intel-gfx mailing list