RE: Add prefetch switch stack hook in scheduler function

Chen, Kenneth W
2005-07-28T19:14:53Z

> i.e. like the patch below. Boot-tested on x86. x86, x64 and ia64 have a
> real kernel_stack() implementation, the other architectures all return
> 'next'. (I've also cleaned up a couple of other things in the
> prefetch-next area, see the changelog below.)
>
> Ken, would this patch generate a sufficient amount of prefetching on
> ia64?

Sorry, this is not enough. Switch stack on ia64 is 528 bytes. We need to
prefetch 5 lines. It probably should use prefetch_range(). But on ia64,
prefetch_range stride L1_CACHE_BYTES, where I really want to stride L3 cache
line size.

We also want to prefetch switch stack for current task, since processor
state is saved onto the stack for outgoing process. And that stack is
almost guaranteed to be cold because switch stack is created below current
stack pointer.

Can we just go back to prefetch_stack() or prefetch_task() (or use plural
name) and let each arch decide what to do with it?

- Ken