relation between PQ_CACHESIZE and PQ_L2_SIZE

Bao Zhao baozhaolinuxer at yahoo.com
Sun Mar 27 08:09:38 PST 2005


--- Igor Shmukler <shmukler at mail.ru> wrote:
> >
>
http://lists.freebsd.org/mailman/htdig/freebsd-hackers/2003-June/001655.html
> >    But what puzzled me is : why not page size is 
> a 
> > factor when calculating the number of colors?
> 
> Page coloring in freebsd was implemented by John
> Dyson. It is needed to better utilize the 
> cache. Depending on cache's implementation
> fully-associative vs. 4-way vs 2-way etc you might 
> have problems.
> 
> A subset of bits (low-bits) from the page frame's
> (physical) address tells us where can data be 
> stored in processor cache. We want a relatively
> equal distribution of these "colors" so that we 
> utilize as much of cache real estate as possible.
> Hence, we are interested in the size of a 
> set, not size of a page.
> 
> I am sure, there are whole bunch of articles written
> about this. I could give you some pointers 
> offline.
> 
> Igor.
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
>
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to
> "freebsd-hackers-unsubscribe at freebsd.org"
> 
I have read two papers. Both of them think page size
impact the number of colorings.

The first one:
 R.E.Kessler "page placement algorithms for
large-indexed caches"
 excerpt from this paper , "Let N be the cache size in
pages and B=N/A(A is associativity)  be the number of
bins"

The second paper
William L.Lynch "The Interaction Of Virtual Memory and
Cache Memory"
excerpt from this paper ,section 5.3 "The number of
colors depends on the page size. As th page size
increases, the number of colors decreases until the
page size is equal to the cache
size-per-degree-of-associative"

and I find Alan Cox's post
http://lists.freebsd.org/pipermail/freebsd-current/2004-June/028470.html
quoted from the post
"1. Cache size alone does not correctly determine the
number of colors,except for direct map caches.  The
correct formula is

 (cache size in bytes / page size in bytes) / degree
of cache associativity

Thus, the comments would lead one to configure his/her
system with too many colors.  "
 
 I think Alan is right . What's you opinion? Thanks!

Best Regards!

Bao Zhao




		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 


More information about the freebsd-hackers mailing list