summaryrefslogtreecommitdiff
path: root/viengoos/activity.h
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@gnu.org>2008-11-04 16:25:13 +0100
committerNeal H. Walfield <neal@gnu.org>2008-11-04 16:25:13 +0100
commit908dbd86b3c431456df7a7d1f6b69f6e2830e0af (patch)
tree1aa0b65e8f9a8b6b98fdc281cd4c30a4e9ddd904 /viengoos/activity.h
parentb3c92f167f20f1267c6b4ec83f1b6b6edd2ba85a (diff)
In the activity structure, use a pair of lists per priority level.
2008-11-04 Neal H. Walfield <neal@gnu.org> * activity.h (struct activity): Replace fields active, inactive, priorities and priorities_count with fields frames_ and frames. Update users. * object.h (activity_lru): Rename from this... (activity): ... to this. Update users. * activity.c (activity_destroy): When moving frames claimed by a child to its parent's lowest priority level, update each frame's respective priority. (activity_prepare) [! NDEBUG]: Initialize priority levels.
Diffstat (limited to 'viengoos/activity.h')
-rw-r--r--viengoos/activity.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/viengoos/activity.h b/viengoos/activity.h
index 8ffcc94..983395a 100644
--- a/viengoos/activity.h
+++ b/viengoos/activity.h
@@ -70,17 +70,19 @@ struct activity
struct activity_children_list children;
struct list_node sibling;
- /* Objects claimed by this activity whose priority is
- OBJECT_PRIORITY_LRU and for which DESC->EVICTION_CANDIDATE is
- false. */
- struct activity_lru_list active;
- struct activity_lru_list inactive;
-
- /* Objects claimed by this activity whose priority is not
- OBJECT_PRIORITY_LRU and for which DESC->EVICTION_CANDIDATE is
- false. Keyed by priority. */
- hurd_btree_priorities_t priorities;
- int priorities_count;
+ /* Objects claimed by this activity for which
+ DESC->EVICTION_CANDIDATE is false. As priority is signed, to
+ avoid having to adjust the index, we play a small trick. */
+ struct
+ {
+ struct activity_list active;
+ struct activity_list inactive;
+ } frames_[-OBJECT_PRIORITY_MIN];
+ struct
+ {
+ struct activity_list active;
+ struct activity_list inactive;
+ } frames[OBJECT_PRIORITY_MAX + 1];
/* Objects that are owned by this activity and have been selected
for eviction (DESC->EVICTION_CANDIDATE is true). These objects
@@ -90,17 +92,15 @@ struct activity
struct eviction_list eviction_dirty;
/* Number of frames allocated to this activity not counting
- children. This includes all frames allocated on the PRIORITY
- tree and the ACTIVE, INACTIVE and EVICTION_DIRTY lists (but not
- the EVICTION_CLEAN list, as it is elements on it are immediately
- reclaimable). */
+ children. This includes all frames allocated on the ACTIVE,
+ INACTIVE and EVICTION_DIRTY lists (but not the EVICTION_CLEAN
+ list, as it is elements on it are immediately reclaimable). */
uint32_t frames_local;
/* Number of frames allocated to this activity (including children).
- This is the sum of the number of objects on the PRIORITY tree,
- and the ACTIVE, INACTIVE and EVICTION_DIRTY lists plus the number
- of frames allocated to each child. This does not include the
- number of frames on the eviction_clean and eviction_dirty
- lists. */
+ This is the sum of the number of objects on the ACTIVE, INACTIVE
+ and EVICTION_DIRTY lists plus the number of frames allocated to
+ each child. This does not include the number of frames on the
+ eviction_clean and eviction_dirty lists. */
uint32_t frames_total;
/* Dirty frames that are pending eviction. */