Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Mar 2002 16:43:47 +0800
From:      "David Xu" <davidx@viasoft.com.cn>
To:        <mitko@rila.bg>, "Matthew Dillon" <dillon@apollo.backplane.com>
Cc:        <drwilco@drwilco.net>, <silby@silby.com>, <bifrost@minions.com>, <cjp@sandstorm.net>, <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: Swapping performance
Message-ID:  <00e601c1c67d$5e45d110$ef01a8c0@davidwnt>
References:  <20020307095452.D18855-100000@frond.minions.com><5.1.0.14.0.20020307193205.01c3b0f0@mail.drwilco.net><200203071912.g27JC3A68645@apollo.backplane.com> <20020308085032.69568968.mitko@rila.bg>

next in thread | previous in thread | raw e-mail | index | archive | help
I have done some tests on my machine,  the machine has both Linux and =
FreeBSD installed,
the following is the data:

MALLOC_SIZE =3D 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 =3D 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 =3D (char *) malloc(MALLOC_SIZE);
   bzero(ptr, MALLOC_SIZE);

   i_count =3D MALLOC_SIZE / 16;
   fprintf(stderr, "*");
   for (i =3D 0; i < i_count; i ++) {
       ptr[i >> 4] =3D ptr[(i >> 3) + 1]++;
   }
   fprintf(stderr, "#");
   for (j =3D 0; j < i_count; j ++) {
       ptr[j << 4] =3D 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 majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00e601c1c67d$5e45d110$ef01a8c0>