Lei Jin wrote:
Thank you for your kind replies.

I just want to get a general idea before I dig into the detail in the code. I am interested in the coloring algorithm and would like to do some experiments on it. I am happy that OpenSol already has the coloring implemented. Apparently, Linux does not.
One more question is: does the page allocation function has a parameter like 
"color" so we could control the color of the page?

No, this is left to the platform implementation to select...

By the way, how do you think these coloring algorithms perform in reality in 
terms of L2 or overall performance?


Depends entirely on the benchmark and the cpu architecture....

One easy way to experiment with alternate page coloring algorithms
is to use meminfo to get the physical adress of pages in an mmaped
file from userland, and then remap the pages to get the coloring
you want to run your algorithm against....


/*
 *  get phys address for a virtual page
 */

uint64_t
getphysaddr(void *ptr)
{
        void * virt = ptr;
        uint64_t phys;
        uint_t valid;
        static const uint_t info[1] = {MEMINFO_VPHYSICAL};

        if (meminfo((uint64_t *)&virt, 1, info, 1, &phys, &valid) < 0) {
                perror("meminfo");
                exit(1);
        }

        if (valid != 3) {
                fprintf(stderr, "phys not valid %d?\n", valid);
                exit(1);
        }

        return (phys);
}

- Bart


--
Bart Smaalders                  Solaris Kernel Performance
[EMAIL PROTECTED]               http://blogs.sun.com/barts
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to