]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/blobdiff - mm/vmalloc.c
cls_can: Syntax fix
[lisovros/linux_canprio.git] / mm / vmalloc.c
index 918c51335d64165348dc3b54775019f7a78bcaa7..d8087f0db5073fc9ed3f879c7bc582c4fc462d0f 100644 (file)
@@ -31,6 +31,7 @@
 #include <asm/tlbflush.h>
 #include <asm/shmparam.h>
 
+bool vmap_lazy_unmap __read_mostly = true;
 
 /*** Page table manipulation functions ***/
 
@@ -502,6 +503,9 @@ static unsigned long lazy_max_pages(void)
 {
        unsigned int log;
 
+       if (!vmap_lazy_unmap)
+               return 0;
+
        log = fls(num_online_cpus());
 
        return log * (32UL * 1024 * 1024 / PAGE_SIZE);
@@ -512,6 +516,15 @@ static atomic_t vmap_lazy_nr = ATOMIC_INIT(0);
 /* for per-CPU blocks */
 static void purge_fragmented_blocks_allcpus(void);
 
+/*
+ * called before a call to iounmap() if the caller wants vm_area_struct's
+ * immediately freed.
+ */
+void set_iounmap_nonlazy(void)
+{
+       atomic_set(&vmap_lazy_nr, lazy_max_pages()+1);
+}
+
 /*
  * Purges all lazily-freed vmap areas.
  *