From owner-freebsd-net@FreeBSD.ORG Fri Nov 4 23:58:17 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D937C16A41F for ; Fri, 4 Nov 2005 23:58:17 +0000 (GMT) (envelope-from ivo.vachkov@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64F5443D49 for ; Fri, 4 Nov 2005 23:58:17 +0000 (GMT) (envelope-from ivo.vachkov@gmail.com) Received: by xproxy.gmail.com with SMTP id s9so5367wxc for ; Fri, 04 Nov 2005 15:58:16 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=V+Khzlz71nDmI9m7fDbLb4t3SQ9C06TS7BOTEfo508EDHiTH4ojkEoAyDgWZP/+Eg4B5QksIwDlojMsmJLsPNUfnf3/E2qJU/ZqJnOpnPeOjqqNhGQKDdHvuRXTieW/dnuAH4BoEn7tJUPbZsaTyznm+Bp5q7YXkbjEC+kNpVrI= Received: by 10.70.103.10 with SMTP id a10mr1762310wxc; Fri, 04 Nov 2005 02:08:12 -0800 (PST) Received: by 10.70.113.17 with HTTP; Fri, 4 Nov 2005 02:08:12 -0800 (PST) Message-ID: Date: Fri, 4 Nov 2005 12:08:12 +0200 From: Ivo Vachkov To: kamal kc , freebsd-net@freebsd.org In-Reply-To: <20051104065630.9592.qmail@web35704.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20051103145729.GA2088@flame.pc> <20051104065630.9592.qmail@web35704.mail.mud.yahoo.com> Cc: Subject: Re: allocating 14KB memory per packet compression/decompression results in vm_fault X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2005 23:58:18 -0000 2005/11/4, kamal kc : > > > > 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 =3D12KB). > > further still i copy the ip packet > data in another data buffer (about 1.4KB) and > then compress it. > > So all this adds up to about 14KB. > > Right now i can't do with less than 14KB. > > as i said before the compression/decompression works > fine. but soon the kernel would panic with one > of the vm_fault: error message. > > what would be the best possible way to > allocate/deallocate 14KB memory per packet without > causing vm_faults ?? > > is there anything i am missing ?? 1. do you free all buffers you're using after sending the packet (probably in if_output()/ether_output()) ? 2. you could try to allocate the buffers during system startup and reuse th= em. > thanks > > kamal > > > > > > > > > > > > > > __________________________________ > Yahoo! Mail - PC Magazine Editors' Choice 2005 > http://mail.yahoo.com > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > -- "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." Dennis Ritchie