Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125366
b: refs/heads/master
c: e4d9820
h: refs/heads/master
v: v3
  • Loading branch information
Mike Travis committed Dec 17, 2008
1 parent 5aa1196 commit 3743e4c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4cd4601d592d07b26e4b7d2bb8fcd55bbfd6cf6e
refs/heads/master: e4d98207ea3f3d15eb664282df16d18c4ac86f80
20 changes: 15 additions & 5 deletions trunk/arch/x86/xen/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ static void drop_other_mm_ref(void *info)

static void xen_drop_mm_ref(struct mm_struct *mm)
{
cpumask_t mask;
cpumask_var_t mask;
unsigned cpu;

if (current->active_mm == mm) {
Expand All @@ -1091,7 +1091,16 @@ static void xen_drop_mm_ref(struct mm_struct *mm)
}

/* Get the "official" set of cpus referring to our pagetable. */
mask = mm->cpu_vm_mask;
if (!alloc_cpumask_var(&mask, GFP_ATOMIC)) {
for_each_online_cpu(cpu) {
if (!cpumask_test_cpu(cpu, &mm->cpu_vm_mask)
&& per_cpu(xen_current_cr3, cpu) != __pa(mm->pgd))
continue;
smp_call_function_single(cpu, drop_other_mm_ref, mm, 1);
}
return;
}
cpumask_copy(mask, &mm->cpu_vm_mask);

/* It's possible that a vcpu may have a stale reference to our
cr3, because its in lazy mode, and it hasn't yet flushed
Expand All @@ -1100,11 +1109,12 @@ static void xen_drop_mm_ref(struct mm_struct *mm)
if needed. */
for_each_online_cpu(cpu) {
if (per_cpu(xen_current_cr3, cpu) == __pa(mm->pgd))
cpu_set(cpu, mask);
cpumask_set_cpu(cpu, mask);
}

if (!cpus_empty(mask))
smp_call_function_mask(mask, drop_other_mm_ref, mm, 1);
if (!cpumask_empty(mask))
smp_call_function_many(mask, drop_other_mm_ref, mm, 1);
free_cpumask_var(mask);
}
#else
static void xen_drop_mm_ref(struct mm_struct *mm)
Expand Down

0 comments on commit 3743e4c

Please sign in to comment.