[lc-checkins] CVS: linux/mm/comp_cache adaptivity.c,1.35,1.36 aux.c,1.37,1.38 free.c,1.35,1.36 main.
Status: Beta
Brought to you by:
nitin_sf
|
From: Rodrigo S. de C. <rc...@us...> - 2002-07-16 18:41:58
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache
In directory usw-pr-cvs1:/tmp/cvs-serv28423/mm/comp_cache
Modified Files:
adaptivity.c aux.c free.c main.c proc.c swapin.c swapout.c
vswap.c
Log Message:
Cleanups
o remove support for pages with buffers
o virtual swap code (mainly when freeing an entry or allocating a page to
service a page fault)
Other
o Added help for CONFIG_COMP_DOUBLE_PAGE into Configure.help
Index: adaptivity.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/adaptivity.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** adaptivity.c 15 Jul 2002 20:52:23 -0000 1.35
--- adaptivity.c 16 Jul 2002 18:41:55 -0000 1.36
***************
*** 2,6 ****
* linux/mm/comp_cache/adaptivity.c
*
! * Time-stamp: <2002-07-15 14:42:43 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/adaptivity.c
*
! * Time-stamp: <2002-07-16 14:03:17 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 153,171 ****
for (index = vswap_last_used; index >= vswap_new_num_entries; index--) {
! /* either this entry has already been freed or hasn't
! * been sucessfully allocated */
! if (!vswap_address[index])
continue;
- /* we are shrinking this vswap table from a function
- * which is freeing a vswap entry, so forget this
- * entry. The same for the case this entry is in the
- * middle of a swapin process (allocating a new
- * page) */
- if (freeing(index) || allocating(index))
- continue;
-
/* unused entry? let's only free it */
! if (!vswap_address[index]->count) {
list_del(&(vswap_address[index]->list));
nr_free_vswap--;
--- 153,165 ----
for (index = vswap_last_used; index >= vswap_new_num_entries; index--) {
! /* this vswap entry has already been freed, has been
! * sucessfully allocated or has any page fault being
! * serviced, so we are unable to move it in the vswap
! * table */
! if (!vswap_address[index] || vswap_address[index]->fault_count)
continue;
/* unused entry? let's only free it */
! if (!vswap_address[index]->swap_count) {
list_del(&(vswap_address[index]->list));
nr_free_vswap--;
***************
*** 207,217 ****
break;
! if (freeing(new_index))
! goto next;
!
! if (!vswap_address[new_index]->count)
break;
- next:
new_index--;
}
--- 201,207 ----
break;
! if (!vswap_address[new_index]->swap_count)
break;
new_index--;
}
***************
*** 273,279 ****
continue;
! if (!vswap_address[vswap_last_used]->count
! && vswap_last_used >= vswap_new_num_entries
! && !freeing(vswap_last_used))
BUG();
--- 263,268 ----
continue;
! if (!vswap_address[vswap_last_used]->swap_count
! && vswap_last_used >= vswap_new_num_entries)
BUG();
Index: aux.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/aux.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** aux.c 15 Jul 2002 20:52:23 -0000 1.37
--- aux.c 16 Jul 2002 18:41:55 -0000 1.38
***************
*** 2,6 ****
* linux/mm/comp_cache/aux.c
*
! * Time-stamp: <2002-07-15 15:14:01 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/aux.c
*
! * Time-stamp: <2002-07-16 14:53:55 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 210,221 ****
#if 0
if (comp_page->page) {
- if (PageMappedCompCache(comp_page->page)) {
- if (index != 0 && index != free_space_hash_size - 1)
- BUG();
- if (!comp_page->page->mapping)
- BUG();
- if (page_count(comp_page->page) != 2)
- BUG();
- }
if (!comp_page->page->buffers && page_count(comp_page->page) != 1)
BUG();
--- 210,213 ----
***************
*** 234,244 ****
{
case 0:
- if (!comp_page->page)
- num_fragments[7]++;
num_fragments[0]++;
break;
case 1:
- if (comp_page->page && PageMappedCompCache(comp_page->page))
- num_fragments[6]++;
num_fragments[1]++;
break;
--- 226,232 ----
Index: free.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/free.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** free.c 15 Jul 2002 20:52:23 -0000 1.35
--- free.c 16 Jul 2002 18:41:55 -0000 1.36
***************
*** 2,6 ****
* linux/mm/comp_cache/free.c
*
! * Time-stamp: <2002-07-15 14:56:06 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/free.c
*
! * Time-stamp: <2002-07-16 14:31:04 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 309,323 ****
goto backout;
/* remove all those ptes from vswap struct */
num_freed_ptes = free_pte_list(vswap->pte_list, vswap->offset);
- vswap->count -= num_freed_ptes;
! /* let's proceed to fix swap counter for the new entry */
! for(; num_freed_ptes > 0; num_freed_ptes--)
swap_duplicate(entry);
!
! remove_fragment_vswap(fragment);
! remove_fragment_from_hash_table(fragment);
!
/* let's fix swap cache page address (if any) */
if (vswap->swap_cache_page) {
--- 309,324 ----
goto backout;
+ remove_fragment_vswap(fragment);
+ remove_fragment_from_hash_table(fragment);
+
/* remove all those ptes from vswap struct */
num_freed_ptes = free_pte_list(vswap->pte_list, vswap->offset);
! /* let's proceed to fix swap counter for either entries */
! for(; num_freed_ptes > 0; --num_freed_ptes) {
! comp_cache_swp_free(old_entry);
swap_duplicate(entry);
! }
!
/* let's fix swap cache page address (if any) */
if (vswap->swap_cache_page) {
***************
*** 328,332 ****
page_cache_get(swap_cache_page);
- vswap->count++;
delete_from_swap_cache(swap_cache_page);
--- 329,332 ----
***************
*** 334,356 ****
BUG();
- vswap->count--;
page_cache_release(swap_cache_page);
UnlockPage(swap_cache_page);
}
! if (vswap->count)
! BUG();
!
! vswap->count = 1;
!
! if (comp_cache_swp_free(old_entry))
BUG();
fragment->index = entry.val;
add_fragment_to_lru_queue(fragment);
-
add_fragment_to_hash_table(fragment);
UnlockPage(fragment->comp_page->page);
-
return 1;
--- 334,349 ----
BUG();
page_cache_release(swap_cache_page);
UnlockPage(swap_cache_page);
}
! if (vswap->swap_count)
BUG();
fragment->index = entry.val;
+
add_fragment_to_lru_queue(fragment);
add_fragment_to_hash_table(fragment);
UnlockPage(fragment->comp_page->page);
return 1;
Index: main.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/main.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -r1.54 -r1.55
*** main.c 15 Jul 2002 20:52:24 -0000 1.54
--- main.c 16 Jul 2002 18:41:55 -0000 1.55
***************
*** 2,6 ****
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-07-15 13:45:54 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-07-16 14:55:38 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 71,77 ****
}
- if (PageMappedCompCache(page))
- BUG();
-
if (page->buffers)
BUG();
--- 71,74 ----
***************
*** 89,96 ****
compress_clean_page(struct page * page, unsigned int gfp_mask, int priority)
{
- /* that should not happen */
- if (PageMappedCompCache(page))
- BUG();
-
if (page->buffers)
BUG();
--- 86,89 ----
***************
*** 170,294 ****
return 1;
}
-
- #ifdef CONFIG_COMP_PAGE_CACHE
- void
- steal_page_from_comp_cache(struct page * page, struct page * new_page)
- {
- struct comp_cache_fragment * fragment;
- struct comp_cache_page * comp_page;
- struct page * old_page;
- int locked;
-
- if (!PageMappedCompCache(page))
- return;
-
- if (find_comp_page(page->mapping, page->index, &fragment))
- BUG();
-
- if (CompFragmentIO(fragment))
- BUG();
- comp_page = fragment->comp_page;
- old_page = comp_page->page;
-
- if (old_page != page)
- BUG();
- locked = !TryLockPage(old_page);
-
- set_comp_page(comp_page, new_page);
-
- if (new_page) {
- /* the reference got in the caller will be drop */
- page_cache_get(new_page);
- if (page_count(new_page) != 3)
- BUG();
- }
-
- #if 0
- if (page != new_page)
- lru_cache_add(page);
- #endif
-
- comp_cache_free(fragment);
- PageClearMappedCompCache(old_page);
-
- if (locked)
- UnlockPage(old_page);
- }
-
- #ifndef CONFIG_COMP_DEMAND_RESIZE
- int
- comp_cache_try_to_release_page(struct page ** page, int gfp_mask, int priority)
- {
- struct comp_cache_fragment * fragment;
- struct comp_cache_page * comp_page;
- unsigned short comp_size;
- struct page * old_page;
- int ret = 0;
-
- if (PageCompCache(*page))
- BUG();
-
- /* if mapped comp cache pages aren't removed from LRU queues,
- * then here we should return 1, otherwise BUG() */
- if (PageMappedCompCache(*page))
- return 1;
-
- if (page_count(*page) != 3)
- return try_to_release_page(*page, gfp_mask);
-
- if (PageSwapCache(*page)) {
- swp_entry_t entry = (swp_entry_t) { (*page)->index };
-
- if (vswap_address(entry))
- BUG();
- }
-
- /* could we free the buffer without IO, so why store in
- * compressed cache with the buffers? it can be ocasionally
- * stored later as a clean page */
- if (try_to_release_page(*page, 0))
- return 1;
-
- /* it's not mapped by any process, therefore we can trade this
- * page with a page reserved for compressed cache use */
- comp_size = PAGE_SIZE;
- comp_page = get_comp_cache_page(*page, comp_size, &fragment, 0, gfp_mask, priority);
-
- if (!comp_page)
- return ret;
-
- /* let's swap the pages */
- old_page = comp_page->page;
- set_comp_page(comp_page, (*page));
-
- PageSetMappedCompCache(comp_page->page);
-
- /* whoops, no page to set to (*page), so it's time to leave */
- if (!old_page)
- goto out;
-
- /* no need to call page_cache_get() since we have an extra
- * reference got in shrink_cache() that won't be released
- * (recall that we are setting *page to a new page) */
- *page = old_page;
- if (page_count(old_page) != 1)
- BUG();
- if (old_page->mapping)
- BUG();
- if (!PageLocked(old_page))
- BUG();
-
- UnlockPage(comp_page->page);
- page_cache_release(comp_page->page);
- ret = 1;
- out:
- #if 0
- lru_cache_del(comp_page->page);
- #endif
- comp_cache_update_page_stats(comp_page->page, 0);
- return ret;
- }
- #endif
- #endif
extern void __init comp_cache_hash_init(void);
--- 163,166 ----
Index: proc.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/proc.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** proc.c 15 Jul 2002 20:52:24 -0000 1.19
--- proc.c 16 Jul 2002 18:41:55 -0000 1.20
***************
*** 2,6 ****
* linux/mm/comp_cache/proc.c
*
! * Time-stamp: <2002-07-15 15:13:14 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/proc.c
*
! * Time-stamp: <2002-07-16 14:55:14 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 398,403 ****
#define HIST_PRINTK \
num_fragments[0], num_fragments[1], num_fragments[2], num_fragments[3], \
! num_fragments[4], num_fragments[5], num_fragments[6], num_fragments[7]
! #define HIST_COUNT 8
int
--- 398,403 ----
#define HIST_PRINTK \
num_fragments[0], num_fragments[1], num_fragments[2], num_fragments[3], \
! num_fragments[4], num_fragments[5]
! #define HIST_COUNT 6
int
***************
*** 416,420 ****
length = sprintf(page,
"compressed cache - free space histogram (free space x number of fragments)\n"
! " total 0f 1f 2f 3f 4f more buffers nopg\n");
memset((void *) num_fragments, 0, HIST_COUNT * sizeof(unsigned long));
--- 416,420 ----
length = sprintf(page,
"compressed cache - free space histogram (free space x number of fragments)\n"
! " total 0f 1f 2f 3f 4f more\n");
memset((void *) num_fragments, 0, HIST_COUNT * sizeof(unsigned long));
***************
*** 422,426 ****
total1 = free_space_count(0, num_fragments);
length += sprintf(page + length,
! " %4d: %7lu %5lu %5lu %5lu %5lu %5lu %5lu %5lu %5lu\n",
0,
total1,
--- 422,426 ----
total1 = free_space_count(0, num_fragments);
length += sprintf(page + length,
! " %4d: %7lu %5lu %5lu %5lu %5lu %5lu %5lu\n",
0,
total1,
***************
*** 435,439 ****
length += sprintf(page + length,
! "%4d - %4d: %7lu %5lu %5lu %5lu %5lu %5lu %5lu %5lu %5lu\n",
(i-1)*free_space_interval+1, (i+1)*free_space_interval<COMP_PAGE_SIZE?(i+1)*free_space_interval:(int)COMP_PAGE_SIZE, total1 + total2,
HIST_PRINTK);
--- 435,439 ----
length += sprintf(page + length,
! "%4d - %4d: %7lu %5lu %5lu %5lu %5lu %5lu %5lu\n",
(i-1)*free_space_interval+1, (i+1)*free_space_interval<COMP_PAGE_SIZE?(i+1)*free_space_interval:(int)COMP_PAGE_SIZE, total1 + total2,
HIST_PRINTK);
Index: swapin.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapin.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -r1.44 -r1.45
*** swapin.c 15 Jul 2002 20:52:24 -0000 1.44
--- swapin.c 16 Jul 2002 18:41:55 -0000 1.45
***************
*** 2,6 ****
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-07-15 14:35:45 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-07-16 14:55:53 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 103,109 ****
if (TryLockPage(fragment->comp_page->page))
BUG();
! if (PageMappedCompCache(fragment->comp_page->page))
! BUG();
!
/* move the fragment to the back of the lru list */
remove_fragment_from_lru_queue(fragment);
--- 103,107 ----
if (TryLockPage(fragment->comp_page->page))
BUG();
!
/* move the fragment to the back of the lru list */
remove_fragment_from_lru_queue(fragment);
***************
*** 143,159 ****
fragment = list_entry(fragment_lh, struct comp_cache_fragment, mapping_list);
! if ((fragment->index >= start) || (partial && (fragment->index + 1) == start)) {
! /***
! * Only valid if we are invalidating entries
! * in compressed cache. We could invalidate in
! * invalidate_inode_pages() each page, but
! * that would make us search comp cache for
! * every page, which is not wanted
! */
! if (PageMappedCompCache(fragment->comp_page->page))
! steal_page_from_comp_cache(fragment->comp_page->page, NULL);
! else
! comp_cache_free(fragment);
! }
}
}
--- 141,146 ----
fragment = list_entry(fragment_lh, struct comp_cache_fragment, mapping_list);
! if ((fragment->index >= start) || (partial && (fragment->index + 1) == start))
! comp_cache_free(fragment);
}
}
***************
*** 207,212 ****
hash = page_hash(mapping, fragment->index);
- if (PageMappedCompCache(fragment->comp_page->page))
- BUG();
if (!CompFragmentTestandClearDirty(fragment))
BUG();
--- 194,197 ----
Index: swapout.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapout.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -r1.59 -r1.60
*** swapout.c 15 Jul 2002 20:52:24 -0000 1.59
--- swapout.c 16 Jul 2002 18:41:55 -0000 1.60
***************
*** 2,6 ****
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-07-15 10:06:15 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-07-16 14:56:05 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 240,281 ****
continue;
- /* page which has/had buffer? */
- if (PageMappedCompCache(page)) {
- list_del(fragment_lh);
- page_cache_get(page);
- CompFragmentSetIO(fragment);
- if (page->buffers && !try_to_release_page(page, gfp_mask)) {
- UnlockPage(page);
- page_cache_release(page);
- CompFragmentClearIO(fragment);
- list_add(fragment_lh, &lru_queue);
- continue;
- }
-
- if (PageSwapCache(page))
- delete_from_swap_cache(page);
- else {
- __remove_inode_page(page);
- page_cache_release(page);
- }
- PageClearMappedCompCache(page);
- page->flags &= ~((1 << PG_uptodate) | (1 << PG_referenced));
-
- if (CompFragmentTestandClearIO(fragment))
- comp_cache_free_locked(fragment);
- else
- kmem_cache_free(fragment_cachep, (fragment));
- UnlockPage(page);
-
- if (page_count(page) != 1)
- BUG();
- if (PageDirty(page))
- BUG();
-
- if (--nrpages)
- continue;
- break;
- }
-
/* clean page, let's free it */
if (!CompFragmentDirty(fragment)) {
--- 240,243 ----
Index: vswap.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/vswap.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** vswap.c 15 Jul 2002 20:52:24 -0000 1.39
--- vswap.c 16 Jul 2002 18:41:55 -0000 1.40
***************
*** 2,6 ****
* linux/mm/comp_cache/vswap.c
*
! * Time-stamp: <2002-07-15 14:24:03 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/vswap.c
*
! * Time-stamp: <2002-07-16 14:57:52 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 61,110 ****
unsigned long nr_free_vswap = 0, nr_used_vswap = 0;
- /***
- * Lock this vswap entry since it has a new page being allocated. That
- * avoids this entry to be moved either when vswap is shrunk or to
- * gain a new real swap entry. This sort of vswap entry does not have
- * a swap cache page, so this is the field used to set this flag.
- */
- inline void
- set_vswap_allocating(swp_entry_t entry)
- {
- unsigned long offset = SWP_OFFSET(entry);
- struct vswap_address * vswap;
-
- if (!vswap_address(entry))
- return;
- if (offset >= vswap_current_num_entries)
- BUG();
- vswap = vswap_address[offset];
-
- //if (vswap->swap_cache_page)
- //BUG();
-
- vswap->swap_cache_page = VSWAP_ALLOCATING;
- }
-
- /***
- * Clear the allocating flag of this vswap entry.
- */
- inline void
- clear_vswap_allocating(swp_entry_t entry)
- {
- unsigned long offset = SWP_OFFSET(entry);
- struct vswap_address * vswap;
-
- if (!vswap_address(entry))
- return;
- if (offset >= vswap_current_num_entries)
- BUG();
- vswap = vswap_address[offset];
-
- if (vswap->swap_cache_page != VSWAP_ALLOCATING)
- //BUG();
- return;
-
- vswap->swap_cache_page = NULL;
- }
-
static int
comp_cache_vswap_alloc(void)
--- 61,64 ----
***************
*** 258,265 ****
if (vswap_address[offset]->fragment)
BUG();
! if (vswap_address[offset]->count)
BUG();
! vswap_address[offset]->count = 1;
vswap_address[offset]->pte_list = NULL;
vswap_address[offset]->swap_cache_page = NULL;
--- 212,219 ----
if (vswap_address[offset]->fragment)
BUG();
! if (vswap_address[offset]->swap_count)
BUG();
! vswap_address[offset]->swap_count = 1;
vswap_address[offset]->pte_list = NULL;
vswap_address[offset]->swap_cache_page = NULL;
***************
*** 293,302 ****
if (!vswap_address[offset])
BUG();
! if (!vswap_address[offset]->count)
BUG();
if (offset >= vswap_current_num_entries)
goto out;
! vswap_address[offset]->count++;
ret = 1;
out:
--- 247,256 ----
if (!vswap_address[offset])
BUG();
! if (!vswap_address[offset]->swap_count)
BUG();
if (offset >= vswap_current_num_entries)
goto out;
! vswap_address[offset]->swap_count++;
ret = 1;
out:
***************
*** 321,325 ****
{
unsigned long offset = SWP_OFFSET(entry);
! unsigned int count;
struct comp_cache_fragment * fragment;
struct vswap_address * vswap;
--- 275,279 ----
{
unsigned long offset = SWP_OFFSET(entry);
! unsigned int swap_count;
struct comp_cache_fragment * fragment;
struct vswap_address * vswap;
***************
*** 337,347 ****
BUG();
! if (!vswap->count)
BUG();
! count = vswap->count;
! if (--count) {
! vswap->count = count;
! return count;
}
--- 291,301 ----
BUG();
! if (!vswap->swap_count)
BUG();
! swap_count = vswap->swap_count;
! if (--swap_count) {
! vswap->swap_count = swap_count;
! return swap_count;
}
***************
*** 354,358 ****
BUG();
! vswap->count = 0;
vswap->pte_list = NULL;
vswap->swap_cache_page = NULL;
--- 308,312 ----
BUG();
! vswap->swap_count = 0;
vswap->pte_list = NULL;
vswap->swap_cache_page = NULL;
***************
*** 377,391 ****
list_del_init(&(vswap_address[offset]->list));
nr_used_vswap--;
!
! vswap->fragment = VSWAP_FREEING;
! comp_cache_freeable_space += fragment->compressed_size;
!
! comp_cache_free(fragment);
/* add to to the free list */
list_add(&(vswap->list), &vswap_address_free_head);
nr_free_vswap++;
!
! vswap->fragment = NULL;
return 0;
}
--- 331,344 ----
list_del_init(&(vswap_address[offset]->list));
nr_used_vswap--;
! vswap->fragment = NULL;
/* add to to the free list */
list_add(&(vswap->list), &vswap_address_free_head);
nr_free_vswap++;
!
! /* global freeable space */
! comp_cache_freeable_space += fragment->compressed_size;
!
! comp_cache_free(fragment);
return 0;
}
***************
*** 405,412 ****
BUG();
! if (!vswap_address[offset]->count)
BUG();
! return (vswap_address[offset]->count);
}
--- 358,365 ----
BUG();
! if (!vswap_address[offset]->swap_count)
BUG();
! return (vswap_address[offset]->swap_count);
}
***************
*** 441,447 ****
offset = SWP_OFFSET(entry);
! /* if we are freeing this vswap, don't have to worry since it
! * will be handled by comp_cache_swp_free() function */
! if (freeing(offset))
return;
--- 394,398 ----
offset = SWP_OFFSET(entry);
! if (!vswap_address[offset]->swap_count)
return;
***************
*** 490,494 ****
if (!reserved(offset))
BUG();
! if (!vswap_address[offset]->count)
BUG();
--- 441,445 ----
if (!reserved(offset))
BUG();
! if (!vswap_address[offset]->swap_count)
BUG();
***************
*** 762,769 ****
vswap_address[offset]->offset = offset;
! vswap_address[offset]->count = 0;
vswap_address[offset]->pte_list = NULL;
vswap_address[offset]->swap_cache_page = NULL;
vswap_address[offset]->fragment = NULL;
list_add(&(vswap_address[offset]->list), &vswap_address_free_head);
--- 713,721 ----
vswap_address[offset]->offset = offset;
! vswap_address[offset]->swap_count = 0;
vswap_address[offset]->pte_list = NULL;
vswap_address[offset]->swap_cache_page = NULL;
vswap_address[offset]->fragment = NULL;
+ vswap_address[offset]->fault_count = 0;
list_add(&(vswap_address[offset]->list), &vswap_address_free_head);
|