Re: [lc-devel] Compressing a page using WKdm
Status: Beta
Brought to you by:
nitin_sf
From: Anderson B. <bri...@gm...> - 2006-06-09 19:17:42
|
On 6/9/06, Nitin Gupta <nit...@gm...> wrote: > On 6/9/06, Anderson Briglia <bri...@gm...> wrote: > > > > I have been trying to compress a page using that WKdm code from > > > > project's CVS. But, something is wrong because the system hangs after > > > > some compression/decompression pages. I'm using this interface: > > > > > > > > to compress "original_page": > > > > > > > > int len; > > > > len = WKdm_compress(page_address(original_page), page_address(comp_page), 1024); > > > > memcpy(page_address(original_page), page_address(comp_page), len); > > > > > > > > to decompress: > > > > > > > > WKdm_decompress(page_address(original_page), page_address(decomp_page), 1024); > > > > memcpy(page_address(original_page), page_address(decomp_page), PAGE_SIZE); > > > > > > > > Is needed to do some padding? I saw at compress_test module that the > > > > comp_data is filled with 0's after the compression. Is it necessary? > > > > > > Yes, WKdm only works when input is exactly 1024 words. > > > > So, I guess I must do a loop if I want to compress one page-full of > > data, right? A loop of four iteractions, of course. > > > > No, I meant 1024 words==PAGE_SIZE (4K bytes). WKdm needs input of 4K > bytes to work so you can compress a page with a single call. Oh, ok! I'm not very familiarized with compression algorithms. :) > > > > Are you compressing pages with less than page-full of data and still without > > > padding? > > > > I'm compressing pages came from the shrink_list( ). I believe those > > pages have PAGE_SIZE of data. > > > > Are you just compressing and discarding pages as they come in > shrink_list() or have you developed any compression structure to store > pages and then later restore them when lookup is performed? No, I don't have a compression structure, yet. I guess that idea of chunks should work, but if I design some other structure, you will know. Actually I'm testing the pages' compression: after the compression, the page is sent to the swap area and when the page is recovered from swap, it's decompressed. Of course we will not have any benefit doing it, but it's a good exercise to face the "scary MM code", :). I'll use your latest compress_test code. Cheers, Anderson Briglia |