Re: [lc-devel] Chunk list issues
Status: Beta
Brought to you by:
nitin_sf
From: Nitin G. <nit...@gm...> - 2006-06-19 22:55:00
|
Hi Mauricio, Mauricio Lin wrote: > Hi all, > > After checking the chunk list in > http://linux-mm.org/CompressedCaching, I have some questions as > follows. > > Did anyone start to implement the chunk list operations? Is there any > progress of it? > No, I haven't yet started compression structure implementation. > Regarding the "struct chunk_head", the field "chunk_list" points to > the related chunks, right? > I mean if a page A in the page cache is replaced by the corresponding > chunk head, the field chunk_list in such chunk_head points to the list > of related chunks of page A, even if some chunks are located in other > physical pages, right? > Yes. A page is compressed and stored in chunks (which can be present in different physical pages). These chunks are linked together using chunk->next. > Where ca I find more info about the purpose of lru field in the struct > chunk_head? > chunk_head->lru has basically same purpose as struct page->lru. When compressed cache become full, we have to free some pages from ccache to the swap disk. The chunk_head->lru field is to have these chunk_heads in LRU order. So, when freeing pages from ccache, take a chunk_head from head of LRU list and free the chunk_head and corres. chunk(s). These freed chunks are then merged with other physically adjacent free chunks (found using chunk->chunks->{prev, next}). A chunk is identified as free by flag (say, CH_free) stored in 4 MSBs of chunk->size (A chunk has max size of PAGE_SIZE so, 4 bits are free). Also, as mentioned on site: LRU Lists will be maintained separately for clean page cache pages, dirty page cache pages and swap cache pages. This will allow pages of these individual types to be separately tracked and when compressed cache size reaches limit, specific types of pages and be freed in priority to other (like put more pressure to free clean page cache pages than dirty page cache pages and least on swap cache pages). Cheers, Nitin Gupta |