| Kernel v2.4.14-pre8 /mm/swap.c |
|---|
 2.4.14-pre8
 mm
 swap.c
diff -u --recursive --new-file v2.4.13/linux/mm/swap.c linux/mm/swap.c
--- v2.4.13/linux/mm/swap.c Tue Oct 23 22:48:53 2001
+++ linux/mm/swap.c Mon Oct 29 12:11:17 2001
@@ -27,10 +27,6 @@
/* How many pages do we try to swap or page in/out together? */
int page_cluster;
-/* We track the number of pages currently being asynchronously swapped
- out, so that we don't try to swap TOO many pages out at once */
-atomic_t nr_async_pages = ATOMIC_INIT(0);
-
pager_daemon_t pager_daemon = {
512, /* base number for calculating the number of tries */
SWAP_CLUSTER_MAX, /* minimum number of tries */
@@ -87,11 +83,11 @@
*/
void lru_cache_add(struct page * page)
{
- if (!PageLocked(page))
- BUG();
- spin_lock(&pagemap_lru_lock);
- add_page_to_inactive_list(page);
- spin_unlock(&pagemap_lru_lock);
+ if (!PageActive(page) && !PageInactive(page)) {
+ spin_lock(&pagemap_lru_lock);
+ add_page_to_inactive_list(page);
+ spin_unlock(&pagemap_lru_lock);
+ }
}
/**
@@ -107,9 +103,9 @@
del_page_from_active_list(page);
} else if (PageInactive(page)) {
del_page_from_inactive_list(page);
- } else
- printk("VM: __lru_cache_del, found unknown page ?!\n");
- DEBUG_LRU_PAGE(page);
+ } else {
+// printk("VM: __lru_cache_del, found unknown page ?!\n");
+ }
}
/**
@@ -118,8 +114,6 @@
*/
void lru_cache_del(struct page * page)
{
- if (!PageLocked(page))
- BUG();
spin_lock(&pagemap_lru_lock);
__lru_cache_del(page);
spin_unlock(&pagemap_lru_lock);
|