From owner-freebsd-hackers Fri Mar 8 0:44:37 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.viasoft.com.cn (unknown [61.153.1.177]) by hub.freebsd.org (Postfix) with ESMTP id 2192E37B405 for ; Fri, 8 Mar 2002 00:44:31 -0800 (PST) Received: from davidwnt (davidwnt.viasoft.com.cn [192.168.1.239]) by mail.viasoft.com.cn (8.9.3/8.9.3) with SMTP id QAA22029; Fri, 8 Mar 2002 16:53:40 +0800 Message-ID: <00e601c1c67d$5e45d110$ef01a8c0@davidwnt> From: "David Xu" To: , "Matthew Dillon" Cc: , , , , 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> Subject: Re: Swapping performance Date: Fri, 8 Mar 2002 16:43:47 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 #include #include #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