I have done some tests on my machine,  the machine has both Linux and FreeBSD 
installed,
the following is the data:

MALLOC_SIZE = 1024*1024*400
has bzero

Red Linux 6.2(kernel 2.2.14)
    5.09user 5.62system 1:15.33elapsed 14%CPU (0avgtext+0avgdata 0maxresident)k
    0inputs+0outputs (115298major+206560minor)pagefaults 161471swaps

    4.70user 5.73system 1:17.13elapsed 13%CPU (0avgtext+0avgdata 0maxresident)k
    0inputs+0outputs (116402major+206554minor)pagefaults 160731swaps

    4.88user 5.68system 1:17.04elapsed 13%CPU (0avgtext+0avgdata 0maxresident)k
    0inputs+0outputs (117309major+206550minor)pagefaults 161273swaps

FreeBSD 4.5-STABLE
    5.489u 6.815s 1:25.96 14.2%   4+425738k 0+0io 12937pf+0w
    5.342u 6.728s 1:24.40 14.2%   4+414152k 0+0io 12929pf+0w
    5.073u 6.815s 1:28.58 13.4%   3+408011k 1+0io 12920pf+0w

-------
MALLOC_SIZE = 1024*1024*400
no bzero

Red Linux 6.2(kernel 2.2.14)
    2.01user 4.16system 0:24.79elapsed 24%CPU (0avgtext+0avgdata 0maxresident)k
    0inputs+0outputs (5127major+103353minor)pagefaults 59369swaps

    1.82user 4.31system 0:24.90elapsed 24%CPU (0avgtext+0avgdata 0maxresident)k
    0inputs+0outputs (4897major+103339minor)pagefaults 59250swaps

    1.76user 4.29system 0:24.51elapsed 24%CPU (0avgtext+0avgdata 0maxresident)k
    0inputs+0outputs (5814major+103343minor)pagefaults 59360swaps

FreeBSD 4.5-STABLE
    2.802u 3.604s 0:23.20 27.5%   4+415497k 0+0io 81pf+0w
    2.975u 3.434s 0:23.58 27.1%   4+412937k 0+0io 83pf+0w
    2.871u 3.480s 0:23.91 26.5%   4+413607k 0+0io 83pf+0w


/*
 * vmstress.c
 */

#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#define MALLOC_SIZE 1024*1024*400

int main(int argc, char **argv) {
   char *ptr;
   int i, i_count;
   int j;

   ptr = (char *) malloc(MALLOC_SIZE);
   bzero(ptr, MALLOC_SIZE);

   i_count = MALLOC_SIZE / 16;
   fprintf(stderr, "*");
   for (i = 0; i < i_count; i ++) {
       ptr[i >> 4] = ptr[(i >> 3) + 1]++;
   }
   fprintf(stderr, "#");
   for (j = 0; j < i_count; j ++) {
       ptr[j << 4] = ptr[(j >> 3) + 1]++;
   }

   free(ptr);
   return 0;
}

Unfortunately, I havn't Linux kernel 2.4.17 installed,  is Linux kernel 2.4.17 faster?
--
David Xu



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to