summaryrefslogtreecommitdiff
path: root/viengoos/pager.c
diff options
context:
space:
mode:
authorneal <neal>2008-02-20 10:35:52 +0000
committerneal <neal>2008-02-20 10:35:52 +0000
commitf961f68bca6ba0bab6da5a054a502e9a0e6566ec (patch)
tree275865a9c09b8bc135138c14f0bd418f2d60104b /viengoos/pager.c
parent93ed9e4ab7b6a299824f0a2d86b7487c5ff0b2b0 (diff)
2008-02-20 Neal H. Walfield <neal@gnu.org>
* activity.h (struct activity): Unify the inactive_dirty and inactive_clean lists. Update users.
Diffstat (limited to 'viengoos/pager.c')
-rw-r--r--viengoos/pager.c73
1 files changed, 20 insertions, 53 deletions
diff --git a/viengoos/pager.c b/viengoos/pager.c
index d1f3c91..a50b27f 100644
--- a/viengoos/pager.c
+++ b/viengoos/pager.c
@@ -97,78 +97,45 @@ reclaim_from (struct activity *victim, int goal)
/* VICTIM still has to yield pages. Start stealing from the
inactive LRU lists. */
{
- struct object_desc *clean, *dirty;
+ struct object_desc *inactive;
/* For every clean page we steal, we queue a dirty page for
writeout. */
- clean = activity_lru_list_head (&victim->inactive_clean);
- dirty = activity_lru_list_head (&victim->inactive_dirty);
+ inactive = activity_lru_list_head (&victim->inactive);
struct object_desc *next;
- while ((clean || dirty) && count < goal)
+ while (inactive && count < goal)
{
- if (clean)
- {
- assert (! clean->eviction_candidate);
- assert (! clean->dirty || clean->policy.discardable);
- assert (! list_node_attached (&clean->available_node));
-
- next = activity_lru_list_next (clean);
-
- activity_lru_list_unlink (&victim->inactive_clean, clean);
+ assert (! inactive->eviction_candidate);
+ assert (! list_node_attached (&inactive->available_node));
- object_desc_flush (clean);
- if (clean->dirty)
- /* It is possible that the page was dirtied between
- the last check and now. */
- {
- eviction_list_push (&victim->eviction_dirty, clean);
+ next = activity_lru_list_next (inactive);
- laundry_list_queue (&laundry, clean);
- }
- else
- {
- is_clean (desc);
+ activity_lru_list_unlink (&victim->inactive, inactive);
- eviction_list_push (&victim->eviction_clean, clean);
-
- available_list_queue (&available, clean);
- }
-
- clean->eviction_candidate = true;
-
- count ++;
+ object_desc_flush (inactive);
+ if (inactive->dirty && ! inactive->policy.discardable)
+ {
+ eviction_list_push (&victim->eviction_dirty, inactive);
- clean = next;
+ laundry_list_queue (&laundry, inactive);
}
-
- if (count == goal)
- break;
-
- if (dirty)
+ else
{
- assert (! dirty->eviction_candidate);
- assert (dirty->dirty && ! dirty->policy.discardable);
- assert (! list_node_attached (&dirty->laundry_node));
-
- next = activity_lru_list_next (dirty);
+ is_clean (inactive);
- object_desc_flush (dirty);
+ eviction_list_push (&victim->eviction_clean, inactive);
- dirty->eviction_candidate = true;
-
- activity_lru_list_unlink (&victim->inactive_dirty, dirty);
- eviction_list_push (&victim->eviction_dirty, dirty);
+ available_list_queue (&available, inactive);
+ }
- laundry_list_queue (&laundry, dirty);
+ inactive->eviction_candidate = true;
- laundry_count ++;
- count ++;
+ count ++;
- dirty = next;
- }
+ inactive = next;
}
}