Date: Tue, 26 Jun 2001 09:47:27 -0700 (PDT) From: Matt Dillon <dillon@earth.backplane.com> To: "Brian F. Feldman" <green@FreeBSD.ORG> Cc: "Jonathan Lemon <jlemon@flugsvamp.com> Alfred Perlstein" <bright@sneakerz.org>, Mike Silbersack <silby@silby.com>, Mike Silbersack <silby@FreeBSD.ORG>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, jlemon@FreeBSD.ORG, bmilekic@FreeBSD.ORG Subject: Re: cvs commit: src/sys/netinet tcp_input.c tcp_output.c tcp_subr.c tcp_timer.c tcp_usrreq.c tcp_var.h Message-ID: <200106261647.f5QGlRr24342@earth.backplane.com> References: <200106242141.f5OLfc176777@green.bikeshed.org>
next in thread | previous in thread | raw e-mail | index | archive | help
:.. :> :> bzero seems to be optimized for large areas, perhaps it would help :> malloc some if we used some alternative zero'ing function for small :> allocations with M_ZERO set? : :That's pretty pointless; M_ZERO is _supposed_ to eventually be providing :pre-zeroed memory, which should remove that bzero in the general case, :anyway. : :-- : Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / You are assuming that most of the bzero's in the system are being done after malloc(). While it is true that quite a few bzero's in the system occur after malloc(), there are hundreds that do not. bzero() is not going away in the general case by any stretch of the imagination. In regards to M_ZERO ... well, we have lots of optimization choices there: * We could create an inline malloc() wrapper to test for constant flags and sizes to optimize certain cases. This would take up about as much space as current malloc/bzero combinations. * We can attempt to optimize bzero() within malloc(). Since malloc() guarentees aligned results and aligns the size, this could be advantageous, but we lose the ability to optimize constant sizes so it would require a real switch, so it will not work as well as #1. * We can give up on trying to optimize bzero() within malloc() and instead concentrate on giving malloc() a pre-zeroing feature, which is where malloc()'s M_ZERO flag was heading in the first place. Either way, I don't think this has much to do with the inline bzero()ing code that I am proposing. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106261647.f5QGlRr24342>