summaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-07-12 01:43:08 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-07-12 01:43:08 +0000
commitf4ae78d536e6dfaeb24c01b331fc38d950ed062b (patch)
tree6930a78aa7cc4ee1829d50d3bcbaf0dbe9e2e905 /mm/vmscan.c
parent66f20d0f9bd86dc11f3869d78f3c5749789323ee (diff)
Merge with 2.4.0-test4-pre2.
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index be600ec49..f19721ee5 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -440,7 +440,7 @@ static inline int memory_pressure(void)
}
/*
- * Check if there is any memory pressure (free_pages < pages_low)
+ * Check if there recently has been memory pressure (zone_wake_kswapd)
*/
static inline int keep_kswapd_awake(void)
{
@@ -541,16 +541,16 @@ static int do_try_to_free_pages(unsigned int gfp_mask)
if (--swap_count < 0)
break;
- priority--;
- } while (priority >= 0);
+ } while (--priority >= 0);
- /* Always end on a shrink_mmap.. */
+ /* Always end on a shrink_mmap.., may sleep... */
while (shrink_mmap(0, gfp_mask)) {
if (!--count)
goto done;
}
- /* We return 1 if we are freed some page */
- return (count != FREE_COUNT);
+ /* We return 1 if we are freed some page, or
+ * there are no memory pressure remaining */
+ return (count != FREE_COUNT || !memory_pressure());
done:
return 1;
@@ -626,6 +626,7 @@ int try_to_free_pages(unsigned int gfp_mask)
int retval = 1;
if (gfp_mask & __GFP_WAIT) {
+ current->state = TASK_RUNNING;
current->flags |= PF_MEMALLOC;
retval = do_try_to_free_pages(gfp_mask);
current->flags &= ~PF_MEMALLOC;