Date: Fri, 3 Jan 2003 15:19:19 +0200 From: Dimitar Peikov <mitko@rila.bg> To: freebsd-hackers@freebsd.org Subject: bzero() in mfs_doio() Message-ID: <200301031519.22540.mitko@rila.bg>
next in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I've read some part of the UFS/MFS code and saw the bzero() in code, but=20
according the madvice() manual page for MADV_FREE, this step is not neede=
d.
Also frequent calls to mfs_doio() causes serious performance penalty, am =
I=20
right?
>>>>>>
MADV_FREE Gives the VM system the freedom to free pages, and =
tells
the system that information in the specified page r=
ange
is no longer important. This is an efficient way o=
f
allowing malloc(3) to free pages anywhere in the ad=
dress
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 t=
here
before the MADV_FREE call. References made to that
address space range will not make the VM system pag=
e the
information back in from backing store until the pa=
ge is
modified 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
- --=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+FY3aaLnffbPBntcRAjdmAJ9TJRugyEn243W2nfX1QKNdY1yc5QCdGwqs
1TGC/1b9xgJuofP6js/u7p0=3D
=3D6zCO
-----END PGP SIGNATURE-----
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?200301031519.22540.mitko>
