Date: Fri, 3 Jan 2003 15:22:59 +0200 From: Dimitar Peikov <mitko@rila.bg> To: freebsd-hackers@freebsd.org Subject: Re: bzero() in mfs_doio() Message-ID: <200301031522.59212.mitko@rila.bg> In-Reply-To: <200301031519.22540.mitko@rila.bg> References: <200301031519.22540.mitko@rila.bg>
index | next in thread | previous in thread | raw e-mail
-----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, but
> according the madvice() manual page for MADV_FREE, this step is not needed.
> Also frequent calls to mfs_doio() causes serious performance penalty, am I
> right?
>
>
>
> MADV_FREE Gives the VM system the freedom to free pages, and
> tells the system that information in the specified page range is no longer
> important. This is an efficient way of allowing malloc(3) to free pages
> 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.
> 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 modified
> again.
>
>
>
> /sys/ufs/mfs/mfs_vnops.c:259
>
> bytes &= ~PAGE_MASK;
> if (bytes != 0) {
> bzero(&uap, sizeof(uap));
> uap.addr = base;
> uap.len = bytes;
> uap.behav = MADV_FREE;
> madvise(curproc, &uap);
> }
- --
Dimitar Peikov
Programmer Analyst
Globalization Group
"We Build e-Business"
RILA Solutions
27 Building, Acad.G.Bonchev Str.
1113 Sofia, Bulgaria
phone: (+359 2) 9797320
phone: (+359 2) 9797300
fax: (+359 2) 9733355
http://www.rila.com
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=
=Rqbi
-----END PGP SIGNATURE-----
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301031522.59212.mitko>
