From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] mm: extend prefault helpers to fault in more than PAGE_SIZE Date: Thu, 16 Feb 2012 16:14:25 +0100 Message-ID: <20120216151425.GB19158@phenom.ffwll.local> 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-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org To: Hillf Danton Cc: Daniel Vetter , Andrew Morton , Intel Graphics Development , DRI Development , LKML , Linux MM List-Id: intel-gfx@lists.freedesktop.org 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) > > =A0 =A0 =A0 =A0 * Writing zeroes into userspace here is OK, because w= e know that if > > =A0 =A0 =A0 =A0 * the zero gets there, we'll be overwriting it. > > =A0 =A0 =A0 =A0 */ > > - =A0 =A0 =A0 ret =3D __put_user(0, uaddr); > > + =A0 =A0 =A0 while (uaddr <=3D end) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D __put_user(0, uaddr); > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ret !=3D 0) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return ret; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 uaddr +=3D PAGE_SIZE; > > + =A0 =A0 =A0 } >=20 > What if > uaddr & ~PAGE_MASK =3D=3D PAGE_SIZE -3 && > end & ~PAGE_MASK =3D=3D 2 I don't quite follow - can you elaborate upon which issue you're seeing? -Daniel --=20 Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter= .ca/ Don't email: email@kvack.org