VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / arch / ppc64 / mm / hugetlbpage.c
index 9416e53..403c79b 100644 (file)
@@ -377,6 +377,7 @@ void unmap_hugepage_range(struct vm_area_struct *vma,
        unsigned long addr;
        hugepte_t *ptep;
        struct page *page;
+       int cpu;
        int local = 0;
        cpumask_t tmp;
 
@@ -385,7 +386,8 @@ void unmap_hugepage_range(struct vm_area_struct *vma,
        BUG_ON((end % HPAGE_SIZE) != 0);
 
        /* XXX are there races with checking cpu_vm_mask? - Anton */
-       tmp = cpumask_of_cpu(smp_processor_id());
+       cpu = get_cpu();
+       tmp = cpumask_of_cpu(cpu);
        if (cpus_equal(vma->vm_mm->cpu_vm_mask, tmp))
                local = 1;
 
@@ -408,6 +410,7 @@ void unmap_hugepage_range(struct vm_area_struct *vma,
 
                put_page(page);
        }
+       put_cpu();
 
        // mm->rss -= (end - start) >> PAGE_SHIFT;
        vx_rsspages_sub(mm, (end - start) >> PAGE_SHIFT);