summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneal <neal>2008-06-23 19:58:47 +0000
committerneal <neal>2008-06-23 19:58:47 +0000
commit68ed7a07912acd5b5e7ba8b239681413f482e145 (patch)
treec402d196d77e0782428b9f5282a618710669d244
parent13948e6ff6a0cf094c9d104852fbf6e36a7f2e8d (diff)
hurd/
2008-06-23 Neal H. Walfield <neal@gnu.org> * activity.h (struct activity_stats): New fields available_local, pending_eviction and discarded. viengoos/ 2008-06-23 Neal H. Walfield <neal@gnu.org> * memory.c (memory_frame_allocate): If we discard a page, update DESC->ACTIVITY's DISCARDED statistic. * pager.c (pager_collect): When we collect an activity, update its pressure statistic.
-rw-r--r--hurd/ChangeLog5
-rw-r--r--hurd/activity.h6
-rw-r--r--viengoos/ChangeLog8
-rw-r--r--viengoos/memory.c5
-rw-r--r--viengoos/pager.c3
5 files changed, 26 insertions, 1 deletions
diff --git a/hurd/ChangeLog b/hurd/ChangeLog
index 346a2aa..67493b4 100644
--- a/hurd/ChangeLog
+++ b/hurd/ChangeLog
@@ -1,5 +1,10 @@
2008-06-23 Neal H. Walfield <neal@gnu.org>
+ * activity.h (struct activity_stats): New fields available_local,
+ pending_eviction and discarded.
+
+2008-06-23 Neal H. Walfield <neal@gnu.org>
+
* stddef.h (panic_): Use gcc's format attribute.
2008-06-23 Neal H. Walfield <neal@gnu.org>
diff --git a/hurd/activity.h b/hurd/activity.h
index 245ec49..d26a233 100644
--- a/hurd/activity.h
+++ b/hurd/activity.h
@@ -77,6 +77,7 @@ struct activity_stats
allocate assuming other allocations do not otherwise change.
This implies stealing from others. */
uint32_t available;
+ uint32_t available_local;
/* The maximum amount of memory that the user of this activity ought
to allocate in the next few seconds. If negative, the amount of
@@ -106,6 +107,8 @@ struct activity_stats
DIRTY. */
uint32_t clean;
uint32_t dirty;
+ /* Number of frames pending eviction. */
+ uint32_t pending_eviction;
/* Based on recency information, the number of active frames
@@ -142,6 +145,9 @@ struct activity_stats
/* Number of frames that were accounted to this activity and
scheduled for eviction. */
uint32_t evicted;
+ /* Number of frames that were accounted to this activity (not its
+ children), had the discarded bit set, and were discarded. */
+ uint32_t discarded;
/* Number of frames paged-in on behalf of this activity. This does
not include pages marked empty that do not require disk
activity. */
diff --git a/viengoos/ChangeLog b/viengoos/ChangeLog
index 791061f..6e99205 100644
--- a/viengoos/ChangeLog
+++ b/viengoos/ChangeLog
@@ -1,5 +1,13 @@
2008-06-23 Neal H. Walfield <neal@gnu.org>
+ * memory.c (memory_frame_allocate): If we discard a page, update
+ DESC->ACTIVITY's DISCARDED statistic.
+
+ * pager.c (pager_collect): When we collect an activity, update
+ its pressure statistic.
+
+2008-06-23 Neal H. Walfield <neal@gnu.org>
+
* pager.c: Include "profile.h".
(pager_collect): Profile.
diff --git a/viengoos/memory.c b/viengoos/memory.c
index 257459b..1c9d60f 100644
--- a/viengoos/memory.c
+++ b/viengoos/memory.c
@@ -396,7 +396,10 @@ memory_frame_allocate (struct activity *activity)
bool discarded = desc->dirty;
if (discarded)
- assert (desc->policy.discardable);
+ {
+ assert (desc->policy.discardable);
+ ACTIVITY_STATS (desc->activity)->discarded ++;
+ }
oid_t oid = desc->oid;
memory_object_destroy (activity, object);
diff --git a/viengoos/pager.c b/viengoos/pager.c
index a489dbe..0dd3f72 100644
--- a/viengoos/pager.c
+++ b/viengoos/pager.c
@@ -502,6 +502,9 @@ pager_collect (int goal)
if (! victim)
break;
+
+ ACTIVITY_STATS (victim)->pressure += 4;
+
assert (victim);
}
while (victim != parent);