Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-16 Thread Jeremy Fitzhardinge
Keir Fraser wrote: > It has no other users right now and get_vm_area_sync() would be a > better-named and more generically useful function than alloc_vm_area(). I'm thinking "reserve" might be a better term; "get" generally has the suggestion of a refcount. > get_vm_area_sync(), partnered with exi

Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-16 Thread Keir Fraser
On 16/2/07 19:26, "Jeremy Fitzhardinge" <[EMAIL PROTECTED]> wrote: > Keir Fraser wrote: >> Hmmm... Actually looks like a bunch of architectures do lazy sync of the >> vmalloc area, although neither ia64 nor powerpc does so. However, all >> current users of the alloc_vm_area() function would be oka

Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-16 Thread Jeremy Fitzhardinge
Keir Fraser wrote: > Hmmm... Actually looks like a bunch of architectures do lazy sync of the > vmalloc area, although neither ia64 nor powerpc does so. However, all > current users of the alloc_vm_area() function would be okay since none of > the other lazy-syncing architectures are supported by X

Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-16 Thread Keir Fraser
On 16/2/07 19:06, "Keir Fraser" <[EMAIL PROTECTED]> wrote: >> I had moved it to mm/vmalloc.c in response to previous review comments >> (namely, its not Xen specific, so it shouldn't live in the Xen part of >> the tree). > > Then the call will have to be CONFIG_X86. I hadn't realised powerpc were

Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-16 Thread Keir Fraser
On 16/2/07 17:27, "Jeremy Fitzhardinge" <[EMAIL PROTECTED]> wrote: > In fact that file is only built for i386 and x86_64, so there really is no >> problem with using vmalloc_sync_all() directly and without ifdef. >> > > I had moved it to mm/vmalloc.c in response to previous review comments >

Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-16 Thread Hollis Blanchard
On Fri, 2007-02-16 at 17:10 +, Keir Fraser wrote: > > > On 16/2/07 16:46, "Jeremy Fitzhardinge" <[EMAIL PROTECTED]> wrote: > > > Yes, that would work. Unfortunately that's i386 arch-specific, whereas > > the rest of this code is generic. I guess I could just move it all to > > arch/i386/mm

Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-16 Thread Jeremy Fitzhardinge
Keir Fraser wrote: > On 16/2/07 17:10, "Keir Fraser" <[EMAIL PROTECTED]> wrote: > > >> On 16/2/07 16:46, "Jeremy Fitzhardinge" <[EMAIL PROTECTED]> wrote: >> >> >>> Yes, that would work. Unfortunately that's i386 arch-specific, whereas >>> the rest of this code is generic. I guess I could

Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-16 Thread Keir Fraser
On 16/2/07 17:10, "Keir Fraser" <[EMAIL PROTECTED]> wrote: > On 16/2/07 16:46, "Jeremy Fitzhardinge" <[EMAIL PROTECTED]> wrote: > >> Yes, that would work. Unfortunately that's i386 arch-specific, whereas >> the rest of this code is generic. I guess I could just move it all to >> arch/i386/mm. >

Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-16 Thread Keir Fraser
On 16/2/07 16:46, "Jeremy Fitzhardinge" <[EMAIL PROTECTED]> wrote: > Yes, that would work. Unfortunately that's i386 arch-specific, whereas > the rest of this code is generic. I guess I could just move it all to > arch/i386/mm. This whole thing isn't an issue on ia64 (they no-op lock_vm_area

Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-16 Thread Jeremy Fitzhardinge
Andi Kleen wrote: >> It's for populating the pagetable in a vmalloc area. There's magic in >> > > If the lazy setup doesn't work for you you can always call vmalloc_sync() > early. > Yes, that would work. Unfortunately that's i386 arch-specific, whereas the rest of this code is generic.

Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-16 Thread Andi Kleen
On Friday 16 February 2007 12:10, Keir Fraser wrote: > > On 16/2/07 09:18, "Andi Kleen" <[EMAIL PROTECTED]> wrote: > > >> It's for populating the pagetable in a vmalloc area. There's magic in > > > > If the lazy setup doesn't work for you you can always call vmalloc_sync() > > early. > > vmall

Re: [Xen-devel] Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-16 Thread Keir Fraser
On 16/2/07 09:18, "Andi Kleen" <[EMAIL PROTECTED]> wrote: >> It's for populating the pagetable in a vmalloc area. There's magic in > > If the lazy setup doesn't work for you you can always call vmalloc_sync() > early. vmalloc_sync_all()? That's a great idea. We can put that in alloc_vm_area(

Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-16 Thread Andi Kleen
> It's for populating the pagetable in a vmalloc area. There's magic in If the lazy setup doesn't work for you you can always call vmalloc_sync() early. -Andi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo in

Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-15 Thread Andrew Morton
On Thu, 15 Feb 2007 23:30:57 -0800 Jeremy Fitzhardinge <[EMAIL PROTECTED]> wrote: > > 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,

Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-15 Thread Nick Piggin
Andrew Morton wrote: On Thu, 15 Feb 2007 23:08:02 -0800 Jeremy Fitzhardinge <[EMAIL PROTECTED]> 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 a

Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-15 Thread Jeremy Fitzhardinge
Andrew Morton wrote: > On Thu, 15 Feb 2007 23:08:02 -0800 Jeremy Fitzhardinge <[EMAIL PROTECTED]> > 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

Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-15 Thread Andrew Morton
On Thu, 15 Feb 2007 23:08:02 -0800 Jeremy Fitzhardinge <[EMAIL PROTECTED]> 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 >

Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-15 Thread Jeremy Fitzhardinge
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? J - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the bod

Re: [patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-15 Thread Andrew Morton
On Thu, 15 Feb 2007 18:25:01 -0800 Jeremy Fitzhardinge <[EMAIL PROTECTED]> wrote: > +void lock_vm_area(struct vm_struct *area) > +{ > + unsigned long i; > + char c; > + > + /* > + * Prevent context switch to a lazy mm that doesn't have this area > + * mapped into its page ta

[patch 12/21] Xen-paravirt: Allocate and free vmalloc areas

2007-02-15 Thread Jeremy Fitzhardinge
Allocate/destroy a 'vmalloc' VM area: alloc_vm_area and free_vm_area The alloc function ensures that page tables are constructed for the region of kernel virtual address space and mapped into init_mm. Lock an area so that PTEs are accessible in the current address space: lock_vm_area and unlock_vm