From owner-freebsd-hackers Fri Jan 3 4:20:50 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DEA6737B401 for ; Fri, 3 Jan 2003 04:20:47 -0800 (PST) Received: from host2.rila.bg (host2.rila.bg [62.73.64.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB4E643EC2 for ; Fri, 3 Jan 2003 04:20:44 -0800 (PST) (envelope-from Dimitar.Peikov@rila.com) Received: from mobilin.rila.bg ([192.168.201.78]) by host2.rila.bg with Microsoft SMTPSVC(5.0.2195.5329); Fri, 3 Jan 2003 14:20:41 +0200 Received: from mobilin.rila.bg (localhost [127.0.0.1]) by mobilin.rila.bg (8.12.2/8.12.2/SuSE Linux 0.6) with ESMTP id h03DMxqa008184 for ; Fri, 3 Jan 2003 15:22:59 +0200 Received: from localhost (localhost [[UNIX: localhost]]) by mobilin.rila.bg (8.12.2/8.12.2/Submit) id h03DMx97008183 for freebsd-hackers@freebsd.org; Fri, 3 Jan 2003 15:22:59 +0200 Content-Type: text/plain; charset="utf-8" From: Dimitar Peikov Reply-To: mitko@rila.bg Organization: RILA Solutions To: freebsd-hackers@freebsd.org Subject: Re: bzero() in mfs_doio() Date: Fri, 3 Jan 2003 15:22:59 +0200 X-Mailer: KMail [version 1.4] References: <200301031519.22540.mitko@rila.bg> In-Reply-To: <200301031519.22540.mitko@rila.bg> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200301031522.59212.mitko@rila.bg> X-OriginalArrivalTime: 03 Jan 2003 12:20:41.0042 (UTC) FILETIME=[87EB9B20:01C2B322] 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 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Upps, sorry, too much wine during the holidays. I've not read the code correctly ;-( On Friday 03 January 2003 15:19, Dimitar Peikov wrote: > Hi, > > I've read some part of the UFS/MFS code and saw the bzero() in code, bu= t > according the madvice() manual page for MADV_FREE, this step is not nee= ded. > Also frequent calls to mfs_doio() causes serious performance penalty, a= m I > right? > > > > MADV_FREE Gives the VM system the freedom to free pages, an= d > tells the system that information in the specified page range is no lon= ger > important. This is an efficient way of allowing malloc(3) to free page= s > anywhere in the address space, while keeping the address space valid. = The > next time that the page is referenced, the page might be demand zeroed,= or > might contain the data that was there before the MADV_FREE call.=20 > References made to that address space range will not make the VM system > page the information back in from backing store until the page is modif= ied > again. > > > > /sys/ufs/mfs/mfs_vnops.c:259 > > =09=09=09bytes &=3D ~PAGE_MASK; > =09=09=09if (bytes !=3D 0) { > =09=09=09=09bzero(&uap, sizeof(uap)); > =09=09=09=09uap.addr =3D base; > =09=09=09=09uap.len =3D bytes; > =09=09=09=09uap.behav =3D MADV_FREE; > =09=09=09=09madvise(curproc, &uap); > =09=09=09} - --=20 Dimitar Peikov Programmer Analyst Globalization Group "We Build e-Business" =20 RILA Solutions =20 27 Building, Acad.G.Bonchev Str. =20 1113 Sofia, Bulgaria =20 phone: (+359 2) 9797320=20 phone: (+359 2) 9797300=20 fax: (+359 2) 9733355 =20 http://www.rila.com=20 GnuPG key http://earth.rila.bg/~mitko/mitko.key.asc GnuPG key http://www.bgzone.com/~mitko/mitko.key.asc Key fingerprint 97AF 6192 78E2 AC68 FD56 CCB0 68B9 DF7D B3C1 9ED7 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE+FY6zaLnffbPBntcRAgnFAJsEgNVGTOJkd5GdpH8RTjyMZDc0BQCdGqit E28a9Aw/lL+1VfbGT620ELc=3D =3DRqbi -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message