Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753808Ab2BPPOR (ORCPT ); Thu, 16 Feb 2012 10:14:17 -0500 Received: from mail-bk0-f46.google.com ([209.85.214.46]:36865 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752739Ab2BPPOM (ORCPT ); Thu, 16 Feb 2012 10:14:12 -0500 Date: Thu, 16 Feb 2012 16:14:25 +0100 From: Daniel Vetter To: Hillf Danton Cc: Daniel Vetter , Andrew Morton , Intel Graphics Development , DRI Development , LKML , Linux MM Subject: Re: [PATCH] mm: extend prefault helpers to fault in more than PAGE_SIZE Message-ID: <20120216151425.GB19158@phenom.ffwll.local> Mail-Followup-To: Hillf Danton , Andrew Morton , Intel Graphics Development , DRI Development , LKML , Linux MM References: <1329393696-4802-1-git-send-email-daniel.vetter@ffwll.ch> <1329393696-4802-2-git-send-email-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: Linux phenom 3.2.0-1-amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1149 Lines: 29 On Thu, Feb 16, 2012 at 09:32:08PM +0800, Hillf Danton wrote: > On Thu, Feb 16, 2012 at 8:01 PM, Daniel Vetter wrote: > > @@ -416,17 +417,20 @@ static inline int fault_in_pages_writeable(char __user *uaddr, int size) > > ? ? ? ? * Writing zeroes into userspace here is OK, because we know that if > > ? ? ? ? * the zero gets there, we'll be overwriting it. > > ? ? ? ? */ > > - ? ? ? ret = __put_user(0, uaddr); > > + ? ? ? while (uaddr <= end) { > > + ? ? ? ? ? ? ? ret = __put_user(0, uaddr); > > + ? ? ? ? ? ? ? if (ret != 0) > > + ? ? ? ? ? ? ? ? ? ? ? return ret; > > + ? ? ? ? ? ? ? uaddr += PAGE_SIZE; > > + ? ? ? } > > What if > uaddr & ~PAGE_MASK == PAGE_SIZE -3 && > end & ~PAGE_MASK == 2 I don't quite follow - can you elaborate upon which issue you're seeing? -Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/