From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 4 13:13:38 2005 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.org Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 397D016A41F; Fri, 4 Nov 2005 13:13:38 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.95]) by mx1.FreeBSD.org (Postfix) with ESMTP id D9DB343D67; Fri, 4 Nov 2005 13:13:30 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from flame.pc (aris.bedc.ondsl.gr [62.103.39.226]) by kane.otenet.gr (8.13.4/8.13.4/Debian-1) with SMTP id jA4DDToE025194; Fri, 4 Nov 2005 15:13:29 +0200 Received: from flame.pc (flame [127.0.0.1]) by flame.pc (8.13.4/8.13.4) with ESMTP id jA4CoGdh001262; Fri, 4 Nov 2005 14:50:16 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by flame.pc (8.13.4/8.13.4/Submit) id jA4CoGuB001261; Fri, 4 Nov 2005 14:50:16 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Fri, 4 Nov 2005 14:50:16 +0200 From: Giorgos Keramidas To: kamal kc Message-ID: <20051104125016.GA1235@flame.pc> References: <20051103145729.GA2088@flame.pc> <20051104065630.9592.qmail@web35704.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051104065630.9592.qmail@web35704.mail.mud.yahoo.com> X-Mailman-Approved-At: Fri, 04 Nov 2005 13:23:27 +0000 Cc: freebsd , freebsd Subject: Re: allocating 14KB memory per packet compression/decompression results in vm_fault X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2005 13:13:38 -0000 On 2005-11-03 22:56, kamal kc wrote: >>> for my compression/decompression i use string tables and >>> temporary buffers which take about 14KB of memory per >>> packet. >> >> If you're allocating 14 KB of data just to send >> (approximately) 1.4 KB >> and then you throw away the 14 KB immediately, it >> sounds terrible. > > yes that's true. > > since i am using the adaptive LZW compression scheme it > requires construction of string table for > compression/decompression. So an ip packet of size 1500 bytes > requires a table of size (4KB + 4KB + 2KB = 12KB). I may be stating the obvious or something totally wrong, but couldn't the string table be constructed once instead of each time a packet goes down? It is my intuition that this would perform much much better than re-doing the work of the string table each time a packet goes out. > what would be the best possible way to allocate/deallocate 14KB > memory per packet without causing vm_faults ?? Bearing in mind that packets may be as small as 34 bytes, there's no good way, IMHO. - Giorgos