tech-embed archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: netbsd version of compressed caching



Hi!

Selcuk AYA wrote:

> Hi,
> I found about the compressed caching project on the netbsd projects
> page.  The page shows tech-embed mailing list as the mailing list to
> contact. I have no NETBSD experience but I have been poking around the
> code to get an understanding of uvm interfaces and pseudo drivers and
> I think I can get the job done. I have also looked at the Linux
> implementation of compressed caching. I belive there are three ways to
> implement compressed caching in NETBSD:
> 
> a) as a pseudo device inside the kernel. This pesuodo device would be
> used as a swap partition. Behind the scenes, it would compress pages
> which need to be swapped out and store them in memory.
> b) similar to a) but this would be a pseudo driver implemented as an
> loadable kernel module.
> 
> For these two options, I found out that md.c (ram disk driver) in the
> kernel serves as a good starting point to write the pseudo driver.
> 
> c)Inside the kernel, swap pager would need to be made aware of
> compressed caching. I imagine swap pager keeps a map to keep track of
> where swapped out pages are on the swap device. Some of these entries
> would point to in memory compressed pages.
> 
> For all these options, compressed caching will have to manage its own
> memory and keep track of variable sized chunks (I do not have a
> detailed idea about this yet). I would prefer to go with options a) or
> b) as I do not see a an advantage of making the swap pager aware of
> compressed caching. Would an lkm be OK for an embedded system?

In NetBSD current, most of the subsystem can be (and should be able to be) used 
as
kernel modules too, so being a module is not really a question anymore. :-)

On the other part, I'm wondering if you could implement a device/file system
independent transparent compression mechanism inside the kernel, so
one could also use a compressed ramdisk drive or regular file system.
A bit like we have cgd for cryptography. This would be a pretty interesting 
feature.

> Being new to the open source world, I am worried about the licensing
> issues. Linux compressed caching uses LZO algorithm for compression.
> LZO is released under GPL so I guess we cannot use it in NETBSD. But
> there are are other alternatives which do not bear the sign of GPL
> (http://www.cs.utexas.edu/users/oops/compressed-caching/index.html) .
> If I use a non GPL licenced compress/decompress algorithm and
> re-implement compressed caching as above for NETBSD, do I avoid
> licencing issues?

Yes, we avoid GPL in the kernel itself. Maybe you can make it able to use
different compression algorithms too? :-)

You should CC to tech-kern%netbsd.org@localhost too to get more attention.

--
When in doubt, use brute force.

Adam Hoka <ahoka%NetBSD.org@localhost>
Adam Hoka <ahoka%MirBSD.de@localhost>
Adam Hoka <adam.hoka%gmail.com@localhost>

Attachment: pgpnGyvsS9YxT.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index