[lc-checkins] CVS: linux/mm/comp_cache adaptivity.c,1.23,1.24 vswap.c,1.32,1.33
Status: Beta
Brought to you by:
nitin_sf
From: Rodrigo S. de C. <rc...@us...> - 2002-06-18 18:04:36
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache In directory usw-pr-cvs1:/tmp/cvs-serv25032/mm/comp_cache Modified Files: adaptivity.c vswap.c Log Message: Bug fixes: o Fixed bug in shrink_comp_cache() which would release a NULL page o "Fixed" potential bug when unable to allocate page for ptes (vswap) by pre-allocating one page when initializing compressed cache o Fixed bug which would cause an oops when fixing memory watermarks. All zone_balance_* arrays were defined as __initdata, so they could be accessed by our function after being deallocated. The fix simply removes the __initdata option from their declaration when compressed cache is enabled. Other: o cleanups in adaptivity.c Index: adaptivity.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/adaptivity.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** adaptivity.c 18 Jun 2002 12:47:21 -0000 1.23 --- adaptivity.c 18 Jun 2002 18:04:31 -0000 1.24 *************** *** 2,6 **** * linux/mm/comp_cache/adaptivity.c * ! * Time-stamp: <2002-06-17 17:42:23 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * linux/mm/comp_cache/adaptivity.c * ! * Time-stamp: <2002-06-18 13:28:03 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 203,208 **** free_pages((unsigned long) fragment_hash, fragment_hash_order); ! ! //printk("FRAGMENT HASH TABLE - resized from %lu to %lu\n", fragment_hash_size, new_fragment_hash_size); fragment_hash = new_fragment_hash; fragment_hash_size = new_fragment_hash_size; --- 203,210 ---- free_pages((unsigned long) fragment_hash, fragment_hash_order); ! ! #if 0 ! printk("FRAGMENT HASH TABLE - resized from %lu to %lu\n", fragment_hash_size, new_fragment_hash_size); ! #endif fragment_hash = new_fragment_hash; fragment_hash_size = new_fragment_hash_size; *************** *** 417,422 **** vfree(vswap_address); vswap_address = new_vswap_address; ! ! //printk("VSWAP - resized from %ld to %ld (copied until %d)\n", vswap_current_num_entries, vswap_new_num_entries, vswap_last_used); vswap_current_num_entries = vswap_new_num_entries; vswap_last_used = vswap_new_num_entries - 1; --- 419,426 ---- vfree(vswap_address); vswap_address = new_vswap_address; ! ! #if 0 ! printk("VSWAP - resized from %ld to %ld (copied until %d)\n", vswap_current_num_entries, vswap_new_num_entries, vswap_last_used); ! #endif vswap_current_num_entries = vswap_new_num_entries; vswap_last_used = vswap_new_num_entries - 1; *************** *** 572,579 **** remove_comp_page_from_hash_table(empty_comp_page); UnlockPage(empty_comp_page->page); set_comp_page(empty_comp_page, NULL); - - page_cache_release(empty_comp_page->page); kmem_cache_free(comp_cachep, (empty_comp_page)); num_comp_pages--; --- 576,582 ---- remove_comp_page_from_hash_table(empty_comp_page); UnlockPage(empty_comp_page->page); + page_cache_release(empty_comp_page->page); set_comp_page(empty_comp_page, NULL); kmem_cache_free(comp_cachep, (empty_comp_page)); num_comp_pages--; *************** *** 605,609 **** empty_comp_page = search_comp_page_free_space(PAGE_SIZE); ! if (!empty_comp_page) return retval; --- 608,612 ---- empty_comp_page = search_comp_page_free_space(PAGE_SIZE); ! if (!empty_comp_page || !empty_comp_page->page) return retval; Index: vswap.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/vswap.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** vswap.c 18 Jun 2002 13:04:11 -0000 1.32 --- vswap.c 18 Jun 2002 18:04:32 -0000 1.33 *************** *** 2,6 **** * linux/mm/comp_cache/vswap.c * ! * Time-stamp: <2002-06-18 09:51:31 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * linux/mm/comp_cache/vswap.c * ! * Time-stamp: <2002-06-18 14:56:27 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 576,580 **** unsigned long offset; struct pte_list * pte_list; ! if (!vswap_address(entry)) return; --- 576,580 ---- unsigned long offset; struct pte_list * pte_list; ! if (!vswap_address(entry)) return; *************** *** 692,695 **** --- 692,700 ---- for (i = 0; i < NUM_MEAN_PAGES; i++) last_page_size[i] = PAGE_SIZE/2; + + /* alloc only one page right now to avoid problems when + * starting using virtual swap address (usually under high + * memory pressure) */ + alloc_new_pte_lists(); } |