[parisc-linux] Prefetch macros for PA-RISC

Matthew Wilcox matthew@wil.cx
Wed, 21 Feb 2001 11:53:41 -0700


On Wed, Feb 21, 2001 at 10:50:53AM -0800, Grant Grundler wrote:
> Will assuming SR0 work for user space?
> Will assuming SR0 work for zero-copy patch in the (near?) future?

It'll have to.  If you want to prefetch userspace, we need different
macros.  Given an address, we have no way of telling whether it's
user or kernel.

> "addr" has alignment restrictions. Not sure if you want
> to encode those as runtime checks or not.

Um.. Kane, page 6-11: ``The prefetch address is never unaligned -- the
low-order bits are ignored and the cache line containing the address is
fetched.''

> My reading of the "PA 2.0 Enhancements" in the "PA-RISC 2.0 Architecture"
> is pretty clear this is for PA2.0 CPU's only. #ifdef __LP64__ is needed.

But that stops 32-bit kernels on 64-bit architecture from taking advantage
of the optimisation.  perhaps we need some funky runtime patching...

> I'd like to encourage use prefetching on bcopy/checksum type loops.
> It will help perf *alot*.

I believe arjan's patch uses prefetches for list walking, which helps
the scheduler a lot.

-- 
Revolutions do not require corporate support.