Date: Wed, 25 Aug 2004 03:22:12 -0700 From: Alfred Perlstein <alfred@freebsd.org> To: Pawel Jakub Dawidek <pjd@FreeBSD.org> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/netinet ip_dummynet.c Message-ID: <20040825102212.GY26612@elvis.mu.org> In-Reply-To: <200408250931.i7P9VUls060514@repoman.freebsd.org> References: <200408250931.i7P9VUls060514@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
* Pawel Jakub Dawidek <pjd@FreeBSD.org> [040825 02:31] wrote: > pjd 2004-08-25 09:31:30 UTC > > FreeBSD src repository > > Modified files: > sys/netinet ip_dummynet.c > Log: > Allocate memory when dumping pipes with M_WAITOK flag. > On a system with huge number of pipes, M_NOWAIT failes almost always, > because of memory fragmentation. > My fix is different than the patch proposed by Pawel Malachowski, > because in FreeBSD 5.x we cannot sleep while holding dummynet mutex > (in 4.x there is no such lock). > My fix is also ugly, but there is no easy way to prepare nice and clean fix. This is actually OK. What I would do to make this a bit safer is to loop, keeping track of the highest count seen, and allocating size+SLACK amount of entries. There's no need to abort if the list changes, but you can make the code adapt to a changing list! :) -Alfred
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040825102212.GY26612>