Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Nov 2005 12:08:12 +0200
From:      Ivo Vachkov <ivo.vachkov@gmail.com>
To:        kamal kc <kamal_ckk@yahoo.com>, freebsd-net@freebsd.org
Subject:   Re: allocating 14KB memory per packet compression/decompression results in vm_fault
Message-ID:  <f85d6aa70511040208w6659500di@mail.gmail.com>
In-Reply-To: <20051104065630.9592.qmail@web35704.mail.mud.yahoo.com>
References:  <20051103145729.GA2088@flame.pc> <20051104065630.9592.qmail@web35704.mail.mud.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2005/11/4, kamal kc <kamal_ckk@yahoo.com>:
>
> > > 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f85d6aa70511040208w6659500di>