[lc-checkins] CVS: linux/mm/comp_cache main.c,1.30,1.31 swapin.c,1.26,1.27 swapout.c,1.32,1.33
Status: Beta
Brought to you by:
nitin_sf
|
From: Rodrigo S. de C. <rc...@us...> - 2002-03-01 14:30:56
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache In directory usw-pr-cvs1:/tmp/cvs-serv19251/mm/comp_cache Modified Files: main.c swapin.c swapout.c Log Message: - Fixed a bug that showed up when running dbench. When we dirty a clean page which has a compressed cache fragment, we have to invalidate this fragment, since it won't be the current data present in the memory. - mark_inode_dirty_pages() is called in get_comp_cache_page() to avoid possible memory corruption if an inode is synced when we are sleeping to get an entry in compressed cache. - and, of course, still some cleanups. Index: main.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/main.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** main.c 28 Feb 2002 19:05:05 -0000 1.30 --- main.c 1 Mar 2002 14:30:52 -0000 1.31 *************** *** 2,6 **** * linux/mm/comp_cache/main.c * ! * Time-stamp: <2002-02-28 15:29:05 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * linux/mm/comp_cache/main.c * ! * Time-stamp: <2002-03-01 10:09:19 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 138,145 **** BUG(); invalidate_comp_cache(page->mapping, page->index); ! if (!PageTestandClearCompCache(page)) ! BUG(); ! if (PageDirty(page)) ! BUG(); } --- 138,142 ---- BUG(); invalidate_comp_cache(page->mapping, page->index); ! PageClearCompCache(page); } *************** *** 156,160 **** goto out_failed; ! set_page_dirty(page); ClearPageLaunder(page); goto out_failed; --- 153,157 ---- goto out_failed; ! __set_page_dirty(page); ClearPageLaunder(page); goto out_failed; Index: swapin.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapin.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** swapin.c 28 Feb 2002 19:05:05 -0000 1.26 --- swapin.c 1 Mar 2002 14:30:52 -0000 1.27 *************** *** 2,6 **** * linux/mm/comp_cache/swapin.c * ! * Time-stamp: <2002-02-28 15:11:05 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * linux/mm/comp_cache/swapin.c * ! * Time-stamp: <2002-03-01 10:09:12 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 51,55 **** BUG(); if (CompFragmentTestandClearDirty(fragment)) ! set_page_dirty(page); } --- 51,55 ---- BUG(); if (CompFragmentTestandClearDirty(fragment)) ! __set_page_dirty(page); } *************** *** 110,114 **** * not temporary swap buffers, for example */ if (!CompFragmentIO(fragment)) ! set_page_dirty(page); list_del(&fragment->mapping_list); list_add(&fragment->mapping_list, &fragment->mapping->clean_comp_pages); --- 110,114 ---- * not temporary swap buffers, for example */ if (!CompFragmentIO(fragment)) ! __set_page_dirty(page); list_del(&fragment->mapping_list); list_add(&fragment->mapping_list, &fragment->mapping->clean_comp_pages); Index: swapout.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapout.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** swapout.c 28 Feb 2002 19:05:05 -0000 1.32 --- swapout.c 1 Mar 2002 14:30:52 -0000 1.33 *************** *** 2,6 **** * /mm/comp_cache/swapout.c * ! * Time-stamp: <2002-02-28 15:25:52 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * /mm/comp_cache/swapout.c * ! * Time-stamp: <2002-03-01 10:45:51 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 410,413 **** --- 410,418 ---- CompFragmentSetDirty(fragment); list_add(&fragment->mapping_list, &fragment->mapping->dirty_comp_pages); + + /* mark the inode as having dirty pages since the inode might + * have been synced in the meanwhile (if we slept) */ + if (page->mapping->host) + mark_inode_dirty_pages(page->mapping->host); } else |