xen-devel
[Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc ar
To: |
Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> |
Subject: |
[Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas |
From: |
Jeremy Fitzhardinge <jeremy@xxxxxxxx> |
Date: |
Thu, 15 Feb 2007 23:30:57 -0800 |
Cc: |
Zachary Amsden <zach@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Pratt <ian.pratt@xxxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Jan Beulich <JBeulich@xxxxxxxxxx>, Chris Wright <chrisw@xxxxxxxxxxxx>, Andi Kleen <ak@xxxxxx>, Christian Limpach <Christian.Limpach@xxxxxxxxxxxx> |
Delivery-date: |
Thu, 15 Feb 2007 23:30:12 -0800 |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxx |
In-reply-to: |
<20070215232447.5ee67f50.akpm@xxxxxxxxxxxxxxxxxxxx> |
List-help: |
<mailto:xen-devel-request@lists.xensource.com?subject=help> |
List-id: |
Xen developer discussion <xen-devel.lists.xensource.com> |
List-post: |
<mailto:xen-devel@lists.xensource.com> |
List-subscribe: |
<http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> |
List-unsubscribe: |
<http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> |
References: |
<20070216022449.739760547@xxxxxxxx> <20070216022531.417300365@xxxxxxxx> <20070215224322.5c73d8e9.akpm@xxxxxxxxxxxxxxxxxxxx> <45D55852.9000103@xxxxxxxx> <20070215232447.5ee67f50.akpm@xxxxxxxxxxxxxxxxxxxx> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
User-agent: |
Thunderbird 1.5.0.9 (X11/20070212) |
Andrew Morton wrote:
> On Thu, 15 Feb 2007 23:08:02 -0800 Jeremy Fitzhardinge <jeremy@xxxxxxxx>
> 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.
>
It's for populating the pagetable in a vmalloc area. There's magic in
the fault handler to synchronize the vmalloc mappings between different
process's kernel mappings, so if the mapping isn't currently present, it
will fault and create the appropriate mapping. It's not operating on
swappable user memory, so swapping isn't an issue; but if the fault
handler exits immediately with preempt disabled, then there's a problem.
(Even though we don't support preempt, I've been generally coding in a
preempt-safe way, just so that the code looks "normal". And maybe we
will support preempt at some point.)
J
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] Re: [patch 04/21] Xen-paravirt: ===================================================================, (continued)
[Xen-devel] [patch 02/21] Xen-paravirt: ignore vgacon if hardware not present, Jeremy Fitzhardinge
[Xen-devel] [patch 03/21] Xen-paravirt: Add pagetable accessors to pack and unpack pagetable entries, Jeremy Fitzhardinge
[Xen-devel] [patch 01/21] Xen-paravirt: Fix typo in sync_constant_test_bit()s name., Jeremy Fitzhardinge
[Xen-devel] [patch 09/21] Xen-paravirt: Allow paravirt backend to select PGD allocation alignment, Jeremy Fitzhardinge
[Xen-devel] [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas, Jeremy Fitzhardinge
[Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas, Jeremy Fitzhardinge
Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas, Keir Fraser
Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas, Keir Fraser
Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas, Jeremy Fitzhardinge
Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas, Keir Fraser
Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas, Keir Fraser
Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas, Jeremy Fitzhardinge
|
|
|