Re: [PATCH 1/1] mm: Prevent dereferencing non-allocated per_cpu variables

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andi Kleen <andi@...>
Cc: <travis@...>, <ak@...>, <clameter@...>, <pageexec@...>, <linux-mm@...>, <linux-kernel@...>
Date: Tuesday, November 27, 2007 - 7:12 pm

On Tue, 27 Nov 2007 23:16:28 +0100
Andi Kleen <andi@firstfloor.org> wrote:


hm.  Has anyone any evidence that we're actually touching
not-possible-cpu's memory here?

Also, the sum_vm_events() change looks buggy - it assumes that
cpu_possible_map has no gaps in it.  But that change is unneeded because
sum_vm_events() is only ever passed cpu_online_map and I'm hoping that we
don't usually online not-possible CPUs.

--- a/mm/vmstat.c~mm-prevent-dereferencing-non-allocated-per_cpu-variables-fix
+++ a/mm/vmstat.c
@@ -27,12 +27,12 @@ static void sum_vm_events(unsigned long 
 	memset(ret, 0, NR_VM_EVENT_ITEMS * sizeof(unsigned long));
 
 	cpu = first_cpu(*cpumask);
-	while (cpu < NR_CPUS && cpu_possible(cpu)) {
+	while (cpu < NR_CPUS) {
 		struct vm_event_state *this = &per_cpu(vm_event_states, cpu);
 
 		cpu = next_cpu(cpu, *cpumask);
 
-		if (cpu < NR_CPUS && cpu_possible(cpu))
+		if (cpu < NR_CPUS)
 			prefetch(&per_cpu(vm_event_states, cpu));
 
 
_

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/1] mm: Prevent dereferencing non-allocated per_..., Andrew Morton, (Tue Nov 27, 7:12 pm)
Re: [PATCH 1/1] mm: Prevent dereferencing non-allocated per_..., Christoph Lameter, (Tue Nov 27, 7:22 pm)
Re: [PATCH 1/1] mm: Prevent dereferencing non-allocated per_..., Christoph Lameter, (Tue Nov 27, 8:09 pm)
Re: [PATCH 1/1] mm: Prevent dereferencing non-allocated per_..., Christoph Lameter, (Tue Nov 27, 8:15 pm)
Re: [PATCH 1/1] mm: Prevent dereferencing non-allocated per_..., Christoph Lameter, (Tue Nov 27, 7:15 pm)