[lc-checkins] CVS: linux/mm/comp_cache aux.c,1.5,1.6 free.c,1.7,1.8 main.c,1.6,1.7 swapin.c,1.7,1.8
Status: Beta
Brought to you by:
nitin_sf
|
From: Rodrigo S. de C. <rc...@us...> - 2001-12-12 20:45:50
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache
In directory usw-pr-cvs1:/tmp/cvs-serv17791/mm/comp_cache
Modified Files:
aux.c free.c main.c swapin.c swapout.c vswap.c
Log Message:
- 0.20pre2 version updated from 2.4.10 to 2.4.16.
- Code was rewritten in swapfile.c to work with the new swap file functions
(swap_free, swap_duplicate, swap_info_get, swap_info_put, etc).
Index: aux.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/aux.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** aux.c 2001/10/01 22:43:59 1.5
--- aux.c 2001/12/12 20:45:46 1.6
***************
*** 2,6 ****
* linux/mm/comp_cache/aux.c
*
! * Time-stamp: <2001-10-01 18:04:25 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/aux.c
*
! * Time-stamp: <2001-12-11 12:58:43 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 244,248 ****
BUG();
! if (virtual_swap_address(entry))
freeable -= fragment->compressed_size;
--- 244,248 ----
BUG();
! if (vswap_address(entry))
freeable -= fragment->compressed_size;
Index: free.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/free.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** free.c 2001/10/08 14:56:35 1.7
--- free.c 2001/12/12 20:45:46 1.8
***************
*** 2,6 ****
* linux/mm/comp_cache/free.c
*
! * Time-stamp: <2001-10-06 17:07:23 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/free.c
*
! * Time-stamp: <2001-12-12 15:38:59 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 152,156 ****
comp_page->number_of_pages--;
! if (virtual_swap_address((swp_entry_t) { fragment_to_free->index }))
vswap_add_freeable(comp_page, fragment_to_free);
--- 152,156 ----
comp_page->number_of_pages--;
! if (vswap_address((swp_entry_t) { fragment_to_free->index }))
vswap_add_freeable(comp_page, fragment_to_free);
***************
*** 213,216 ****
--- 213,217 ----
assign_address:
+
/* no virtual swap entry with a compressed page */
if (list_empty(&vswap_address_used_head))
***************
*** 306,310 ****
comp_cache_swp_free_generic(old_entry, 0);
! swap_duplicate(entry);
add_to_swap_cache(swap_cache_page, entry);
--- 307,311 ----
comp_cache_swp_free_generic(old_entry, 0);
! //swap_duplicate(entry);
add_to_swap_cache(swap_cache_page, entry);
***************
*** 336,341 ****
BUG();
! if (vswap->count)
BUG();
unlock_vswap(old_entry);
--- 337,346 ----
BUG();
! if (vswap->count) {
! swp_entry_t entry = SWP_ENTRY(31,vswap->offset);
!
! printk("entry: %08lx\n", entry.val);
BUG();
+ }
unlock_vswap(old_entry);
Index: main.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/main.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** main.c 2001/10/01 22:43:59 1.6
--- main.c 2001/12/12 20:45:46 1.7
***************
*** 2,6 ****
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2001-10-01 19:11:16 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2001-12-10 16:59:47 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 14,17 ****
--- 14,18 ----
#include <linux/comp_cache.h>
#include <linux/init.h>
+ #include <linux/pagemap.h>
#include <linux/WKcommon.h>
***************
*** 74,78 ****
comp_page = get_comp_cache_page(swap_cache_page, aux_comp_size, &fragment);
!
/* if comp_page == NULL, get_comp_cache_page() gave up
* reserving a swap entry for this page, so we should return
--- 75,79 ----
comp_page = get_comp_cache_page(swap_cache_page, aux_comp_size, &fragment);
!
/* if comp_page == NULL, get_comp_cache_page() gave up
* reserving a swap entry for this page, so we should return
***************
*** 85,89 ****
return 0;
}
!
/* TODO: add more buffers for compression. Only one may cause
* many page to be compressed twice */
--- 86,90 ----
return 0;
}
!
/* TODO: add more buffers for compression. Only one may cause
* many page to be compressed twice */
***************
*** 110,115 ****
out:
! UnlockPage(comp_page->page);
/* since there's no IO activity on this page */
UnlockPage(swap_cache_page);
--- 111,119 ----
out:
! if (!comp_page->page)
! BUG();
+ UnlockPage(comp_page->page);
+
/* since there's no IO activity on this page */
UnlockPage(swap_cache_page);
Index: swapin.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapin.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** swapin.c 2001/09/29 20:30:14 1.7
--- swapin.c 2001/12/12 20:45:46 1.8
***************
*** 2,6 ****
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2001-09-28 19:56:41 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2001-12-12 16:04:48 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 126,133 ****
if (!new_page) {
- /* account for the compressed page which will be
- * hopefully added to swap cache in a near future */
- swap_duplicate(entry);
-
UnlockPage(comp_page->page);
--- 126,129 ----
***************
*** 180,191 ****
out:
/* let's free the page which has been allocated but not used */
! if (new_page) {
page_cache_release(new_page);
- swap_free(entry);
- }
if (comp_page && PageLocked(comp_page->page))
BUG();
!
return page;
}
--- 176,185 ----
out:
/* let's free the page which has been allocated but not used */
! if (new_page)
page_cache_release(new_page);
if (comp_page && PageLocked(comp_page->page))
BUG();
!
return page;
}
***************
*** 232,236 ****
page_cache_release(new_page);
wait_on_page(aux_page);
- swap_free(*entry);
}
--- 226,229 ----
***************
*** 244,252 ****
if (!PageCompCache(comp_page->page))
PAGE_BUG(comp_page->page);
!
if (!new_page) {
- /* account for the swap cache page */
- swap_duplicate(*entry);
-
aux_page = comp_page->page;
UnlockPage(comp_page->page);
--- 237,242 ----
if (!PageCompCache(comp_page->page))
PAGE_BUG(comp_page->page);
!
if (!new_page) {
aux_page = comp_page->page;
UnlockPage(comp_page->page);
***************
*** 291,298 ****
}
! if (new_page) {
page_cache_release(new_page);
- swap_free(*entry);
- }
out:
--- 281,286 ----
}
! if (new_page)
page_cache_release(new_page);
out:
Index: swapout.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapout.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** swapout.c 2001/09/29 20:30:14 1.7
--- swapout.c 2001/12/12 20:45:46 1.8
***************
*** 2,6 ****
* linux/mm/comp_cache/swapout.c
*
! * Time-stamp: <2001-09-28 20:59:25 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/swapout.c
*
! * Time-stamp: <2001-12-11 12:59:11 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 223,227 ****
if (CompFragmentFreed(fragment)) {
! if (virtual_swap_address(entry)) {
comp_page->freeable += fragment->compressed_size;
--- 223,227 ----
if (CompFragmentFreed(fragment)) {
! if (vswap_address(entry)) {
comp_page->freeable += fragment->compressed_size;
***************
*** 237,241 ****
/* does the fragment have a virtual swap address?
* it cannot be swapped out */
! if (virtual_swap_address(entry)) {
if (fragment->offset < first_offset) {
first_offset = fragment->offset;
--- 237,241 ----
/* does the fragment have a virtual swap address?
* it cannot be swapped out */
! if (vswap_address(entry)) {
if (fragment->offset < first_offset) {
first_offset = fragment->offset;
***************
*** 262,266 ****
* lock the page in find_free_swp_buffer */
if (CompFragmentFreed(fragment)) {
! if (virtual_swap_address(entry))
BUG();
--- 262,266 ----
* lock the page in find_free_swp_buffer */
if (CompFragmentFreed(fragment)) {
! if (vswap_address(entry))
BUG();
***************
*** 563,567 ****
last_page = (last_page++)%NUM_MEAN_PAGES;
! if (virtual_swap_address((swp_entry_t) { fragment->index })) {
offset = SWP_OFFSET((swp_entry_t) { fragment->index });
--- 563,567 ----
last_page = (last_page++)%NUM_MEAN_PAGES;
! if (vswap_address((swp_entry_t) { fragment->index })) {
offset = SWP_OFFSET((swp_entry_t) { fragment->index });
Index: vswap.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/vswap.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** vswap.c 2001/10/08 14:56:35 1.8
--- vswap.c 2001/12/12 20:45:46 1.9
***************
*** 2,6 ****
* linux/mm/comp_cache/vswap.c
*
! * Time-stamp: <2001-10-08 11:31:54 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/vswap.c
*
! * Time-stamp: <2001-12-12 16:07:22 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 70,74 ****
unsigned long offset;
! if (!virtual_swap_address(entry))
return;
--- 70,74 ----
unsigned long offset;
! if (!vswap_address(entry))
return;
***************
*** 82,86 ****
unsigned long offset;
! if (!virtual_swap_address(entry))
return;
--- 82,86 ----
unsigned long offset;
! if (!vswap_address(entry))
return;
***************
*** 129,133 ****
entry = SWP_ENTRY(type, offset);
! if (!virtual_swap_address(entry))
BUG();
--- 129,133 ----
entry = SWP_ENTRY(type, offset);
! if (!vswap_address(entry))
BUG();
***************
*** 141,145 ****
unsigned long offset = SWP_OFFSET(entry);
! if (!virtual_swap_address(entry))
BUG();
--- 141,145 ----
unsigned long offset = SWP_OFFSET(entry);
! if (!vswap_address(entry))
BUG();
***************
*** 150,154 ****
}
! void
comp_cache_swp_free_generic(swp_entry_t entry, int free_fragment)
{
--- 150,154 ----
}
! int
comp_cache_swp_free_generic(swp_entry_t entry, int free_fragment)
{
***************
*** 158,162 ****
struct vswap_address * vswap;
! if (!virtual_swap_address(entry))
BUG();
--- 158,162 ----
struct vswap_address * vswap;
! if (!vswap_address(entry))
BUG();
***************
*** 167,171 ****
if (--vswap->count)
! return;
/* do we have a compressed page for this virtual entry? in the
--- 167,171 ----
if (--vswap->count)
! return vswap->count;
/* do we have a compressed page for this virtual entry? in the
***************
*** 218,221 ****
--- 218,223 ----
list_add(&(vswap->list), &vswap_address_free_head);
+
+ return vswap->count;
}
***************
*** 225,229 ****
unsigned long offset = SWP_OFFSET(entry);
! if (!virtual_swap_address(entry))
BUG();
--- 227,231 ----
unsigned long offset = SWP_OFFSET(entry);
! if (!vswap_address(entry))
BUG();
***************
*** 276,280 ****
entry.val = fragment->index;
! if (!virtual_swap_address(entry))
return;
--- 278,282 ----
entry.val = fragment->index;
! if (!vswap_address(entry))
return;
***************
*** 309,313 ****
return;
! if (!virtual_swap_address(pte_to_swp_entry(*ptep)))
return;
--- 311,315 ----
return;
! if (!vswap_address(pte_to_swp_entry(*ptep)))
return;
***************
*** 342,346 ****
unsigned long offset;
! if (!virtual_swap_address(entry))
return;
--- 344,348 ----
unsigned long offset;
! if (!vswap_address(entry))
return;
***************
*** 351,354 ****
--- 353,361 ----
vswap_address[offset]->swap_cache_page = page;
+
+ if (page != lookup_swap_cache(entry))
+ BUG();
+
+ page_cache_release(page);
}
***************
*** 361,365 ****
entry.val = page->index;
! if (!virtual_swap_address(entry))
return;
--- 368,372 ----
entry.val = page->index;
! if (!vswap_address(entry))
return;
***************
*** 377,381 ****
struct pte_list * tmp_pte_list;
! if (!virtual_swap_address(entry))
return;
--- 384,388 ----
struct pte_list * tmp_pte_list;
! if (!vswap_address(entry))
return;
|