summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
authorneal <neal>2008-06-27 15:17:27 +0000
committerneal <neal>2008-06-27 15:17:27 +0000
commitc314b447a633a3aa2d1e4a882675038fd381e873 (patch)
treec3d2625fc63af15c7e6200203a5347e68f192713 /hurd
parent8305c7cd3d379fda42cee8c58783bf2ae52f4ff0 (diff)
hurd/
2008-06-27 Neal H. Walfield <neal@gnu.org> * activity.h (RM_activity_stats): Don't define. (RM_activity_info): Replace with this. (struct activity_stats): Add field pressure_local. Make field pressure an 8 bit integer. (struct activity_stats_buffer): Remove structure. (struct activity_info): Replace with this structure. (activity_info_stats): Define. (activity_info_pressure): Likewise. (activity_stats): Remove method. (activity_info): Replace with this. viengoos/ 2008-06-27 Neal H. Walfield <neal@gnu.org> * activity.h (struct activity): Add fields free_bad_karma, free_goal, free_allocations and free_initial_allocation. * rm.h (rm_method_id_string): Replace RM_activity_stats handling with RM_activity_info handling. * thread.h (THREAD_WAIT_STATS): Remove. (THREAD_WAIT_ACTIVITY_INFO): Replace with this. (struct thread): Add field wait_reason_arg2. * ager.c (update_stats): Account for local pressure when calculating availability. Don't use activity_stats to inform threads of new statistics but activity_info. * object.c (object_desc_claim): Adjust the activity's FREE_GOAL, FREE_ALLOCATIONS, and FRAMES_EXCLUDED fields as appropriate. * pager.c (pager_collect): When selecting a victim, don't include an activity's excluded frames in its allocation. Don't even consider activities for which FREE_ALLOCATIONS is non-zero. Having selected a victim, don't increase the pressure do drastically. Update the local pressure. Having selected a victim from which to revoke pages, send any waiting threads a message to free memory. If VICTIM->FREE_BAD_KARMA is 0, assume that the memory will be freed and give the activity 100 claims to do it. If the activity has bad karma, decrease it by one. * server.c (server_loop): Replace activity_stats implementation with implementation appropriate for activity_info. hieronymus/ 2008-06-27 Neal H. Walfield <neal@gnu.org> * hieronymus.c (do_gather_stats): Change to use activity_info instead of activity_stats. (main): Introduce code to delay process creation. ruth/ 2008-06-27 Neal H. Walfield <neal@gnu.org> * ruth.c (main): Update to use activity_info instead of activity_stats. benchmarks/ 2008-06-27 Neal H. Walfield <neal@gnu.org> * shared-memory-distribution.c (main): Update to use activity_info instead of activity_status. * activity-distribution.c (main): Likewise. * GCbench.c: Include <stdint.h> and <stdbool.h>. (now): New function. (struct stats): Add fields time, gcs and iter. (have_a_hog): New variable. (mem_hog) [__gnu_hurd_viengoos__]: Rename from this... (helper) [__gnu_hurd_viengoos__]: ... to this. Use activity_info, not activity_stats. Gather more data. (helper) [! __gnu_hurd_viengoos__]: New function. (tid): Rename from this... (helper_tid): ... to this. (helper_fork) [__gnu_hurd_viengoos__]: Name activities. (main): Improve output. benchmarks/boehm-gc/ 2008-06-27 Neal H. Walfield <neal@gnu.org> * patches/05-viengoos-scheduler.patch: Update to use activity_info in place of activity_stats. Listen for pressure messages and act appropriately. Tighten adaptive code. Improve profiling code.
Diffstat (limited to 'hurd')
-rw-r--r--hurd/ChangeLog13
-rw-r--r--hurd/activity.h80
2 files changed, 73 insertions, 20 deletions
diff --git a/hurd/ChangeLog b/hurd/ChangeLog
index 1df93a2..2e0c3f7 100644
--- a/hurd/ChangeLog
+++ b/hurd/ChangeLog
@@ -1,5 +1,18 @@
2008-06-27 Neal H. Walfield <neal@gnu.org>
+ * activity.h (RM_activity_stats): Don't define.
+ (RM_activity_info): Replace with this.
+ (struct activity_stats): Add field pressure_local. Make field
+ pressure an 8 bit integer.
+ (struct activity_stats_buffer): Remove structure.
+ (struct activity_info): Replace with this structure.
+ (activity_info_stats): Define.
+ (activity_info_pressure): Likewise.
+ (activity_stats): Remove method.
+ (activity_info): Replace with this.
+
+2008-06-27 Neal H. Walfield <neal@gnu.org>
+
* stddef.h (do_debug): If DEBUG_ELIDE is defined to an integer,
statically exclude those debug statements that have a level
greater than or equal to it.
diff --git a/hurd/activity.h b/hurd/activity.h
index d26a233..5c3a1e5 100644
--- a/hurd/activity.h
+++ b/hurd/activity.h
@@ -28,7 +28,7 @@
enum
{
RM_activity_policy = 700,
- RM_activity_stats,
+ RM_activity_info,
};
struct activity_memory_policy
@@ -79,10 +79,11 @@ struct activity_stats
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
- memory the activity ought to consider freeing. */
- int32_t damping_factor;
+ /* Log2 the maximum amount of memory (in pages) that the user of
+ this activity ought to allocate in the next few seconds. If
+ negative, the amount of memory the activity ought to consider
+ freeing. */
+ int8_t damping_factor;
/* If pressure is non-zero, then this activity is causing PRESSURE.
@@ -99,7 +100,8 @@ struct activity_stats
system if it does not yield memory. However, if the activity has
memory which is yielding a low return, it would be friendly of it
to return it. */
- uint32_t pressure;
+ uint8_t pressure;
+ uint8_t pressure_local;
/* The number of clean and dirty frames that are accounted to this
activity. (Does not include frames scheduled for eviction.) The
@@ -157,10 +159,6 @@ struct activity_stats
evicted, then the process is trashing.) */
uint32_t saved;
};
-struct activity_stats_buffer
-{
- struct activity_stats stats[ACTIVITY_STATS_PERIODS];
-};
#define ACTIVITY_POLICY(__ap_sibling_rel, __ap_child_rel, __ap_storage) \
(struct activity_policy) { __ap_sibling_rel, __ap_child_rel, __ap_storage }
@@ -201,17 +199,59 @@ RPC (activity_policy, 3, 1, addr_t, activity,
/* Out: */
struct activity_policy, out);
-/* Return statistics about activity ACTIVITY. Waits until the current
- period is older than UNTIL_PERIOD. (This can be used to register a
- callback that is sent when the statistics are next available. For
- example, call with until_period is 0 to get the current statistics
- and then examine the period field. Use this as the base for the
- next call.) COUNT is the number of returned samples. Samples are
- ordered by recency with the youngest towards the start of the
- buffer. */
-RPC (activity_stats, 2, 2, addr_t, activity, uintptr_t, until_period,
+enum
+ {
+ /* Return statistics. */
+ activity_info_stats = 1 << 0,
+ /* Asynchronous change in availability. */
+ activity_info_pressure = 1 << 1,
+ };
+
+struct activity_info
+{
+ /* The returned event. */
+ uintptr_t event;
+ union
+ {
+ /* If EVENT is activity_info_stats. */
+ struct
+ {
+ /* The number of samples. */
+ int count;
+ /* Samples are ordered by recency with the youngest towards the
+ start of the buffer. */
+ struct activity_stats stats[ACTIVITY_STATS_PERIODS];
+ } stats;
+
+ /* If EVENT is activity_info_free. */
+ struct
+ {
+ /* The number of pages the caller should try to free (negative)
+ or may allocate (positive). */
+ int amount;
+ } pressure;
+ };
+};
+
+/* Return some information about the activity ACTIVITY. FLAGS is a
+ bit-wise or of events the caller is interested. Only one event
+ will be returned.
+
+ If FLAGS contains activity_info_stats, may return the next
+ statistic that comes at or after UNTIL_PERIOD. (This can be used
+ to register a callback that is sent when the statistics are next
+ available. For example, call with UNTIL_PERIOD equal to 0 to get
+ the current statistics and then examine the period field. Use this
+ as the base for the next call.)
+
+ If FLAGS contains activity_info_free, may return an upcall
+ indicating that the activity must free some memory or will be such
+ subject to paging. In this case, the activity should try to free
+ at least the indicated number of pages as quickly as possible. */
+RPC (activity_info, 3, 1, addr_t, activity,
+ uintptr_t, flags, uintptr_t, until_period,
/* Out: */
- struct activity_stats_buffer, stats, int, count)
+ struct activity_info, info)
#undef RPC_STUB_PREFIX
#undef RPC_ID_PREFIX