summaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-04 07:40:19 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-04 07:40:19 +0000
commit33263fc5f9ac8e8cb2b22d06af3ce5ac1dd815e4 (patch)
tree2d1b86a40bef0958a68cf1a2eafbeb0667a70543 /mm/vmscan.c
parent216f5f51aa02f8b113aa620ebc14a9631a217a00 (diff)
Merge with Linux 2.3.32.
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 14f5dc444..9a2f60f20 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -20,7 +20,7 @@
#include <linux/highmem.h>
#include <linux/file.h>
-#include <asm/pgtable.h>
+#include <asm/pgalloc.h>
/*
* The swap-out functions return 1 if they successfully
@@ -158,15 +158,15 @@ drop_pte:
if (!(page = prepare_highmem_swapout(page)))
goto out_swap_free;
- vma->vm_mm->rss--;
- set_pte(page_table, swp_entry_to_pte(entry));
- vmlist_access_unlock(vma->vm_mm);
-
- flush_tlb_page(vma, address);
swap_duplicate(entry); /* One for the process, one for the swap cache */
/* This will also lock the page */
add_to_swap_cache(page, entry);
+ /* Put the swap entry into the pte after the page is in swapcache */
+ vma->vm_mm->rss--;
+ set_pte(page_table, swp_entry_to_pte(entry));
+ flush_tlb_page(vma, address);
+ vmlist_access_unlock(vma->vm_mm);
/* OK, do a physical asynchronous write to swap. */
rw_swap_page(WRITE, page, 0);
@@ -505,7 +505,6 @@ int kswapd(void *unused)
allocations (not GFP_HIGHMEM ones). */
if (nr_free_buffer_pages() >= freepages.high)
break;
-
if (!do_try_to_free_pages(GFP_KSWAPD))
break;
run_task_queue(&tq_disk);