Re: [PATCH] Mutilated form of Andi Kleen's AMD prefetch errata patch

Andrew Morton
2003-10-01T15:18:12Z

Andi Kleen <ak@suse.de> wrote:
>
> > I'm a bit confused as to what significance the faulting address has btw:
> > kernel code can raise prefetch faults against addresses which are less
> > than, and presumably greater than TASK_SIZE.
>
> Currently it can't - hlist either prefetches to zero or to a valid
> address and everybody else using prefetch should also use valid addresses.

mumble, mutter.

> But it's conceivable that future kernels make more extensive use of
> prefetch.

yup.

Why is it not sufficient to do something like:

if (!(error_code & 4) && is_prefetch(...))
return;

near the start of do_page_fault()?

kernel-mode faults aren't very common. Most of them occur in
generic_file_read(), for reads into freshly-allocated memory (I think).
And the frequency of these is limited by disk bandwidth...