> I'm observing *excessive high* number of pagefaults
> after a process has forked.

Btw: I'm observing a similar / the same problem with mprotect(2):

# cat mapp.c
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/mman.h>

#define PAGESIZE        4096

int
main(int argc, char **argv)
{
        int fd;
        char *filename;
        char data_tmp[PAGESIZE];
        void *data;
        char tmp;

        fd = open(filename = "/tmp/data", O_RDWR|O_TRUNC|O_CREAT, 0666);
        if (fd < 0) {
                perror(filename);
                exit(1);
        }
        memset(data_tmp, '*', sizeof(data_tmp));
        write(fd, data_tmp, sizeof(data_tmp));
        data = mmap((void*)0x41002000, PAGESIZE, PROT_READ,
            MAP_FIXED|MAP_SHARED, fd, 0);
        if (data == MAP_FAILED) {
                perror("mmap");
                exit(1);
        }
        tmp = *(char*)data;
        mprotect(data, PAGESIZE, PROT_READ|PROT_WRITE);
        *(char*)data = tmp;

        close(fd);
        exit(0);
}


This program should produce two pagefaults for address 0x41002000;
but when I just ran it on a gentoo 32-bit dom0 with xen 3.2.0 pae
hypervisor, in a snv_81 domU, the test program was running for
45 seconds and produced almost six million pagefaults for
address 41002000.
 
 
This message posted from opensolaris.org
_______________________________________________
xen-discuss mailing list
[email protected]

Reply via email to