summaryrefslogtreecommitdiff
path: root/viengoos/pager.c
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@gnu.org>2008-11-12 14:30:51 +0100
committerNeal H. Walfield <neal@gnu.org>2008-11-12 14:30:51 +0100
commit68010d8e78060f333c5b6f2e2303a78523935aad (patch)
tree4bbc08771bd26cec4029c0276dfc13f886b8723f /viengoos/pager.c
parenta6e69fe0f8f989213cc036b6bdd52b6098f1e5d9 (diff)
Add victim frames to the end of the eviction list.
2008-11-12 Neal H. Walfield <neal@gnu.org> * pager.c (reclaim_from): Add victims to the end of the eviction list.
Diffstat (limited to 'viengoos/pager.c')
-rw-r--r--viengoos/pager.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/viengoos/pager.c b/viengoos/pager.c
index 295ed4f..861f8cc 100644
--- a/viengoos/pager.c
+++ b/viengoos/pager.c
@@ -99,6 +99,8 @@ reclaim_from (struct activity *victim, int goal)
for (i = OBJECT_PRIORITY_MIN; i <= OBJECT_PRIORITY_MAX; i ++)
{
+ int s = count;
+
struct object_desc *desc;
while (count < goal
&& (desc = activity_list_head (&victim->frames[i].inactive)))
@@ -114,7 +116,7 @@ reclaim_from (struct activity *victim, int goal)
object_desc_flush (desc, false);
if (desc->dirty && ! desc->policy.discardable)
{
- eviction_list_push (&victim->eviction_dirty, desc);
+ eviction_list_queue (&victim->eviction_dirty, desc);
laundry_list_queue (&laundry, desc);
laundry_count ++;
@@ -123,7 +125,7 @@ reclaim_from (struct activity *victim, int goal)
{
is_clean (desc);
- eviction_list_push (&victim->eviction_clean, desc);
+ eviction_list_queue (&victim->eviction_clean, desc);
available_list_queue (&available, desc);
@@ -136,6 +138,11 @@ reclaim_from (struct activity *victim, int goal)
count ++;
}
+ if (count - s > 0)
+ debug (5, "Reclaimed %d inactive, priority level %d",
+ count - s, i);
+ s = count;
+
/* Currently we evict in LIFO order. We should do a semi-sort and
then evict accordingly. */
while (count < goal
@@ -174,6 +181,10 @@ reclaim_from (struct activity *victim, int goal)
count ++;
}
+
+ if (count - s > 0)
+ debug (5, "Reclaimed %d active, priority level %d",
+ count - s, i);
}
victim->frames_local -= count - laundry_count;
@@ -348,6 +359,8 @@ pager_collect (int goal)
return false;
}
+ profile_region ("pager_collect(find victim)");
+
victim = root_activity;
do
{
@@ -435,6 +448,8 @@ pager_collect (int goal)
}
while (victim != parent);
+ profile_region_end ();
+
if (! victim)
break;