Update of /cvsroot/linuxcompressed/linux/mm/comp_cache
In directory usw-pr-cvs1:/tmp/cvs-serv29963/mm/comp_cache
Modified Files:
aux.c proc.c
Log Message:
Add "Free Space Histogram" section to /proc/comp_cache_stat
Index: aux.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/aux.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** aux.c 21 May 2002 18:49:06 -0000 1.26
--- aux.c 29 May 2002 13:05:25 -0000 1.27
***************
*** 2,6 ****
* linux/mm/comp_cache/aux.c
*
! * Time-stamp: <2002-05-21 12:34:55 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/aux.c
*
! * Time-stamp: <2002-05-28 17:32:52 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 21,25 ****
unsigned int fragment_hash_bits;
! comp_cache_t ** free_space_hash;
unsigned int free_space_hash_size;
unsigned int free_space_interval;
--- 21,25 ----
unsigned int fragment_hash_bits;
! static comp_cache_t ** free_space_hash;
unsigned int free_space_hash_size;
unsigned int free_space_interval;
***************
*** 162,165 ****
--- 162,181 ----
fragment_hash_used--;
+ }
+
+ unsigned long
+ free_space_count(int index) {
+ comp_cache_t * comp_page;
+ unsigned long total;
+
+ if (index < 0)
+ BUG();
+
+ if (index >= free_space_hash_size)
+ BUG();
+
+ for (comp_page = free_space_hash[index], total = 0; comp_page; comp_page = comp_page->next_hash, total++);
+
+ return total;
}
Index: proc.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/proc.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** proc.c 23 May 2002 21:25:33 -0000 1.10
--- proc.c 29 May 2002 13:05:26 -0000 1.11
***************
*** 2,6 ****
* linux/mm/comp_cache/proc.c
*
! * Time-stamp: <2002-05-23 18:00:34 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/proc.c
*
! * Time-stamp: <2002-05-28 17:56:39 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 237,241 ****
print_comp_cache_stats(unsigned short alg_idx, char * page, int * length)
{
! unsigned int compression_ratio, discard_ratio;
unsigned int mean_size, mean_comp_cycles, mean_decomp_cycles;
unsigned long total_comp_pages, total_wout_pages, total_decomp_pages, total_faultin_pages;
--- 237,241 ----
print_comp_cache_stats(unsigned short alg_idx, char * page, int * length)
{
! unsigned int compression_ratio, discard_ratio, i;
unsigned int mean_size, mean_comp_cycles, mean_decomp_cycles;
unsigned long total_comp_pages, total_wout_pages, total_decomp_pages, total_faultin_pages;
***************
*** 314,317 ****
--- 314,335 ----
stats->decomp_cycles_max,
mean_decomp_cycles);
+
+ *length += sprintf(page + *length,
+ "Free Space Histogram\n"
+ " Zero: %8lu\n",
+ free_space_count(0));
+
+ for (i = 1; i < free_space_hash_size - 1; i += 2) {
+ *length += sprintf(page + *length,
+ " %4d - %4d: %8lu\n",
+ (i+1)*100-200?:1, (i+1)*100,
+ free_space_count(i) + free_space_count(i+1));
+ }
+
+ *length += sprintf(page + *length,
+ " Page Size: %8lu\n",
+ free_space_count(free_space_hash_size - 1));
+
+
}
|