[lc-checkins] CVS: linux/mm/comp_cache proc.c,1.12,1.13
Status: Beta
Brought to you by:
nitin_sf
|
From: Rodrigo S. de C. <rc...@us...> - 2002-05-30 16:33:22
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache
In directory usw-pr-cvs1:/tmp/cvs-serv6396/mm/comp_cache
Modified Files:
proc.c
Log Message:
Added a new kernel parameter ("compalg=") which selects the initial
compression algorithm.
0 - WKdm (default)
1 - WK4x4
2 - LZO
Index: proc.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/proc.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** proc.c 29 May 2002 21:28:55 -0000 1.12
--- proc.c 30 May 2002 16:33:18 -0000 1.13
***************
*** 2,6 ****
* linux/mm/comp_cache/proc.c
*
! * Time-stamp: <2002-05-29 18:16:35 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/proc.c
*
! * Time-stamp: <2002-05-30 13:21:25 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 30,34 ****
static int algorithm_min = WKDM_IDX;
static int algorithm_max = LZO_IDX;
! static int current_algorithm;
/* data used for compression */
--- 30,34 ----
static int algorithm_min = WKDM_IDX;
static int algorithm_max = LZO_IDX;
! static int current_algorithm = 0;
/* data used for compression */
***************
*** 238,241 ****
--- 238,243 ----
comp_cache_algorithms_init(void)
{
+ int i;
+
/* initialize our data for the `test' compressed_page */
comp_data.compressed_data = compresseddata;
***************
*** 248,256 ****
comp_data.tempLowBitsArray = compressedtempLowBitsArray;
! for (current_algorithm = 0; current_algorithm < NUM_ALGORITHMS; current_algorithm++) {
! memset((void *) &compression_algorithms[current_algorithm], 0, sizeof(stats_summary_t));
! compression_algorithms[current_algorithm].stats.comp_size_min = INF;
! compression_algorithms[current_algorithm].stats.comp_cycles_min = INF;
! compression_algorithms[current_algorithm].stats.decomp_cycles_min = INF;
}
--- 250,258 ----
comp_data.tempLowBitsArray = compressedtempLowBitsArray;
! for (i = 0; i < NUM_ALGORITHMS; i++) {
! memset((void *) &compression_algorithms[i], 0, sizeof(stats_summary_t));
! compression_algorithms[i].stats.comp_size_min = INF;
! compression_algorithms[i].stats.comp_cycles_min = INF;
! compression_algorithms[i].stats.decomp_cycles_min = INF;
}
***************
*** 270,275 ****
if (!wrkmem)
panic("comp_cache_algorithms_init(): cannot allocate wrkmem (for LZO)");
!
! current_algorithm = WKDM_IDX;
}
--- 272,280 ----
if (!wrkmem)
panic("comp_cache_algorithms_init(): cannot allocate wrkmem (for LZO)");
!
! if (!current_algorithm || current_algorithm < algorithm_min || current_algorithm > algorithm_max)
! current_algorithm = WKDM_IDX;
!
! printk("Compressed Cache: initial compression algorithm: %s\n", compression_algorithms[current_algorithm].name);
}
***************
*** 432,435 ****
--- 437,451 ----
return proc_calc_metrics(page, start, off, count, eof, length);
}
+
+ static int __init comp_cache_alg(char *str)
+ {
+ char * endp;
+
+ current_algorithm = simple_strtoul(str, &endp, 0);
+ return 1;
+ }
+
+ __setup("compalg=", comp_cache_alg);
+
/*
|