[lc-checkins] CVS: linux/include/linux comp_cache.h,1.89,1.90
Status: Beta
Brought to you by:
nitin_sf
From: Rodrigo S. de C. <rc...@us...> - 2002-07-15 20:52:27
|
Update of /cvsroot/linuxcompressed/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv1029/include/linux Modified Files: comp_cache.h Log Message: Feature o Added feature to enable 8K pages (on i386). This option can only be selected if "Resize Compressed Cache On Demand" is enabled since it does not support pages with buffers. The motive to implement this idea is to make better use of the space reserved for compressed cache, since depending on the compression ratio, several fragments end up stored alone in a page. Index: comp_cache.h =================================================================== RCS file: /cvsroot/linuxcompressed/linux/include/linux/comp_cache.h,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -r1.89 -r1.90 *** comp_cache.h 11 Jul 2002 19:08:10 -0000 1.89 --- comp_cache.h 15 Jul 2002 20:52:23 -0000 1.90 *************** *** 2,6 **** * linux/mm/comp_cache.h * ! * Time-stamp: <2002-07-11 15:28:35 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * linux/mm/comp_cache.h * ! * Time-stamp: <2002-07-15 13:44:19 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 29,39 **** #include <linux/WKcommon.h> ! #define COMP_CACHE_VERSION "0.23" /* maximum compressed size of a page */ #define MAX_COMPRESSED_SIZE 4500 - #define NUM_VSWAP_ENTRIES (3 * num_comp_pages) - extern unsigned long num_comp_pages, num_fragments, num_swapper_fragments, new_num_comp_pages, min_num_comp_pages, max_num_comp_pages, zone_num_comp_pages; --- 29,37 ---- #include <linux/WKcommon.h> ! #define COMP_CACHE_VERSION "0.24pre1" /* maximum compressed size of a page */ #define MAX_COMPRESSED_SIZE 4500 extern unsigned long num_comp_pages, num_fragments, num_swapper_fragments, new_num_comp_pages, min_num_comp_pages, max_num_comp_pages, zone_num_comp_pages; *************** *** 353,356 **** --- 351,359 ---- inline int compress_clean_page(struct page *, unsigned int, int); + #define COMP_PAGE_SIZE ((comp_page_order + 1) * PAGE_SIZE) + #define page_to_comp_page(n) ((n) >> comp_page_order) + #define comp_page_to_page(n) ((n) << comp_page_order) + + extern int comp_page_order; extern unsigned long comp_cache_free_space; #define comp_cache_used_space ((num_comp_pages * PAGE_SIZE) - comp_cache_free_space) *************** *** 403,406 **** --- 406,410 ---- extern unsigned short last_page; + #define NUM_VSWAP_ENTRIES (3 * comp_page_to_page(num_comp_pages)) #define COMP_CACHE_SWP_TYPE MAX_SWAPFILES #define VSWAP_RESERVED ((struct comp_cache_fragment *) 0xffffffff) *************** *** 518,521 **** --- 522,527 ---- extern unsigned int fragment_hash_bits; + #define NUM_FRAG_HASH_ENTRIES (3 * comp_page_to_page(num_comp_pages)) + /* hash function adapted from _page_hashfn:pagemap.h since our * parameters for hash table are the same: mapping and index */ *************** *** 569,573 **** unsigned long free_space_count(int, unsigned long *); ! unsigned long fragmentation_count(int, unsigned long *); /* enough memory functions */ --- 575,579 ---- unsigned long free_space_count(int, unsigned long *); ! unsigned long fragmentation_count(int, unsigned long *, int); /* enough memory functions */ |