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: Sun, 23 Oct 2011 12:18:30 +0200 Message-ID: <20111023101830.GE2953@phenom.ffwll.local> References: <1317203844-2930-1-git-send-email-daniel.vetter@ffwll.ch> <1317203844-2930-2-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ww0-f43.google.com (mail-ww0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id BEADC9E78B for ; Sun, 23 Oct 2011 03:17:40 -0700 (PDT) Received: by wwf10 with SMTP id 10so6180399wwf.12 for ; Sun, 23 Oct 2011 03:17:40 -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: Chris Wilson Cc: Daniel Vetter , intel-gfx , stable@kernel.org List-Id: intel-gfx@lists.freedesktop.org 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. Do you want me to implement Chris' beautification suggestion? The code as-is is copied over from the pagecache prefault helper. Otherwise please consider merging for 3.2. Yours, Daniel On Wed, Sep 28, 2011 at 12:24:04PM +0100, Chris Wilson wrote: > > + if (ret == 0) { > > + if (((unsigned long)uaddr & PAGE_MASK) != > > + ((unsigned long)end & PAGE_MASK)) > This is a little ugly. Perhaps, > > #define page_align(addr) ((unsigned long)addr & PAGE_MASK) > if (page_align(uaddr) != page_align(end)) > > Otherwise, both are > Reviewed-by: Chris Wilson > -Chris > > -- > Chris Wilson, Intel Open Source Technology Centre -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48