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

2007-11-27 Thread Christoph Lameter
On Wed, 28 Nov 2007, Andi Kleen wrote: > It was demonstrated useful for some specific cases, like context switch early > fetch on IA64. But I agree the prefetch on each list_for_each() is probably > a bad idea and should be removed. Will also help code size. Looks like sum_vm_events() is only eve

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

2007-11-27 Thread Christoph Lameter
On Tue, 27 Nov 2007, Andrew Morton wrote: > I don't recall anyone ever demonstrating that prefetch is useful in-kernel. vmstat: remove prefetch Remove the prefetch logic in order to avoid touching impossible per cpu areas. Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]> --- mm/vmstat.c

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

2007-11-27 Thread Andi Kleen
On Tue, Nov 27, 2007 at 03:42:13PM -0800, Andrew Morton wrote: > On Tue, 27 Nov 2007 15:22:56 -0800 (PST) > Christoph Lameter <[EMAIL PROTECTED]> wrote: > > > On Tue, 27 Nov 2007, Andrew Morton wrote: > > > > > The prefetch however might still need some work - we can indeed do > > > prefetch() ag

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

2007-11-27 Thread Andrew Morton
On Tue, 27 Nov 2007 15:22:56 -0800 (PST) Christoph Lameter <[EMAIL PROTECTED]> wrote: > On Tue, 27 Nov 2007, Andrew Morton wrote: > > > The prefetch however might still need some work - we can indeed do > > prefetch() against a not-possible CPU's memory here. And I do recall that > > 4-5 years a

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

2007-11-27 Thread Christoph Lameter
On Tue, 27 Nov 2007, Andrew Morton wrote: > The prefetch however might still need some work - we can indeed do > prefetch() against a not-possible CPU's memory here. And I do recall that > 4-5 years ago we did have a CPU (one of mine, iirc) which would oops when > prefetching from a bad address.

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

2007-11-27 Thread Andrew Morton
On Tue, 27 Nov 2007 15:12:41 -0800 Andrew Morton <[EMAIL PROTECTED]> wrote: > On Tue, 27 Nov 2007 23:16:28 +0100 > Andi Kleen <[EMAIL PROTECTED]> wrote: > > > On Tue, Nov 27, 2007 at 01:50:53PM -0800, [EMAIL PROTECTED] wrote: > > > Change loops controlled by 'for (i = 0; i < NR_CPUS; i++)' to use

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

2007-11-27 Thread Christoph Lameter
On Tue, 27 Nov 2007, Andrew Morton wrote: > hm. Has anyone any evidence that we're actually touching > not-possible-cpu's memory here? I saw it in acpi when the __cpu_offset() pointers become zero. I have never seen it in vmstat.c. We do not need the vmstat.c fix. - To unsubscribe from this lis

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

2007-11-27 Thread Andrew Morton
On Tue, 27 Nov 2007 23:16:28 +0100 Andi Kleen <[EMAIL PROTECTED]> wrote: > On Tue, Nov 27, 2007 at 01:50:53PM -0800, [EMAIL PROTECTED] wrote: > > Change loops controlled by 'for (i = 0; i < NR_CPUS; i++)' to use > > 'for_each_possible_cpu(i)' when there's a _remote possibility_ of > > dereferencin

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

2007-11-27 Thread pageexec
On 27 Nov 2007 at 13:50, [EMAIL PROTECTED] wrote: > Change loops controlled by 'for (i = 0; i < NR_CPUS; i++)' to use > 'for_each_possible_cpu(i)' when there's a _remote possibility_ of > dereferencing a non-allocated per_cpu variable involved. actually, it's not that remote, it happens every tim

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

2007-11-27 Thread Andi Kleen
On Tue, Nov 27, 2007 at 01:50:53PM -0800, [EMAIL PROTECTED] wrote: > Change loops controlled by 'for (i = 0; i < NR_CPUS; i++)' to use > 'for_each_possible_cpu(i)' when there's a _remote possibility_ of > dereferencing a non-allocated per_cpu variable involved. > > All files except mm/vmstat.c are

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

2007-11-27 Thread travis
Change loops controlled by 'for (i = 0; i < NR_CPUS; i++)' to use 'for_each_possible_cpu(i)' when there's a _remote possibility_ of dereferencing a non-allocated per_cpu variable involved. All files except mm/vmstat.c are x86 arch. Based on 2.6.24-rc3-mm1 . Thanks to [EMAIL PROTECTED] for pointi