* Re: [PATCH] mm: extend prefault helpers to fault in more than PAGE_SIZE
[not found] ` <1330629779-1449-1-git-send-email-daniel.vetter@ffwll.ch>
@ 2012-04-13 19:12 ` Geert Uytterhoeven
0 siblings, 0 replies; only message in thread
From: Geert Uytterhoeven @ 2012-04-13 19:12 UTC (permalink / raw)
To: Daniel Vetter
Cc: Andrew Morton, Intel Graphics Development, DRI Development, LKML,
Linux MM, Linux-Next
On Thu, Mar 1, 2012 at 20:22, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> +/* Multipage variants of the above prefault helpers, useful if more than
> + * PAGE_SIZE of date needs to be prefaulted. These are separate from the above
> + * functions (which only handle up to PAGE_SIZE) to avoid clobbering the
> + * filemap.c hotpaths. */
> +static inline int fault_in_multipages_writeable(char __user *uaddr, int size)
> +{
> + int ret;
> + const char __user *end = uaddr + size - 1;
Please drop the const.
> +
> + if (unlikely(size == 0))
> + return 0;
> +
> + /*
> + * Writing zeroes into userspace here is OK, because we know that if
> + * the zero gets there, we'll be overwriting it.
> + */
> + while (uaddr <= end) {
> + ret = __put_user(0, uaddr);
> + if (ret != 0)
> + return ret;
> + uaddr += PAGE_SIZE;
> + }
> +
> + /* Check whether the range spilled into the next page. */
> + if (((unsigned long)uaddr & PAGE_MASK) ==
> + ((unsigned long)end & PAGE_MASK))
> + ret = __put_user(0, end);
include/linux/pagemap.h:483:3: error: read-only location '*end' used
as 'asm' output
Now in -next:
http://kisskb.ellerman.id.au/kisskb/buildresult/6100650/
http://kisskb.ellerman.id.au/kisskb/buildresult/6100673/
http://kisskb.ellerman.id.au/kisskb/buildresult/6100860/
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-04-13 19:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20120229153216.8c3ae31d.akpm@linux-foundation.org>
[not found] ` <1330629779-1449-1-git-send-email-daniel.vetter@ffwll.ch>
2012-04-13 19:12 ` [PATCH] mm: extend prefault helpers to fault in more than PAGE_SIZE Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).