Re: "Colo[u]rs"

From: Robert Love (rml@tech9.net)
Date: Mon Dec 10 2001 - 02:26:47 EST


On Mon, 2001-12-10 at 02:07, Stevie O wrote:
> After a few failed web searches (combos like 'linux cache color' just gave
> me a bunch of references to video), I am resorting to this list for this
> question.
>
> What exactly do y'all mean by these "colors"? Task colors, cache colors,
> and probably a few other colors i've missed/forgotten about. What do these
> colors represent? How are they used to group tasks/cache entries? Is what
> they're actually

Cache color is how many indexes there are into a cache. Caches
typically aren't direct mapped: they are indexed into cache lines by a
hash. This means that certain memory values (of the 2^32 on your PC)
will map to the same cache line. This means only one can be there at
the same time, and the newer one throws the old one out.

Coloring of data structures is down to give random offsets to data such
that they are not are multiples of the some value and thus don't map to
the same cache line. This is what Linux's slab allocator is meant to
do.

        Robert Love

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



This archive was generated by hypermail 2b29 : Sat Dec 15 2001 - 21:00:16 EST