patch-2.1.34 linux/mm/vmscan.c
Next file: linux/net/802/sysctl_net_802.c
Previous file: linux/mm/swap.c
Back to the patch index
Back to the overall index
- Lines: 64
- Date:
Mon Apr 14 09:31:10 1997
- Orig file:
v2.1.33/linux/mm/vmscan.c
- Orig date:
Sun Apr 13 10:18:22 1997
diff -u --recursive --new-file v2.1.33/linux/mm/vmscan.c linux/mm/vmscan.c
@@ -7,7 +7,7 @@
* kswapd added: 7.1.96 sct
* Removed kswapd_ctl limits, and swap out as many pages as needed
* to bring the system back to free_pages_high: 2.4.97, Rik van Riel.
- * Version: $Id: vmscan.c,v 1.21 1997/01/06 06:54:03 davem Exp $
+ * Version: $Id: vmscan.c,v 1.23 1997/04/12 04:31:05 davem Exp $
*/
#include <linux/mm.h>
@@ -103,7 +103,7 @@
if (vma->vm_ops->swapout(vma, address - vma->vm_start + vma->vm_offset, page_table))
kill_proc(pid, SIGBUS, 1);
} else {
- if (page_map->count != 1)
+ if (atomic_read(&page_map->count) != 1)
return 0;
if (!(entry = get_swap_page()))
return 0;
@@ -118,7 +118,7 @@
return 1; /* we slept: the process may not exist any more */
}
if ((entry = find_in_swap_cache(MAP_NR(page)))) {
- if (page_map->count != 1) {
+ if (atomic_read(&page_map->count) != 1) {
set_pte(page_table, pte_mkdirty(pte));
printk("Aiee.. duplicated cached swap-cache entry\n");
return 0;
@@ -369,7 +369,7 @@
int kswapd(void *unused)
{
int i;
- char *revision="$Revision: 1.21 $", *s, *e;
+ char *revision="$Revision: 1.23 $", *s, *e;
current->session = 1;
current->pgrp = 1;
@@ -412,9 +412,9 @@
*/
while(nr_free_pages < min_free_pages)
try_to_free_page(GFP_KERNEL, 0, 1);
- while((nr_free_pages + nr_async_pages) < free_pages_low)
+ while((nr_free_pages + atomic_read(&nr_async_pages)) < free_pages_low)
try_to_free_page(GFP_KERNEL, 0, 1);
- while((nr_free_pages + nr_async_pages) < free_pages_high)
+ while((nr_free_pages + atomic_read(&nr_async_pages)) < free_pages_high)
try_to_free_page(GFP_KERNEL, 0, 0);
}
}
@@ -428,13 +428,13 @@
int want_wakeup = 0;
static int last_wakeup_low = 0;
- if ((nr_free_pages + nr_async_pages) < free_pages_low) {
+ if ((nr_free_pages + atomic_read(&nr_async_pages)) < free_pages_low) {
if (last_wakeup_low)
want_wakeup = jiffies >= next_swap_jiffies;
else
last_wakeup_low = want_wakeup = 1;
}
- else if (((nr_free_pages + nr_async_pages) < free_pages_high) &&
+ else if (((nr_free_pages + atomic_read(&nr_async_pages)) < free_pages_high) &&
jiffies >= next_swap_jiffies) {
last_wakeup_low = 0;
want_wakeup = 1;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov