From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 2/2] drm/i915: properly prefault for pread/pwrite Date: Mon, 24 Oct 2011 00:11:57 +0200 Message-ID: <20111023221157.GH2953@phenom.ffwll.local> References: <1317203844-2930-1-git-send-email-daniel.vetter@ffwll.ch> <1317203844-2930-2-git-send-email-daniel.vetter@ffwll.ch> <20111023101830.GE2953@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wy0-f177.google.com (mail-wy0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 445DE9E7BF for ; Sun, 23 Oct 2011 15:11:08 -0700 (PDT) Received: by wyg8 with SMTP id 8so6919576wyg.36 for ; Sun, 23 Oct 2011 15:11:07 -0700 (PDT) Content-Disposition: inline In-Reply-To: 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: Keith Packard Cc: Daniel Vetter , intel-gfx , stable@kernel.org List-Id: intel-gfx@lists.freedesktop.org On Sun, Oct 23, 2011 at 12:23:47PM -0700, Keith Packard wrote: > On Sun, 23 Oct 2011 12:18:30 +0200, Daniel Vetter 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@ffwll.ch Mobile: +41 (0)79 365 57 48