tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: uvm page coloring for cache aliasing



On Sat, 23 Dec 2017, coypu%sdf.org@localhost wrote:

> Hi folks,
> 
> as I understand, a reason to have page coloring is extra broken MIPS
> hardware which has cache aliasing issues unless a large page size
> is used. picking the same color avoids aliasing.


Could be to work around cache aliasing, or it could be used to reduce 
cache line contention.  I'd say it's mostly used for the latter.  This is 
an optimization, not functional enforcement.

> now, looking at uvm_pagealloc_pgfl:
> 
> do {
> 	/* trying to find pages in color.. */
> 	/* goto success */
> 
> 	color = (color + 1) & uvmexp.colormask;
>  } while (color != trycolor);
> 
> which means that if we fail to find a page in the requested color, we'll
> try another color. I think this might end up inducing cache aliasing
> issues, and we should instead fail for this case.
> 
> thoughts?

If there are functional issues with page mappings they should be handled 
in the pmap layer, either failing the map request, or disabling any 
potentially aliased caches.

Eduardo


Home | Main Index | Thread Index | Old Index