[lc-checkins] CVS: linux/mm/comp_cache adaptivity.c,1.43,1.44 aux.c,1.45,1.46 swapout.c,1.74,1.75 vs
Status: Beta
Brought to you by:
nitin_sf
From: Rodrigo S. de C. <rc...@us...> - 2002-11-29 21:23:05
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache In directory sc8-pr-cvs1:/tmp/cvs-serv31487/mm/comp_cache Modified Files: adaptivity.c aux.c swapout.c vswap.c Log Message: Cleanups o New ifdefs to avoid compiling code for clean page adaptability when it is disabled. o Some whitespace changes to make the patch a little shorter. o Removed variable not used in swapout.c Bug fixes o Fixed a bug in comp_cache_fix_watermarks() introduce lately. This bug would set the watermark to a huge number (due to negative values), what would end up in a huge increase in the memory pressure. Fortunately, that is only noticeable when the system has a low amount of memory. o vswap_num_reserved_entries variable was used without being initialized. Depending on the scenario, it could have bogus value which would screw up compressed cache behaviour. o The total free space hash was set in function of the free_space_interval. A potential bug if the total_free_space_interval is set to a value different from the one in free_space_interval. o If the compressed cache cannot allocate the minimum number of pages in the boot process, the shrinkage code could end up annihilate compressed cache because it assumes the compressed cache will always have the number of pages equal or greater than the minimum size. Index: adaptivity.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/adaptivity.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -r1.43 -r1.44 *** adaptivity.c 26 Nov 2002 21:52:55 -0000 1.43 --- adaptivity.c 29 Nov 2002 21:23:03 -0000 1.44 *************** *** 2,6 **** * linux/mm/comp_cache/adaptivity.c * ! * Time-stamp: <2002-11-26 19:46:51 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * linux/mm/comp_cache/adaptivity.c * ! * Time-stamp: <2002-11-29 12:05:01 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 545,549 **** { /* don't shrink a comp cache that has reached the min size */ ! if (num_comp_pages == min_num_comp_pages) { UnlockPage(comp_page->page); return 0; --- 545,549 ---- { /* don't shrink a comp cache that has reached the min size */ ! if (num_comp_pages <= min_num_comp_pages) { UnlockPage(comp_page->page); return 0; *************** *** 674,678 **** fail = 0; while (1) { ! fragment = list_entry(fragment_lh, struct comp_cache_fragment, list); if (fragment_count(fragment) != 1) { fail = 1; --- 674,678 ---- fail = 0; while (1) { ! fragment = list_entry(fragment_lh, struct comp_cache_fragment, list); if (fragment_count(fragment) != 1) { fail = 1; Index: aux.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/aux.c,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -r1.45 -r1.46 *** aux.c 26 Nov 2002 21:42:32 -0000 1.45 --- aux.c 29 Nov 2002 21:23:03 -0000 1.46 *************** *** 2,6 **** * linux/mm/comp_cache/aux.c * ! * Time-stamp: <2002-11-26 19:34:59 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * linux/mm/comp_cache/aux.c * ! * Time-stamp: <2002-11-29 09:31:39 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 613,617 **** /* inits comp cache total free space hash table */ total_free_space_interval = 100 * (COMP_PAGE_ORDER + 1); ! total_free_space_hash_size = (int) (COMP_PAGE_SIZE/free_space_interval) + 2; total_free_space_hash = (struct comp_cache_page **) kmalloc(total_free_space_hash_size * sizeof(struct comp_cache_page *), GFP_ATOMIC); --- 613,617 ---- /* inits comp cache total free space hash table */ total_free_space_interval = 100 * (COMP_PAGE_ORDER + 1); ! total_free_space_hash_size = (int) (COMP_PAGE_SIZE/total_free_space_interval) + 2; total_free_space_hash = (struct comp_cache_page **) kmalloc(total_free_space_hash_size * sizeof(struct comp_cache_page *), GFP_ATOMIC); Index: swapout.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapout.c,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -r1.74 -r1.75 *** swapout.c 26 Nov 2002 21:42:32 -0000 1.74 --- swapout.c 29 Nov 2002 21:23:03 -0000 1.75 *************** *** 2,6 **** * /mm/comp_cache/swapout.c * ! * Time-stamp: <2002-11-26 19:33:23 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * /mm/comp_cache/swapout.c * ! * Time-stamp: <2002-11-29 18:09:53 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 499,503 **** struct comp_cache_page * comp_page = NULL, ** hash_table; struct comp_cache_fragment * fragment = NULL; - struct page * new_page; unsigned short aux_comp_size; int maxscan, maxtry; --- 499,502 ---- Index: vswap.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/vswap.c,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -r1.45 -r1.46 *** vswap.c 28 Jul 2002 15:47:04 -0000 1.45 --- vswap.c 29 Nov 2002 21:23:03 -0000 1.46 *************** *** 2,6 **** * linux/mm/comp_cache/vswap.c * ! * Time-stamp: <2002-07-27 11:15:46 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * linux/mm/comp_cache/vswap.c * ! * Time-stamp: <2002-11-29 12:05:38 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 80,83 **** --- 80,84 ---- vswap_last_used = NUM_VSWAP_ENTRIES - 1; vswap_num_used_entries = 0; + vswap_num_reserved_entries = 0; vswap_num_swap_cache = 0; |