Re: Page coloring HOWTO [ans]

Larry McVoy (lm@bitmover.com)
Sat, 30 Jan 1999 14:21:43 -0800


Richard Gooch <rgooch@atnf.csiro.au> asks:
: > (a) make sure that each process maps the same virtual addresses to
: > different locations in the cache, if possible.
:
: What is the reasoning behind this? What are the benefits of just
: having a global goal colour counter? As long as two processes, each
: allocating a page, receive a different colour for their pages, then
: they should be able to inhabit the cache at the same time.
: Why take it further and the same virtual address should give different
: colour pages?
:
: > (b) make sure that a contiguous chunk of virtual address space in
: > one process occupies a contiguous chunk of cache, if possible.
:
: Again, why? Isn't it good enough that a contiguous chunk of virtual
: address space maps to unique cache lines?

I don't understand these questions. Perhaps you'd like to explain a
faster alg which accomplish the goals of "address space maps to unique
cache lines" than an add plus a mod.

: Or is this algorithm only used for anonymous pages?

I don't remember if they did it for file pages. I suppose they could,
though they may or may not have process context when the pages come on,
so probably not. For those, use file offset (as a page) + ino number
as the seed and away you go.

: I assume you mean those programmes which are slowed down by page
: colouring have a silly access pattern which results in cache line
: aliasing? They only ran faster without page colouring because random
: physical page allocations actually gave them a chance of avoiding this
: aliasing?

Exactly.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/