From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 4 12:45:47 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 D4A8416A41F for ; Fri, 4 Nov 2005 12:45:47 +0000 (GMT) (envelope-from jonny@jonny.eng.br) Received: from coe.ufrj.br (roma.coe.ufrj.br [146.164.53.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 320DA43D45 for ; Fri, 4 Nov 2005 12:45:47 +0000 (GMT) (envelope-from jonny@jonny.eng.br) Received: from localhost (localhost [127.0.0.1]) by coe.ufrj.br (Postfix) with ESMTP id 3EFDF1700A; Fri, 4 Nov 2005 10:45:45 -0200 (BRST) Received: from coe.ufrj.br ([146.164.53.65]) by localhost (roma.coe.ufrj.br [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 29424-02; Fri, 4 Nov 2005 10:45:38 -0200 (BRST) Received: from [10.0.0.15] (telco [201.8.56.200]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by coe.ufrj.br (Postfix) with ESMTP id EF70A17008; Fri, 4 Nov 2005 10:45:35 -0200 (BRST) Message-ID: <436B57EC.6090004@jonny.eng.br> Date: Fri, 04 Nov 2005 10:45:32 -0200 From: =?ISO-8859-1?Q?Jo=E3o_Carlos_Mendes_Luis?= User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Peter Jeremy References: <20051103145729.GA2088@flame.pc> <20051104065630.9592.qmail@web35704.mail.mud.yahoo.com> <20051104094904.GL39882@cirb503493.alcatel.com.au> In-Reply-To: <20051104094904.GL39882@cirb503493.alcatel.com.au> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAADBQ TFRFAAAAgAAAAIAAgIAAAACAgACAAICAgICAwMDA/wAAAP8A//8AAAD//wD/AP//////ex+xxAAA Ac9JREFUOMtdk8FupDAMhr1qRbjR2x77GD3uq7BS1TkuhyrmFnppcvOrUlUquXltJ2EAIw1Dvvz+ bRPgrQbU6NpzuY0AF1LABIc4AH9crxLwb/4VztEU42W9SOBezwX4ClzeLuC9PBFRq+2xpJJHN8KQ Oa9Hd/ACnldgUVADvgHKA2usVwW12BVSkrThJH+5lqqQXIAAvRkQM6WqkADpO5gBx5m5VOxRgBZV HRLRcgc4dv3ukbOBm3de8uHIe1n0BBUBIi4hi0U2ownGkkwrwN425ygVPjntsvOmkFyyXYfreHXq f1tugFLCFDhZcsffYIqxKNAB/FkNbBDslUTz0MMQfuRnkN6D5nLVQ0G2H3bWC6KByTZPZWhJ/jgs ChX3e/P5y0VReCUCYm0/pUQd1lQ4/aIty/YtW6y3WMHc8yazpcU8UuqqB+LfMql/wVx4kXNTwGQO PxTuL7+AhbSkWS4z0TdZFbo1BR6qQkA08DnogNNHey/SGc5GejqFttxhjBHd3rjd62nR08gnxeFr Ic2e52we+QC0rIg6KYn1AKQsbF3wcgAP00MZrZ6X0yc5v5TRXgTi/jtVwef5I6Y+J7kyb+d1eB6K 4LoOLphBW/8PdNW9dapKWXwAAAAASUVORK5CYII= Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at coe.ufrj.br Cc: kamal kc , freebsd , Giorgos Keramidas 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 12:45:47 -0000 Peter Jeremy wrote: >>what would be the best possible way to >>allocate/deallocate 14KB memory per packet without >>causing vm_faults ?? > > The most efficient way would be to statically allocate the dictionary > and string tables. The downside is that you then need to serialise > the [de]compression. I would suggest static allocation, also. I agree that malloc should not misbehave, but static allocation will surely be faster. And, if you have more than one CPU, you could allocate one static buffer per CPU to allow for parallelization. If you don't have more than one CPU, I think serialization will do no big harm.