vserver 2.0 rc7
[linux-2.6.git] / include / asm-sparc64 / tlb.h
index 494b187..64aa8c4 100644 (file)
@@ -4,7 +4,6 @@
 #include <linux/config.h>
 #include <linux/swap.h>
 #include <linux/vs_memory.h>
-
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/mmu_context.h>
@@ -46,7 +45,7 @@ extern void flush_tlb_pending(void);
 
 static inline struct mmu_gather *tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
 {
-       struct mmu_gather *mp = &per_cpu(mmu_gathers, smp_processor_id());
+       struct mmu_gather *mp = &__get_cpu_var(mmu_gathers);
 
        BUG_ON(mp->tlb_nr);
 
@@ -82,18 +81,16 @@ static inline void tlb_finish_mmu(struct mmu_gather *mp, unsigned long start, un
 {
        unsigned long freed = mp->freed;
        struct mm_struct *mm = mp->mm;
-       unsigned long rss = mm->rss;
+       unsigned long rss = get_mm_counter(mm, rss);
 
        if (rss < freed)
                freed = rss;
-       vx_rsspages_sub(mm, freed);
+       add_mm_counter(mm, rss, -freed);
 
        tlb_flush_mmu(mp);
 
        if (mp->tlb_frozen) {
-               unsigned long context = mm->context;
-
-               if (CTX_VALID(context))
+               if (CTX_VALID(mm->context))
                        do_flush_tlb_mm(mm);
                mp->tlb_frozen = 0;
        } else