lkml.org 
[lkml]   [2007]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateThu, 15 Feb 2007 23:24:47 -0800
FromAndrew Morton <>
SubjectRe: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas
On Thu, 15 Feb 2007 23:08:02 -0800 Jeremy Fitzhardinge <jeremy@goop.org> wrote:

> Andrew Morton wrote:
> > This won't work when CONFIG_PREEMPT=y. The pagefault handler will see
> > in_atomic() and will scram.
> >
>
> Is there some other way to get the pagetable populated for the address
> range?
>

If you really need to run atomically, that gets ugly. Even of one were to
run handle_mm_fault() by hand, it still needs to allocate memory.

Two ugly options might be:

a) touch all the pages, then go atomic, then touch them all again. If
one of them faults (ie: you raced with swapout) then go back and try
again. Obviously susceptible to livelocking.

b) Do get_user_pages() against all the pages, then go atomic, then do
put_page() against them all. Of course, they can immediately get
swapped out.

But that function's already racy against swapout and I guess it works OK.
I don't have clue what it is actually trying to do, so I'm guessing madly
here.
-
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/

\
 
 \ /
  Last update: 2007-02-16 08:29    [from the cache]
©2003-2010