diff options
author | neal <neal> | 2008-07-04 09:11:08 +0000 |
---|---|---|
committer | neal <neal> | 2008-07-04 09:11:08 +0000 |
commit | 7bdad7dbd6dc8477abe3d66092c27dcf7996c818 (patch) | |
tree | f3791bd152ac354caff8376075d1bcf0e7f4f729 /viengoos/ager.c | |
parent | 4d574251ffe42951ac80b11ad2f82e66a2f88e43 (diff) |
2008-07-04 Neal H. Walfield <neal@gnu.org>
* ager.c (update_stats): When calculating statistics, remove a
little bit from the total memory available to the root activity.
Diffstat (limited to 'viengoos/ager.c')
-rw-r--r-- | viengoos/ager.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/viengoos/ager.c b/viengoos/ager.c index b6dd8b7..a8a3fd7 100644 --- a/viengoos/ager.c +++ b/viengoos/ager.c @@ -36,7 +36,6 @@ #define MIN(x,y) ((x) < (y) ? (x) : (y)) #define MAX(x,y) ((x) > (y) ? (x) : (y)) - /* A frames has a single claimant. When a frame is shared among multiple activities, the first activity to access claims it (that is, that activity is accounted the frame). To distribute the cost @@ -99,7 +98,7 @@ update_stats (void) int dec = frames / 8; dec /= 5 - MIN (ACTIVITY_STATS (activity)->pressure, 4); - debug (0, "Due to pressure (%d), decreasing frames available " + debug (5, "Due to pressure (%d), decreasing frames available " "to " OBJECT_NAME_FMT " from %d to %d", ACTIVITY_STATS (activity)->pressure, OBJECT_NAME_PRINTF ((struct object *) activity), @@ -323,7 +322,7 @@ update_stats (void) int dec = avail / 8; dec /= 5 - MIN (ACTIVITY_STATS (activity)->pressure_local, 4); - debug (1, "Due to pressure (%d), decreasing frames locally " + debug (5, "Due to local pressure (%d), decreasing frames " "available to " OBJECT_NAME_FMT " from %d to %d", ACTIVITY_STATS (activity)->pressure_local, OBJECT_NAME_PRINTF ((struct object *) activity), @@ -444,7 +443,7 @@ update_stats (void) } } - stats (root_activity, memory_total - PAGER_LOW_WATER_MARK); + stats (root_activity, memory_total - PAGER_LOW_WATER_MARK - 200); profile_end ((uintptr_t) &update_stats); ss_mutex_unlock (&kernel_lock); @@ -668,6 +667,8 @@ ager_loop (void) do_debug (1) { + /* Make the print atomic. */ + ss_mutex_lock (&kernel_lock); int a = zalloc_memory + available_list_count (&available); debug (0, "%d: %d of %d (%d%%) free; laundry: %d; " "%d became inactive, %d became active", @@ -675,6 +676,7 @@ ager_loop (void) a, memory_total, (a * 100) / memory_total, laundry_list_count (&laundry), became_inactive, became_active); + ss_mutex_unlock (&kernel_lock); } } period ++; |