[PATCH] small cleanup for my vmscan patch in pre4

From: Roger Larsson (roger.larsson@norran.net)
Date: Tue Jul 11 2000 - 04:49:28 EST


Hi,

This is against -pre6...
Mostly comment changes.
Compiles.

Other changes:
* priority decrement back to original
* Quintela noticed me that since shrink_mmap may sleep the situation
may
   have improved after call even if nothing was freed.

Note:
* Not tested yet - I have some problems with the list based aging
(another patch).
  (want to stay on this release until I understand why)

/RogerL

--
Home page:
  http://www.norran.net/nra02596/

--- linux/mm/vmscan.c.orig Tue Jul 11 11:28:33 2000 +++ linux/mm/vmscan.c Tue Jul 11 11:39:53 2000 @@ -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 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;

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:12 EST