linux/debian/patches/features/all/rt/mm-vmalloc-use-get-cpu-ligh...

64 lines
1.6 KiB
Diff

Subject: mm-vmalloc.patch
From: Thomas Gleixner <tglx@linutronix.de>
Date: Tue, 12 Jul 2011 11:39:36 +0200
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/3.12/patches-3.12.1-rt4.tar.xz
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
mm/vmalloc.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -790,7 +790,7 @@ static struct vmap_block *new_vmap_block
struct vmap_block *vb;
struct vmap_area *va;
unsigned long vb_idx;
- int node, err;
+ int node, err, cpu;
node = numa_node_id();
@@ -828,11 +828,12 @@ static struct vmap_block *new_vmap_block
BUG_ON(err);
radix_tree_preload_end();
- vbq = &get_cpu_var(vmap_block_queue);
+ cpu = get_cpu_light();
+ vbq = &__get_cpu_var(vmap_block_queue);
spin_lock(&vbq->lock);
list_add_rcu(&vb->free_list, &vbq->free);
spin_unlock(&vbq->lock);
- put_cpu_var(vmap_block_queue);
+ put_cpu_light();
return vb;
}
@@ -900,6 +901,7 @@ static void *vb_alloc(unsigned long size
struct vmap_block *vb;
unsigned long addr = 0;
unsigned int order;
+ int cpu = 0;
BUG_ON(size & ~PAGE_MASK);
BUG_ON(size > PAGE_SIZE*VMAP_MAX_ALLOC);
@@ -915,7 +917,8 @@ static void *vb_alloc(unsigned long size
again:
rcu_read_lock();
- vbq = &get_cpu_var(vmap_block_queue);
+ cpu = get_cpu_light();
+ vbq = &__get_cpu_var(vmap_block_queue);
list_for_each_entry_rcu(vb, &vbq->free, free_list) {
int i;
@@ -939,7 +942,7 @@ static void *vb_alloc(unsigned long size
spin_unlock(&vb->lock);
}
- put_cpu_var(vmap_block_queue);
+ put_cpu_light();
rcu_read_unlock();
if (!addr) {