* Nick Piggin <nickpiggin@xxxxxxxxxxxx> wrote:
prefetch_area(void *first_addr, void *last_addr)
(or as addr,len)
Yeah, then a specific field _within_ next->mm or thread_info may want to be fetched. In short, I don't see any argument why we shouldn't call the function prefetch_task().
it's a fundamental thing: we _dont_ want to push generic code into architectures, and there's nothing per-arch about next->mm.
Secondly, I don't really like your prefetch(kernel_stack()) function because it doesn't really give architectures enough control over exactly what cachelines they get in memory.
my point is, it comes down to concrete examples, it may or may not make sense to do things per-arch.
[...] I see nothing wrong with having a prefetch_task() call. (Although I agree things like thread_info->flags and next->mm can be done in generic code).
great that we now agree wrt. thread_info and next->mm. My remaining point is, once we prefetch ->thread_info, ->mm and the kernel stack, nothing else significant remains! (It's still very much possible that something needs to be prefetched per-arch, but i'd like to see a robust case be made for it, instead of your global 'it might happen' argument.)