Re: [lc-devel] Chunk list issues
Status: Beta
Brought to you by:
nitin_sf
From: Mauricio L. <mau...@gm...> - 2006-06-20 23:23:08
|
Hi Gupta, Regarding the master chunk list (chunks) in the struct chunk, does it store the chunks of one page cache or several page caches? Will be there one master chunk list per page cache radix tree? I also wonder where the chunk list header will be stored. For instance the list header of task_struct is stored in the tasks field of init_task, so when an insertion happens in the list of task_struct, something like that is used: list_add_tail(&p->tasks, &init_task.tasks); where the first argument is the element to be inserted and the second argument corresponds the list header of task_struct. Thus where the list header of chunks will be stored? Any idea? BR, Mauricio Lin. On 6/19/06, Nitin Gupta <nit...@gm...> wrote: > 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 > |