From owner-cvs-all@FreeBSD.ORG Wed Aug 25 10:22:12 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4DA8B16A4CE; Wed, 25 Aug 2004 10:22:12 +0000 (GMT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 40EE343D55; Wed, 25 Aug 2004 10:22:12 +0000 (GMT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 3A0E95C92F; Wed, 25 Aug 2004 03:22:12 -0700 (PDT) Date: Wed, 25 Aug 2004 03:22:12 -0700 From: Alfred Perlstein To: Pawel Jakub Dawidek Message-ID: <20040825102212.GY26612@elvis.mu.org> References: <200408250931.i7P9VUls060514@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200408250931.i7P9VUls060514@repoman.freebsd.org> User-Agent: Mutt/1.4.2.1i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/netinet ip_dummynet.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2004 10:22:12 -0000 * Pawel Jakub Dawidek [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