Update of /cvsroot/linuxcompressed/linux/mm/comp_cache
In directory usw-pr-cvs1:/tmp/cvs-serv17200/mm/comp_cache
Modified Files:
free.c main.c swapout.c
Log Message:
Some bug fixes:
- Cached memory accounting fix
Details:
http://sourceforge.net/tracker/index.php?func=detail&aid=553794&group_id=13472&atid=113472
- Remove all comp_cache_skip* functions.
At least temporarily, there were removed because I am not sure what are the
consequences of skipping doing some stuff. For example, skip writing dirty
buffers turns out to be a horrible choice for dbench, which gets a terrible
performance.
- Fixes a potential oops in compressed_pages() to wrong return value from
get_comp_cache_page().
Details:
http://sourceforge.net/tracker/index.php?func=detail&aid=553878&group_id=13472&atid=113472
- Makes compressed cache work correctly if support for page cache is disabled.
Details:
http://sourceforge.net/tracker/index.php?func=detail&aid=553408&group_id=13472&atid=113472
- Fixes a kernel BUG() at vmscan.c:366 (active page on inactive list)
Details:
http://sourceforge.net/tracker/index.php?func=detail&aid=551996&group_id=13472&atid=113472
Index: free.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/free.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** free.c 28 Apr 2002 20:51:35 -0000 1.27
--- free.c 8 May 2002 20:24:38 -0000 1.28
***************
*** 2,6 ****
* linux/mm/comp_cache/free.c
*
! * Time-stamp: <2002-04-02 09:31:32 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/free.c
*
! * Time-stamp: <2002-05-08 16:01:46 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 71,74 ****
--- 71,75 ----
list_del_init(&fragment->mapping_list);
fragment->mapping->nrpages--;
+ atomic_dec(&page_cache_size);
comp_cache_free_space += fragment->compressed_size;
}
Index: main.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/main.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** main.c 28 Apr 2002 20:51:35 -0000 1.34
--- main.c 8 May 2002 20:24:39 -0000 1.35
***************
*** 2,6 ****
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-04-28 16:51:46 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-05-08 16:41:47 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 35,76 ****
int nr_compressed_cache_misses;
- static unsigned int skip_buffer = 0, skip_slab = 0, skip_dicache = 0;
-
extern unsigned long num_physpages;
extern comp_cache_t * get_comp_cache_page(struct page *, unsigned short, comp_cache_fragment_t **, int, unsigned int);
-
- /***
- * Skips a number of dirty buffer writes when we have much memory
- * pressure, since we want the system to put much more pressure on
- * pages from page and swap cache in order to have these kind of pages
- * compressed.
- *
- * TODO: make the number of skips dependent on relative compressed
- * cache size.
- */
- inline int
- comp_cache_skip_buffer_freeing(void)
- {
- return (skip_buffer = ++skip_buffer % 500);
- }
-
- /***
- * Same as above, but skips shrinking slab cache (kmem_cache_reap()).
- */
- inline int
- comp_cache_skip_slab_shrunk(void)
- {
- return (skip_slab = ++skip_slab % 500);
- }
-
- /***
- * Same as above, but skips shrinking dcache and icache.
- */
- inline int
- comp_cache_skip_dicache_shrunk(void)
- {
- return (skip_dicache = ++skip_dicache % 500);
- }
inline int
--- 35,41 ----
Index: swapout.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapout.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** swapout.c 28 Apr 2002 20:51:35 -0000 1.38
--- swapout.c 8 May 2002 20:24:40 -0000 1.39
***************
*** 2,6 ****
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-04-28 17:21:40 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-05-08 16:01:38 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 461,464 ****
--- 461,465 ----
list_add(&fragment->mapping_list, &fragment->mapping->clean_comp_pages);
page->mapping->nrpages++;
+ atomic_inc(&page_cache_size);
add_fragment_to_hash_table(fragment);
***************
*** 480,483 ****
--- 481,486 ----
add_comp_page_to_hash_table(comp_page);
UnlockPage(comp_page->page);
+ comp_page = NULL;
+
if (!dirty)
goto out_unlock;
|