Skip to contentSkip to conversation

Add __vunmap prototype

PATCH In review Benjamin Herrenschmidt 3 participants 4 messages May 14, 2007 vmalloc

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add __vunmap prototype

__vunmap is not static but I couldn't find a prototype for it, so this adds it. I need to use it in some powerpc patch to come.

 include/linux/vmalloc.h |    1 +
 1 file changed, 1 insertion(+)
include/linux/vmalloc.h +1 -0
Index: linux-cell/include/linux/vmalloc.h
===================================================================
@@ -50,6 +50,7 @@ extern void vfree(void *addr);
 extern void *vmap(struct page **pages, unsigned int count,
 			unsigned long flags, pgprot_t prot);
 extern void vunmap(void *addr);
+extern void __vunmap(void *addr, int deallocate_pages);
 
 extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
 							unsigned long pgoff);
maintainer
#1 lore raw
Quoted 13 lines · On Mon, 14 May 2007 17:07:03 +1000 Benjamin Herrenschmidt…

__vunmap is not static but I couldn't find a prototype for it, so this adds it. I need to use it in some powerpc patch to come.

 include/linux/vmalloc.h |    1 +
 1 file changed, 1 insertion(+)

Index: linux-cell/include/linux/vmalloc.h
===================================================================

include/linux/vmalloc.h extern void vfree(void *addr); · line 56

Quoted 7 lines
include/linux/vmalloc.h +1 -0
@@ -50,6 +50,7 @@ extern void vfree(void *addr);
 extern void *vmap(struct page **pages, unsigned int count,
 			unsigned long flags, pgprot_t prot);
 extern void vunmap(void *addr);
+extern void __vunmap(void *addr, int deallocate_pages);
 
 extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
 							unsigned long pgoff);

um, the only possible reason for wanting to access __vunmap() is that you want to do vunmap() from interrupt context, which is deadlockable.

#2 lore raw
Quoted 20 lines · Andrew Morton
Quoted 18 lines · On Mon, 14 May 2007 17:07:03 +1000 Benjamin Herrenschmidt…

__vunmap is not static but I couldn't find a prototype for it, so this adds it. I need to use it in some powerpc patch to come.

 include/linux/vmalloc.h |    1 +
 1 file changed, 1 insertion(+)

Index: linux-cell/include/linux/vmalloc.h
===================================================================

include/linux/vmalloc.h +1 -0
@@ -50,6 +50,7 @@ extern void vfree(void *addr);
 extern void *vmap(struct page **pages, unsigned int count,
 			unsigned long flags, pgprot_t prot);
 extern void vunmap(void *addr);
+extern void __vunmap(void *addr, int deallocate_pages);
 
Quoted 5 lines

include/linux/vmalloc.h extern void vfree(void *addr); · line 56

Quoted 2 lines
include/linux/vmalloc.h +0 -0
 extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
 							unsigned long pgoff);

um, the only possible reason for wanting to access __vunmap() is that you want to do vunmap() from interrupt context, which is deadlockable.

Argh... I'm stupid, ignore it !

I just want to __vunmap(addr, 0); which is just what vunmap() does :-)

Why is __vunmap not static btw ? If there's no reason, I'll send a patch to make it so.

Ben.

#3 lore raw
Quoted 27 lines · Benjamin Herrenschmidt
Quoted 20 lines · Andrew Morton
Quoted 18 lines · On Mon, 14 May 2007 17:07:03 +1000 Benjamin Herrenschmidt…

__vunmap is not static but I couldn't find a prototype for it, so this adds it. I need to use it in some powerpc patch to come.

 include/linux/vmalloc.h |    1 +
 1 file changed, 1 insertion(+)

Index: linux-cell/include/linux/vmalloc.h
===================================================================

include/linux/vmalloc.h 2007-05-14 16:03:47.000000000 +1000 renamed from include/linux/vmalloc.h 2007-05-14 16:03:42.000000000 +1000 +1 -0
@@ -50,6 +50,7 @@ extern void vfree(void *addr);
 extern void *vmap(struct page **pages, unsigned int count,
                    unsigned long flags, pgprot_t prot);
 extern void vunmap(void *addr);
+extern void __vunmap(void *addr, int deallocate_pages);
 
Quoted 5 lines

include/linux/vmalloc.h 2007-05-14 16:03:47.000000000 +1000 extern void vfree(void *addr); · line 56

Quoted 2 lines
include/linux/vmalloc.h 2007-05-14 16:03:47.000000000 +1000 renamed from include/linux/vmalloc.h 2007-05-14 16:03:42.000000000 +1000 +0 -0
 extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
                                                    unsigned long pgoff);

um, the only possible reason for wanting to access __vunmap() is that you want to do vunmap() from interrupt context, which is deadlockable.

Quoted 6 lines

Argh... I'm stupid, ignore it !

I just want to __vunmap(addr, 0); which is just what vunmap() does :-)

Why is __vunmap not static btw ? If there's no reason, I'll send a patch to make it so.

Yeah, it has no users outside mm/vmalloc.c and is not EXPORT_SYMBOL'ed anyway (plus it's a BUG from in_interrupt() as Andrew says, so must be called as either vfree() or vunmap()), so clearly it does want to be static.