summaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-03-07 15:45:24 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-03-07 15:45:24 +0000
commit9f9f3e6e8548a596697778337110a423c384b6f3 (patch)
tree5dd4b290ef532cf5ecb058e1a92cd3435afeac8c /mm/vmscan.c
parentd5c9a365ee7d2fded249aa5abfc5e89587583029 (diff)
Merge with Linux 2.3.49.
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index fa687b7e0..603b9a2e0 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -326,6 +326,7 @@ static int swap_out(unsigned int priority, int gfp_mask)
struct task_struct * p;
int counter;
int __ret = 0;
+ int assign = 0;
lock_kernel();
/*
@@ -345,12 +346,9 @@ static int swap_out(unsigned int priority, int gfp_mask)
counter = nr_threads / (priority+1);
if (counter < 1)
counter = 1;
- if (counter > nr_threads)
- counter = nr_threads;
for (; counter >= 0; counter--) {
- int assign = 0;
- int max_cnt = 0;
+ unsigned long max_cnt = 0;
struct mm_struct *best = NULL;
int pid = 0;
select:
@@ -363,7 +361,7 @@ static int swap_out(unsigned int priority, int gfp_mask)
if (mm->rss <= 0)
continue;
/* Refresh swap_cnt? */
- if (assign)
+ if (assign == 1)
mm->swap_cnt = mm->rss;
if (mm->swap_cnt > max_cnt) {
max_cnt = mm->swap_cnt;
@@ -372,6 +370,8 @@ static int swap_out(unsigned int priority, int gfp_mask)
}
}
read_unlock(&tasklist_lock);
+ if (assign == 1)
+ assign = 2;
if (!best) {
if (!assign) {
assign = 1;