allocating 14KB memory per packet compression/decompression results in vm_fault

João Carlos Mendes Luis jonny at jonny.eng.br
Fri Nov 4 04:45:47 PST 2005


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.



More information about the freebsd-hackers mailing list