summaryrefslogtreecommitdiff
path: root/viengoos/pager.c
AgeCommit message (Collapse)Author
2008-12-18Add vg_ prefix to the (hopefully) remaining viengoos symbols.Neal H. Walfield
2008-12-18 Neal H. Walfield <neal@gnu.org> * viengoos/activity.h (struct activity_memory_policy): Rename from this... (struct vg_activity_memory_policy): ... to this. Update users. (struct activity_policy): Rename from this... (struct vg_activity_policy): ... to this. Update users. (ACTIVITY_STATS_PERIODS): Rename from this... (VG_ACTIVITY_STATS_PERIODS): ... to this. Update users. (struct activity_stats): Rename from this... (struct vg_activity_stats): ... to this. Update users. (struct activity_info): Rename from this... (struct vg_activity_info): ... to this. Update users. * viengoos/addr.h (struct addr): Rename from this... (struct vg_addr): ... to this. Update users. * viengoos/cap.h (struct object_policy): Rename from this... (struct vg_object_policy): ... to this. Update users. (struct object_name): Rename from this... (struct vg_object_name): ... to this. Update users. (struct object): Rename from this... (struct vg_object): ... to this. Update users. * viengoos/folio.h (struct folio_policy): Rename from this... (struct vg_folio_policy): ... to this. Update users. (struct folio): Rename for this... (struct vg_folio): ... to this. Update users. * viengoos/thread.h (HURD_EXREGS_SET_UTCB): Rename from this... (VG_EXREGS_SET_UTCB): ... to this. Update users. (HURD_EXREGS_SET_EXCEPTION_MESSENGER): Rename from this... (VG_EXREGS_SET_EXCEPTION_MESSENGER): ... to this. Update users. (HURD_EXREGS_SET_ASPACE): Rename from this... (VG_EXREGS_SET_ASPACE): ... to this. Update users. (HURD_EXREGS_SET_ACTIVITY): Rename from this... (VG_EXREGS_SET_ACTIVITY): ... to this. Update users. (HURD_EXREGS_SET_SP): Rename from this... (VG_EXREGS_SET_SP): ... to this. Update users. (HURD_EXREGS_SET_IP): Rename from this... (VG_EXREGS_SET_IP): ... to this. Update users. (HURD_EXREGS_SET_SP_IP): Rename from this... (VG_EXREGS_SET_SP_IP): ... to this. Update users. (HURD_EXREGS_SET_EFLAGS): Rename from this... (VG_EXREGS_SET_EFLAGS): ... to this. Update users. (HURD_EXREGS_SET_USER_HANDLE): Rename from this... (VG_EXREGS_SET_USER_HANDLE): ... to this. Update users. (HURD_EXREGS_SET_REGS): Rename from this... (VG_EXREGS_SET_REGS): ... to this. Update users. (HURD_EXREGS_GET_REGS): Rename from this... (VG_EXREGS_GET_REGS): ... to this. Update users. (HURD_EXREGS_START): Rename from this... (VG_EXREGS_START): ... to this. Update users. (HURD_EXREGS_STOP): Rename from this... (VG_EXREGS_STOP): ... to this. Update users. (HURD_EXREGS_ABORT_SEND): Rename from this... (VG_EXREGS_ABORT_SEND): ... to this. Update users. (HURD_EXREGS_ABORT_RECEIVE): Rename from this... (VG_EXREGS_ABORT_RECEIVE): ... to this. Update users. (HURD_EXREGS_ABORT_IPC): Rename from this... (VG_EXREGS_ABORT_IPC): ... to this. Update users. (struct hurd_thread_exregs_in): Rename form this... (struct vg_thread_exregs_in): ... to this. Update users. (struct hurd_thread_exregs_out): Rename form this... (struct vg_thread_exregs_out): ... to this. Update users. (RPC_STUB_PREFIX): Define to vg_activation. Update users. (RPC_ID_PREFIX): Define to VG_ACTIVATION. Update users. (ACTIVATION_fault): Rename from this... (VG_ACTIVATION_fault): ... to this. Update users.
2008-12-17Replace remaining rm_ prefixes with vg_.Neal H. Walfield
libhurd-mm/ 2008-12-17 Neal H. Walfield <neal@gnu.org> * exceptions.c (hurd_activation_fetch): Use vg_thread_activation_collect_send, not rm_thread_activation_collect_send. (hurd_activation_handler_init_early): Use vg_thread_exregs_send_marshal, not rm_thread_exregs_send_marshal. viengoos/ 2008-12-17 Neal H. Walfield <neal@gnu.org> * ager.c (update_stats): Use vg_activity_info_reply, not rm_activity_info_reply. * pager.c (pager_collect): Likewise. * object.c (folio_object_alloc): Use vg_object_reply_on_destruction_reply, not rm_object_reply_on_destruction_reply. * server.c (server_loop): Use vg_write_send_unmarshal, not rm_write_send_unmarshal. Use vg_write_reply, not rm_write_reply. Use VG_read_send_unmarshal, not rm_read_send_unmarshal. Use VG_read_reply, not rm_read_reply. Use VG_fault_send_unmarshal, not rm_fault_send_unmarshal. Use VG_fault_reply, not rm_fault_reply. Use VG_fault_reply, not rm_fault_reply. Use VG_folio_alloc_send_unmarshal, not rm_folio_alloc_send_unmarshal. Use VG_folio_alloc_reply, not rm_folio_alloc_reply. Use VG_folio_free_send_unmarshal, not rm_folio_free_send_unmarshal. Use VG_folio_free_reply, not rm_folio_free_reply. Use VG_folio_object_alloc_send_unmarshal, not rm_folio_object_alloc_send_unmarshal. Use VG_folio_object_alloc_reply, not rm_folio_object_alloc_reply. Use VG_folio_policy_send_unmarshal, not rm_folio_policy_send_unmarshal. Use VG_folio_policy_reply, not rm_folio_policy_reply. Use VG_cap_copy_send_unmarshal, not rm_cap_copy_send_unmarshal. Use VG_cap_copy_reply, not rm_cap_copy_reply. Use VG_cap_rubout_send_unmarshal, not rm_cap_rubout_send_unmarshal. Use VG_cap_rubout_reply, not rm_cap_rubout_reply. Use VG_cap_read_send_unmarshal, not rm_cap_read_send_unmarshal. Use VG_cap_read_reply, not rm_cap_read_reply. Use VG_object_discarded_clear_send_unmarshal, not rm_object_discarded_clear_send_unmarshal. Use VG_object_discarded_clear_reply, not rm_object_discarded_clear_reply. Use VG_object_discard_send_unmarshal, not rm_object_discard_send_unmarshal. Use VG_object_discard_reply, not rm_object_discard_reply. Use VG_object_status_send_unmarshal, not rm_object_status_send_unmarshal. Use VG_object_status_reply, not rm_object_status_reply. Use VG_object_name_send_unmarshal, not rm_object_name_send_unmarshal. Use VG_object_name_reply, not rm_object_name_reply. Use VG_thread_exregs_send_unmarshal, not rm_thread_exregs_send_unmarshal. Use VG_thread_exregs_reply, not rm_thread_exregs_reply. Use VG_thread_id_send_unmarshal, not rm_thread_id_send_unmarshal. Use VG_thread_id_reply, not rm_thread_id_reply. Use VG_object_reply_on_destruction_send_unmarshal, not rm_object_reply_on_destruction_send_unmarshal. Use VG_activity_policy_send_unmarshal, not rm_activity_policy_send_unmarshal. Use VG_activity_policy_reply, not rm_activity_policy_reply. Use VG_activity_info_send_unmarshal, not rm_activity_info_send_unmarshal. Use VG_activity_info_reply, not rm_activity_info_reply. Use VG_thread_activation_collect_send_unmarshal, not rm_thread_activation_collect_send_unmarshal. Use VG_thread_activation_collect_reply, not rm_thread_activation_collect_reply. Use VG_as_dump_send_unmarshal, not rm_as_dump_send_unmarshal. Use VG_as_dump_reply, not rm_as_dump_reply. Use VG_futex_reply, not rm_futex_reply. Use VG_futex_send_unmarshal, not rm_futex_send_unmarshal. Use VG_futex_reply, not rm_futex_reply. Use VG_futex_reply, not rm_futex_reply. Use VG_futex_reply, not rm_futex_reply. 2008-12-17 Neal H. Walfield <neal@gnu.org> * server.c: Don't include <hurd/exceptions.h>. * thread.c: Likewise. 2008-12-17 Neal H. Walfield <neal@gnu.org> * zalloc.c: Don't include <l4/math.h>. Include <viengoos/math.h>. (zfree): Use vg_msb instead of l4_msb. * ager.c (update_stats): Likewise.
2008-12-17Add a "vg_" to public viengoos identifiers.Neal H. Walfield
2008-12-17 Neal H. Walfield <neal@gnu.org> * viengoos/activity.h: Add a "vg_" to public viengoos identifiers. Update users. * viengoos/addr-trans.h: Likewise. * viengoos/addr.h: Likewise. * viengoos/cap.h: Likewise. * viengoos/folio.h: Likewise. * viengoos/futex.h: Likewise. * viengoos/rpc.h: Likewise. * viengoos/thread.h: Likewise.
2008-12-12New IPC system. Update code accordingly.Neal H. Walfield
hurd/ 2008-12-11 Neal H. Walfield <neal@gnu.org> Adapt RPC interfaces according to changes in IPC semantics. * messenger.h: New file. * message.h: New file. * ipc.h: New file. * headers.m4: Link sysroot/include/hurd/message.h to hurd/message.h, sysroot/include/hurd/messenger.h to hurd/messenger.h, and sysroot/include/hurd/ipc.h to hurd/ipc.h. * cap.h: Include <hurd/addr.h> and <stdbool.h>. (enum cap_type): Define cap_messenger, cap_rmessenger and cap_type_count. (cap_type_string): Handle cap_messenger and cap_rmessenger. (cap_types_compatible): Likewise. (cap_type_weak_p): Likewise. (cap_type_weaken): Likewise. (cap_type_strengthen): Likewise. (oid_t): Replace L4 type with standard type. (CAP_VOID): Define. * rpc.h [! RPC_TARGET]: Don't error out if not defined. [RPC_TARGET_ARG_]: Don't define or undefine. [RPC_TARGET_]: Likewise. [RPC_TARGET_NEED_ARG]: Ignore. Don't include <l4/ipc.h> or <l4/space.h>. Include <hurd/message.h> and <hurd/ipc.h>. (reply_buffer) [RM_INTERN]: Declare. (messenger_message_load) [RM_INTERN]: Likewise. [! RM_INTERN] Include <hurd/message-buffer.h>. (cap_t): Define. (CPP_FOREACH): Define. (CPP_SAFE_DEREF): Likewise. (RPC_ARGUMENTS): Take additional argument prefix. Use it. Update users. (RPC_CHOP): Rename from this... (RPC_CHOP2): ... to this. Update users. (RPC_TYPE_SHIFT): New define. (RPCLOADARG): Rewrite according to new marshalling semantics. (RPCSTOREARG): Likewise. (RPC_SEND_MARSHAL): Likewise. (RPC_SEND_UNMARSHAL): Likewise. (RPC_REPLY_MARSHAL): Likewise. (RPC_REPLY_UNMARSHAL): Likewise. (RPC_RECEIVE_MARSHAL): New define. (RPC_MARSHAL_GEN_): Break this into... (RPC_SEND_MARSHAL_GEN_): ... this... (RPC_RECEIVE_MARSHAL_GEN_): ... this... (RPC_REPLY_MARSHAL_GEN_): ... and this. Update users. (RPC_MARSHAL_GEN_): Redefine in terms of the new macros. (RPC_SEND_): Rewrite according to new marshalling and IPC semantics. (RPC_SEND_NONBLOCKING_): Define. (RPC_): Rewrite according to new marshalling and IPC semantics. (RPC_REPLY_): Likewise. (RPC_SIMPLE_): Don't define. (RPC_SIMPLE): Don't define. (RPC): Take additional argument ret_cap_count. Update users. (rpc_error_reply_marshal): Rewrite according to new marshalling and IPC semantics. (rpc_error_reply): Likewise. * t-rpc.c (RPC_TARGET_NEED_ARG): Don't define. (RPC_TARGET): Define. (RPC_noargs): Set to a large interger. (RPC_caps): New define. (noargs): Update interface specification according to new IDL interface. Update users. (onein): Likewise. (oneout): Likewise. (onlyin): Likewise. (onlyout): Likewise. (mix): Likewise. (noargs): Likewise. (onein): Likewise. (oneout): Likewise. (onlyin): Likewise. (onlyout): Likewise. (mix): New interface. (RPC_TARGET): Don't undefine. (main): Update to use the new RPC marshalling interface. Write a test using the new `mix' interface. * activity.h (RPC_TARGET_NEED_ARG): Don't undefine. (RPC_TARGET): Don't define. (activity_policy): Update interface specification according to new IDL interface. Update users. (activity_info): Likewise. * cap.h: (RPC_TARGET_NEED_ARG): Don't undefine. (RPC_TARGET): Don't define. (RM_object_slot_copy_out): Don't define. (RM_object_slot_copy_in): Likewise. (RM_object_slot_read): Likewise. (RM_object_reply_on_destruction): Define. (cap_copy): Update interface specification according to new IDL interface. Update users. (cap_rubout): Likewise. (cap_read): Likewise. (object_discarded_clear): Likewise. (object_discard): Likewise. (object_status): Likewise. (object_name): Likewise. (object_reply_on_destruction): New interface replacing thread_wait_destroy. (object_slot_copy_out): Remove interface. (object_slot_copy_in): Likewise. (object_slot_read): Likewise. (RPC_TARGET): Don't undefine. * exceptions.h: Don't include <l4/thread.h>. Include <l4/space.h>. (RPC_STUB_PREFIX): Redefine to `activation'. (RPC_ID_PREFIX EXCEPTION): Redefine to `ACTIVATION'. (RPC_TARGET_NEED_ARG): Don't define. (RPC_TARGET_ARG_TYPE): Likewise. (RPC_TARGET): Likewise. (EXCEPTION_fault): Rename from this... (ACTIVATION_fault): ... to this. Update users. (exception_method_id_string): Rename from this... (activation_method_id_string): ... to this. (struct exception_info): Rename from this... (struct activation_fault_info): ... to this. Update users. (EXCEPTION_INFO_FMT): Rename from this... (ACTIVATION_FAULT_INFO_FMT): ... to this. Update users. (EXCEPTION_INFO_PRINTF): Rename from this... (ACTIVATION_FAULT_INFO_PRINTF): ... to this. Update users. (fault): Update interface specification according to new IDL interface. Update users. * folio.h (RPC_TARGET_NEED_ARG): Don't undefine. (RPC_TARGET): Don't define. (folio_alloc): Update interface specification according to new IDL interface. Update users. (folio_free): Likewise. (folio_object_alloc): Likewise. (folio_policy): Likewise. (RPC_TARGET): Don't undefine. * futex.h (RPC_TARGET_NEED_ARG): Don't undefine. (RPC_TARGET): Don't define. (futex): Update interface specification according to new IDL interface. Update users. (RPC_TARGET): Don't undefine. (futex_using): New function. (futex): Implement in terms of it. (futex_wait_using): New function. (futex_wait): Implement in terms of it. (futex_wake_using): New function. (futex_wake): Implement in terms of it. * thread.h (RM_thread_wait_object_destroyed): Don't define. (RM_thread_raise_exception): Rename from this... (RM_thread_activation_collect): ... to this. (RM_thread_id): Define. (RPC_TARGET_NEED_ARG): Don't undefine. (RPC_TARGET): Don't define. (struct hurd_thread_exregs_in): Remove fields aspace, activity, exception_page, aspace_out, activity_out and exception_page_out. (thread_exregs): Update interface specification according to new IDL interface. Add additional parameters exception_messenger and exception_messenger_out. Update users. (thread_wait_object_destroyed): Remove interface. (struct exception_buffer): Don't define. (thread_raise_exception): Remove interface. (thread_id): New interface. (thread_activation_collect): Likewise. (RPC_TARGET): Don't undefine. * RPC: Update. * exceptions.h (hurd_activation_handler_init_early): New declaration. (hurd_activation_handler_init): Likewise. (hurd_utcb): Likewise. (EXCEPTION_STACK_SIZE_LOG2): Don't define. (EXCEPTION_STACK_SIZE): Likewise. (hurd_activation_state_alloc): New declaration. (exception_page_cleanup): Rename from this... (hurd_activation_state_free): ... to this. Update users. (exception_handler_activated): Rename from this... (hurd_activation_handler_activated): ... to this. (exception_handler_normal): Rename from this... (hurd_activation_handler_normal): ... to this. Update users. Take additional parameter utcb. (exception_handler_entry): Rename from this... (hurd_activation_handler_entry): ... to this. (exception_handler_end): Rename from this... (hurd_activation_handler_end): ... to this. (hurd_activation_message_register): New declaration. (hurd_activation_message_unregister): Likewise. (hurd_activation_stack_dump): Likewise. * thread.h [! __have_vg_thread_id_t] (__have_vg_thread_id_t): Define. [! __have_vg_thread_id_t && USE_L4]: Include <l4.h>. [! __have_vg_thread_id_t && !USE_L4]: Include <stdint.h>. [! __have_vg_thread_id_t] (vg_thread_id_t): Define. [! __have_vg_thread_id_t] (vg_niltid): Define. [! __have_vg_thread_id_t] (VG_THREAD_ID_FMT): Define. [! __have_activation_frame] (__have_activation_frame): Define. [! __have_activation_frame && USE_L4]: Include <l4/ipc.h>. [! __have_activation_frame] (struct hurd_message_buffer): Declare. [! __have_activation_frame] (struct activation_frame): Define in this case. Add fields normal_mode_stack and canary. [! __have_activation_frame && i386] (struct activation_frame): Change regs to have 10 elements. Add fields eax, ecx, edx, eflags, eip, ebx, edi, esi, ebp and esp. [! __have_activation_frame && !USE_L4] (struct activation_frame): Remove fields saved_sender, saved_receiver, saved_timeout, saved_error_code, saved_flags, and saved_br0 in this case. [__need_vg_thread_id_t || __need_activation_frame] (__need_vg_thread_id_t): Undefine. [__need_vg_thread_id_t || __need_activation_frame] (__need_activation_frame): Likewise. [!__need_vg_thread_id_t && !__need_activation_frame]: Include the rest of the file in this case. Include <stdint.h>, <hurd/types.h>, <hurd/addr.h>, <hurd/addr-trans.h>, <hurd/cap.h>, <hurd/messenger.h> and <setjmp.h>. (hurd_activation_frame_longjmp): New declaration. (struct hurd_fault_catcher): New definition. (hurd_fault_catcher_register): New declaration. (hurd_fault_catcher_unregister): Likewise. (struct exception_page): Rename from this... (struct vg_utcb): ... to this. Update users. Remove field exception. Add fields protected_payload, messenger_id, inline_words, inline_caps, inline_word_count, inline_cap_count, inline_data, exception_buffer, extant_messages, catchers, alternate_stack, alternate_stack_inuse, canary0, canary1. (UTCB_CANARY0): Define. (UTCB_CANARY1): Likewise. (THREAD_EXCEPTION_PAGE_SLOT): Rename from this... (THREAD_UTCB): ... to this. (THREAD_EXCEPTION_MESSENGER): Define. (THREAD_SLOTS): Likewise. (THREAD_SLOTS_LOG2): Likewise. (HURD_EXREGS_SET_EXCEPTION_PAGE): Rename from this... (HURD_EXREGS_SET_UTCB): ... to this. Update users. (HURD_EXREGS_SET_EXCEPTION_MESSENGER): Define. (HURD_EXREGS_SET_REGS): Add HURD_EXREGS_SET_EXCEPTION_MESSENGER. (vg_myself): New function. * startup.h (struct hurd_startup_data): Add field messengers. viengoos/ 2008-12-12 Neal H. Walfield <neal@gnu.org> Implement messengers and convert to new IPC semantics. * messenger.h: New file. * messenger.c: New file. * Makefile.am (viengoos_SOURCES): Add messenger.h and messenger.c. * ager.c: Include "messenger.h". (update_stats): Update notifivation code to use messengers. * cap.c: Include <hurd/messenger.h>. (cap_shootdown): Follow thread and messenger objects. * object.h (object_wait_queue_head): Use and return struct messenger *'s, not struct thread *'s. Update users. (object_wait_queue_tail): Likewise. (object_wait_queue_next): Likewise. (object_wait_queue_prev): Likewise. (object_wait_queue_enqueue): Likewise. (object_wait_queue_dequeue): Likewise. Rename from this... (object_wait_queue_unlink): ... to this. (object_wait_queue_push): New declaration. (folio_object_wait_queue_for_each): Use and return struct messenger *'s, not struct thread *'s. Update users. (object_wait_queue_for_each): Likewise. * object.c: Include <hurd/messenger.h> and "messenger.h". (folio_object_alloc): When destroying a messenger, call messenger_destroy. (folio_object_alloc): Send notifications using messengers. (object_wait_queue_head): Use and return struct messenger *'s, not struct thread *'s. (object_wait_queue_tail): Likewise. (object_wait_queue_next): Likewise. (object_wait_queue_prev): Likewise. (object_wait_queue_check): Likewise. (object_wait_queue_enqueue): Likewise. Add MESSENGER to end of the queue, not the beginning. (object_wait_queue_push): New function. (object_wait_queue_dequeue): Use and return struct messenger *'s, not struct thread *'s. Rename from this... (object_wait_queue_unlink): ... to this. * pager.c: Include "messenger.h". * thread.h: Don't include "list.h". Include <hurd/cap.h> and <hurd/thread.h>. (struct folio): Remove declaration. (THREAD_SLOTS): Don't define. (THREAD_WAIT_FUTEX): Move from here... * messenger.h (MESSENGER_WAIT_FUTEX): ... to here. * thread.h (THREAD_WAIT_DESTROY): Move from here... * messenger.h (MESSENGER_WAIT_DESTROY): ... to here. * thread.h (THREAD_WAIT_ACTIVITY_INFO): Move from here... * messenger.h (MESSENGER_WAIT_ACTIVITY_INFO): ... to here. * thread.h (struct thread): Rename field exception_page to utcb. Add field exception_messenger. Remove fields wait_queue_p, wait_queue_head, wait_queue_tail, wait_reason, wait_reason_arg, wait_reason_arg2, wait_queue and futex_waiter_node. (futex_waiters): Don't declare. (thread_exregs): Change input capabilities to not be pointers to capabilities but just capability structures. Add argument exception_messenger. Remove arguments aspace_out, activity_out and exception_page_out. Update users. (thread_activate): New declaration. (thread_raise_exception): Change MSG's type to be struct vg_message *. Update users. (thread_deliver_pending): New declaration. * thread.c (thread_deinit): Remove code to remove THREAD from a wait queue. (thread_exregs): Change input capabilities to not be pointers to capabilities but just capability structures. Update code. Add argument exception_messenger. Set THREAD's exception messenger according to it and CONTROL. Remove arguments aspace_out, activity_out and exception_page_out. Don't save the old capabilities. (thread_raise_exception): Move body of function... (thread_activate): ... to this new function. Update to use messengers. (thread_raise_exception): Implement in terms of it. (thread_deliver_pending): New function. * server.c: Include <hurd/ipc.h> and "messenger.h". (DEBUG): If label is the IPC label, use "IPC" as the function. (OBJECT_): Take additional parameter WRITABLE. Save whether the object is writable in *WRITABLE. Update users. (OBJECT): Likewise. (server_loop): Update to use messengers and the new IPC interface. Update method implementations appropriately. Don't marshal faults using exception_fault_send_marshal but the new activation_fault_send_marshal. Remove implementations of object_slot_copy_out, object_slot_copy_in and object_slot_read. Reimplement object_discard. In the thread_exregs implementation, handle the exception messenger. Implement thread_id. Remove thread_wait_object_destroyed. Implement object_reply_on_destruction. In activity_info and activity_policy, don't operate on PRINCIPAL but the invoke activity. Implement thread_activation_collect. When blocking on a futex, don't enqueue the calling thread but the reply messenger. Implement the messenger_id method. (REPLY): Redefine before processing an object invocation to reply using the reply messenger included in the request. * rm.h: Include <l4/message.h>. (rm_method_id_string): Don't handle object_slot_copy_out, object_slot_copy_in, object_slot_read, exception_collect or thread_wait_object_destroyed. Handle object_reply_on_destruction, thread_id, thread_activation_collect. (RPC_TARGET_NEED_ARG): Don't undefine. (RPC_TARGET): Don't define. (struct io_buffer): Redefine in terms of L4_NUM_BRS. (write): Update interface specification according to new IDL interface. Update users. (read): Likewise. (as_dump): Likewise. (fault): Likewise. (RPC_STUB_PREFIX): Don't undefine. (RPC_ID_PREFIX): Likewise. libhurd-mm/ 2008-12-12 Neal H. Walfield <neal@gnu.org> Update to new RPC interface and IPC semantics. Support messengers. * message-buffer.h: New file. * message-buffer.c: Likewise. * Makefile.am (libhurd_mm_a_SOURCES): Add message-buffer.h and message-buffer.c. * headers.m4: Link sysroot/include/hurd/message-buffer.h to libhurd-mm/message-buffer.h. * exceptions.c: Include <hurd/mm.h>, <hurd/rm.h> and <backtrace.h>. (hurd_fault_catcher_register): New function. (hurd_fault_catcher_unregister): Likewise. (hurd_activation_frame_longjmp): Likewise. (utcb_state_save): Rename from this... (l4_utcb_state_save): ... to this. Take a `struct activation_frame *', not a `struct exception_frame *'. (utcb_state_restore): Rename from this... (l4_utcb_state_restore): ... to this. Take a `struct activation_frame *', not a `struct exception_frame *'. (exception_fetch_exception): Rename from this... (hurd_activation_fetch): ... to this. (hurd_activation_message_register): New function. (hurd_activation_frame_longjmp): Likewise. (exception_frame_slab): Rename from this... (activation_frame_slab): ... to this. Use a static initializer. (exception_frame_slab_alloc): Rename from this... (activation_frame_slab_alloc): ... to this. Don't preserve the L4 utcb. (exception_frame_slab_dealloc): Rename from this... (activation_frame_slab_dealloc): ... to this. (exception_frame_alloc): Rename from this... (activation_frame_alloc): ... to this. If there are no preallocated frames, panic. Move the hard allocation code to... (check_activation_frame_reserve): ... this new function. (hurd_activation_stack_dump): New function. (hurd_activation_handler_normal): Take an additional parameter, the utcb. Add consistency checks. Handle IPC and closures. Update fault handling code to use the new fault interface. If unable to resolve the fault via the pager mechanism, see if a fault catcher in installed. Check the UTCB's canary. If running on the alternate stack, clear UTCB->ALTERNATE_STACK_INUSE on exit. (hurd_activation_handler_activated): Take a `struct vg_utcb *', not a `struct exception_page *'. Handle IPC and closures. Improve test to determine if the fault was a stack fault. If so, return to normal mode to handle the fault and use an alternate stack. (activation_handler_area0): New local variable. (activation_handler_msg): Likewise. (initial_utcb): Likewise. (simple_utcb_fetcher): New function. (hurd_utcb): New variable. (hurd_activation_handler_init_early): New function. (hurd_activation_handler_init): Likewise. (exception_handler_init): Remove function. (ACTIVATION_AREA_SIZE_LOG2): Define. (ACTIVATION_AREA_SIZE): Likewise. (hurd_activation_state_alloc): New function. (exception_page_cleanup): Rename from this... (hurd_activation_state_free): ... to this. Rewrite. * ia32-exception-entry.S (_hurd_activation_handler_entry): Save the eflags before executing a sub instruction. Don't try to smartly calculate the location of the UTCB. Instead, just reload it. (activation_frame_run): Use an alternate stack, if requested. Save ebx and ebi. Pass the utcb to the callback. * mm-init.c [i386]: Include <hurd/pager.h>. Include <backtrace.h>. (mm_init): Call hurd_activation_handler_init_early and hurd_activation_handler_init. Don't call exception_handler_init. (mm_init) [! NDEBUG && i386]: Test the activation code. * as-build.c (do_index): Handle indexing a cap_thread or a cap_messenger. (as_build): Likewise. * as-dump.c (do_walk): Handle indexing a cap_thread or a cap_messenger. * as-lookup.c (as_lookup_rel_internal): Likewise. * as.c (as_walk): Likewise. * storage.c: Include <backtrace.h>. (shadow_setup): Update use of rm_folio_object_alloc according to its new interface. (storage_check_reserve_internal): Likewise. (storage_free_): Likewise. (FREE_PAGES_SERIALIZE): Bump to 32. (storage_alloc): If we try to get storage more than 5 lives, print a warning that we may be experiencing live lock. * pager.h (pager_fault_t): Change info's type from `struct exception_info' to `struct activation_fault_info'. (PAGER_VOID): Define. * map.h: Don't include <hurd/exceptions.h>. Include <hurd/as.h>. (maps_lock_lock): Don't use EXCEPTION_STACK_SIZE but AS_STACK_SPACE. (map_fault): Change info's type from `struct exception_info' to `struct activation_fault_info'. * map.c (map_fault): Change info's type from `struct exception_info' to `struct activation_fault_info'. * as.h (AS_STACK_SPACE): Define. (as_lock): Use AS_STACK_SPACE instead of EXCEPTION_STACK_SIZE. (as_lock_readonly): Likewise. * as.h (AS_CHECK_SHADOW): Only check the address translator for capabilities that designate cappages. * anonymous.h (ANONYMOUS_MAGIC): Define. (struct anonymous_pager): Add field magic. * anonymous.c (fault): Assert that ANON->MAGIC has the expected value. Correctly size PAGES. (mdestroy): Assert that ANON->MAGIC has the expected value. (destroy): Likewise. (advise): Likewise. (anonymous_pager_alloc): Initialize ANON->MAGIC. benchmarks/ 2008-12-12 Neal H. Walfield <neal@gnu.org> Update according to new RPC interfaces. * activity-distribution.c (main): Update use of rm_activity_policy and rm_activity_info to be consistent with the new interface. Replace use of `struct exception_info' with `struct activation_fault_info'. * cache.c (helper): Update use of rm_activity_policy and rm_activity_info to be consistent with the new interface. * shared-memory-distribution.c (main): Likewise. hieronymus/ 2008-12-12 Neal H. Walfield <neal@gnu.org> Update according to new RPC interfaces. * hieronymus.c (activity_alloc): Update use of rm_activity_policy, rm_activity_info and rm_folio_object_alloc to be consistent with new interface. Replace use of rm_thread_wait_object_destroyed with rm_object_reply_on_destruction. libc-parts/ 2008-12-11 Neal H. Walfield <neal@gnu.org> Update to new RPC interfaces. * _exit.c (_exit): Update use of rm_folio_object_alloc to be consistent with the new interface. * backtrace.c (RA) [!RM_INTERN]: Set up a fault catch handler to avoid gratuitously faulting. (backtrace) [!RM_INTERN]: Set up a jump buffer. Jump to it on a fault. (backtrace_print): Use s_printf, not printf. * ia32-crt0.S (STACK_SIZE): Increase to 128 kb. * process-spawn.c (process_spawn): Don't use a capability slot to identify the root of the new thread's address space, allocate a thread object. Allocate messengers for the new thread and save them in STARTUP_DATA->MESSENGERS. * s_printf.c (io_buffer_flush): Use the debug output interface. (s_putchar): Don't call rm_write but use io_buffer_flush. libpthread/ 2008-12-11 Neal H. Walfield <neal@gnu.org> Update to new RPC interfaces, IPC semantics. * sysdeps/viengoos/bits/pthread-np.h: Include <hurd/exceptions.h>. (pthread_hurd_utcb_np): New declaration. * sysdeps/viengoos/pt-hurd-utcb-np.c: New file. * Makefile.am (libpthread_a_SOURCES): Add pt-hurd-utcb.c. * sysdeps/viengoos/pt-sysdep.h (EXCEPTION_AREA_SIZE): Don't define. (EXCEPTION_AREA_SIZE_LOG2): Likewise. (EXCEPTION_PAGE): Likewise. (PTHREAD_SYSDEP_MEMBERS): Remove fields exception_area, and exception_area_va. Add fields utcb and lock_message_buffer. * sysdeps/viengoos/pt-thread-alloc.c: Include <hurd/message-buffer.h>. (__pthread_thread_alloc): Initialize thread->lock_message_buffer. When executed the first time, set the thread's L4 user-defined handler. Initialize THREAD->UTCB with the thread's current utcb. Set HURD_UTCB to PTHREAD_HURD_UTCB_NP. For subsequent threads, don't manually set up the activation area. Instead, call hurd_activation_state_alloc. * sysdeps/viengoos/pt-thread-dealloc.c: Include <hurd/message-buffer.h>. (__pthread_thread_dealloc): Call __pthread_thread_halt. Don't manually clean up the activation area. Instead, call hurd_activation_state_free. Free THREAD->LOCK_MESSAGE_BUFFER. * sysdeps/viengoos/ia32/pt-setup.c (stack_setup): Pre-fault the first four pages of the new stack. (__pthread_setup): Don't set up the activation area. * sysdeps/viengoos/pt-wakeup.c (__pthread_wakeup): Use futex_wake_using with the calling thread's lock messenger. * sysdeps/viengoos/pt-block.c (__pthread_block): Use futex_wait_using and provide THREAD->LOCK_MESSAGE_BUFFER as the message buffer. * sysdeps/viengoos/pt-thread-start.c (__pthread_thread_start): Don't set the first thread's L4 user-defined handler here. (__pthread_thread_start): Update use of rm_thread_exregs according to be consistent with new interface. * sysdeps/viengoos/pt-thread-halt.c (__pthread_thread_halt): If THREAD is the current thread, call vg_suspend. * sysdeps/viengoos/pt-setactivity-np.c (pthread_setactivity_np): Update use of rm_thread_exregs according to be consistent with new interface. * sysdeps/viengoos/ia32/signal-dispatch-lowlevel.c (signal_dispatch_lowlevel): Use __builtin_frame_address to get the current stack frame's start. Update use of rm_thread_exregs according to be consistent with new interface. ruth/ 2008-12-12 Neal H. Walfield <neal@gnu.org> Update to new RPC interfaces. * ruth.c (main): Update use of rm_folio_alloc, rm_folio_object_alloc, rm_thread_exregs, rm_activity_policy, rm_activity_info. Replace use of rm_thread_wait_object_destroy with rm_object_reply_on_destruction. Replace use of `struct exception_info' with `struct activation_fault_info'. Fix signal test's use of condition variables to not rely on the scheduler. When checking deallocation code, set up a fault handler to programmatically determine success.
2008-11-18Update profile interface and add support for profiling multiple threads.Neal H. Walfield
libc-parts/ 2008-11-18 Neal H. Walfield <neal@gnu.org> * profile.h (profile_start): Take additional parameter name2. Update users. (profile_region): Create the id from the function name and the description. * profile.c [__gnu_hurd_viengoos__]: Include <s-printf.h>. [! __gnu_hurd_viengoos__]: Include <pthread.h>. (THREADS): Define. (struct site): Rename from this... (struct call_site): ... to this. Add fields name2 and nested_calls. (SIZE): Rename from this... (CALL_SITES): ... to this. (sites_hash): Replace this variable... (sites_hash_buffer): ... and this one... (init): ... and this one... (sites): ... and this one... (used): ... and this one... (epoch): ... and this one... (calls): ... and this one... (total_time): ... and this one... (extant): ... and this one... (struct profile_block): ... with this new structure... (thread_count): ... this variable... (profile_blocks): ... and this variable. Update users. (struct profile_block): New function. (profile_stats_dump): Improve output. (profile_end): Increment SITE->NESTED_CALLS. (profile_start): Take additional parameter name2. Save it in SITE->NAME2. Call profile_block to get the thread's profile block. Remove initialization code. (profile_end): Call profile_block to get the thread's profile block. viengoos/ 2008-11-18 Neal H. Walfield <neal@gnu.org> * ager.c (ager_loop): Update use of profile_start to match new API. * pager.c (pager_collect): Likewise.
2008-11-14When dequeuing pages, use list_dequeue instead of list_unlink.Neal H. Walfield
2008-11-14 Neal H. Walfield <neal@gnu.org> * pager.c (reclaim_from): Use list_dequeue instead of list_unlink.
2008-11-12Introduce a list_dequeue function and rename list_queue to list_enqueue.Neal H. Walfield
2008-11-12 Neal H. Walfield <neal@gnu.org> * list.h (list_queue): Rename from this... (list_enqueue): ... to this. Update users. (list_dequeue): New function. (LIST_CLASS): Rename the generated queue function accordingly and update users. Generate a stub for dequeueing elements.
2008-11-12Add victim frames to the end of the eviction list.Neal H. Walfield
2008-11-12 Neal H. Walfield <neal@gnu.org> * pager.c (reclaim_from): Add victims to the end of the eviction list.
2008-11-04In the activity structure, use a pair of lists per priority level.Neal H. Walfield
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.
2008-07-042008-07-04 Neal H. Walfield <neal@gnu.org>neal
* pager.c (pager_collect): Start with a factor of 1, not 0, when calculating the impact of active pages. When calculating the number of frames available to an activity, cast the unsigned variables to ints. Correct the calculation of FRAMES. Bump VICTIM->FREE_ALLOCATIONS to a 1000. Always add GOAL to TOTAL_FREED when we send a memory pressure message.
2008-06-27hurd/neal
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.
2008-06-26Remove inadvertently committed debug code.neal
2008-06-262008-06-26 Neal H. Walfield <neal@gnu.org>neal
* pager.c (reclaim_from): Only update VICTIM's evicted statistic. Don't update its ancestors'.
2008-06-26hurd/neal
2008-06-26 Neal H. Walfield <neal@gnu.org> * cap.h (RM_object_name): Define. (struct object_name): New struct. (object_name): New method. viengoos/ 2008-06-26 Neal H. Walfield <neal@gnu.org> * rm.h (rm_method_id_string): Handle the RM_object_name case. * server.c (server_loop): Implement the object_name method. * activity.h (struct activity): New field name. * thread.h (struct thread): Likewise. * object.h (OBJECT_NAME_FMT): New macro. (OBJECT_NAME_PRINTF): Likewise. * activity.c: Include "thread.h". (do_activity_dump): Use OBJECT_NAME_FMT and OBJECT_NAME_PRINTF rather than OID_FMT and OID_PRINTF. (activity_dump): Only call do_activity_dump if debugging output is enabled. * pager.c: Include "thread.h". (pager_collect): Use OBJECT_NAME_FMT and OBJECT_NAME_PRINTF rather than OID_FMT and OID_PRINTF. * ager.c (update_stats): Likewise.
2008-06-23hurd/neal
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.
2008-06-232008-06-23 Neal H. Walfield <neal@gnu.org>neal
* pager.c: Include "profile.h". (pager_collect): Profile.
2008-06-232008-06-23 Neal H. Walfield <neal@gnu.org>neal
* pager.h (pager_min_alloc_before_next_collect): New declaration. (pager_collect_needed): Only collect if AVAILABLE_PAGES > PAGER_LOW_WATER_MARK and PAGER_MIN_ALLOC_BEFORE_NEXT_COLLECT > 0. (pager_collect_needed): Don't include the dirty, non-discardable pages when consider if a collection is required. * pager.c (pager_min_alloc_before_next_collect): New variable. (pager_collect): If we don't collect enough pages to exceed the high water mark, set PAGER_MIN_ALLOC_BEFORE_NEXT_COLLECT to two-thirds the available pages. * memory.c (memory_frame_allocate): On success, decrement PAGER_MIN_ALLOC_BEFORE_NEXT_COLLECT.
2008-06-232008-06-23 Neal H. Walfield <neal@gnu.org>neal
* activity.h (struct activity): Add field frames_pending_eviction. Note that we now include frames that are in the laundry in the FRAMES_TOTAL and FRAMES_LOCAL variables. * object.c (object_desc_claim): If claiming a non-discardable eviction candidate, update ACTIVITY's FRAMES_LOCAL, and it and its ancestors' FRAMES_TOTAL and FRAMES_PENDING_EVICTION fields. * pager.c (reclaim_from): Update VICTIM->FRAMES_LOCAL, FRAMES_TOTAL and FRAMES_PENDING_EVICTION appropriately. (process): If ACTIVITY_FRAMES is less than GOAL / 1000, don't bother collecting the activity. (pager_collect): Loop at most 8 times. Increase the active factor by two. When calling process, don't include the frames pending eviction.
2008-06-232008-06-23 Neal H. Walfield <neal@gnu.org>neal
* activity.h (struct activity): Add field priorities_count. * activity.c (activity_destroy): Update it. * object.c (object_desc_claim): Likewise. * pager.c (reclaim_from): Likewise.
2008-05-282008-05-28 Neal H. Walfield <neal@gnu.org>neal
* pager.c (pager_collect): Correctly parenthesize the use of <<.
2008-05-282008-05-28 Neal H. Walfield <neal@gnu.org>neal
* pager.c (pager_collect): Don't just consider the first-level activities, walk the activity hierarchy to find the victim.
2008-05-232008-05-23 Neal H. Walfield <neal@gnu.org>neal
* object.h (object_desc_flush): Take additional parameter, clear_kernel. If true, fetch the status bits corresponding to Viengoos even if the dirty bit is set. Update callers. * pager.c (is_clean): More thoroughly check that a page alleged to be clean is really all zeros.
2008-02-202008-02-20 Neal H. Walfield <neal@gnu.org>neal
* activity.h (struct activity): Unify the inactive_dirty and inactive_clean lists. Update users.
2008-02-182008-02-18 Neal H. Walfield <neal@gnu.org>neal
* pager.c (pager_collect): When looking for a victim activity, if none are found, repeat the process giving the number of active pages less weight. Fix asserts.
2008-02-16viengoos/neal
2008-02-16 Neal H. Walfield <neal@gnu.org> * object.h (kernel_lock): New declaration. Replace current locking scheme with this global lock variable. (lru_lock): Remove variable. (struct object_desc): Remove field lock. * object.c (kernel_lock): New variable. libc-parts/ 2008-02-16 Neal H. Walfield <neal@gnu.org> * process-spawn.c (process_spawn) [RM_INTERN]: Don't take LRU_LOCK.
2008-02-152008-02-15 Neal H. Walfield <neal@gnu.org>neal
* pager.h: Include "memory.h", "zalloc.h", and "object.h". (pager_collect): Take an additional argument goal and return an integer. (PAGER_LOW_WATER_MARK): New macro. (PAGER_HIGH_WATER_MARK): Likewise. (pager_collect_needed): New function. (pager_query): Likewise. * pager.c (LOW_WATER_MARK): Don't define. (HIGH_WATER_MARK): Likewise. (is_clean): New function. (reclaim_from): New function. Broken out of pager_collect. Correctly update statistics. (pager_collect): Take an additional argument goal and return an integer. Rewrite victim selection implementation. * memory.c (memory_frame_allocate): Call page_query. If zalloc fails, take from the available list. Add asserts. Don't clear memory if we get memory from zalloc.
2008-02-152008-02-15 Neal H. Walfield <neal@gnu.org>neal
* activity.h: Include "list.h". (LIST_CLASS_TYPE): Declare a activity_children list. (struct activity): Change children's type to a struct activity_children_list. Replace sibling_next and sibling_prev with sibling, a struct list_node. (activity_for_each_inmemory_child): Remove macro. * activity.c (children_list_insert_after): Remove function. Replace uses with appropriate list function. (children_list_detach): Likewise. * pager.c (pager_collect): Replace use of activity_for_each_inmemory_child with a list iterator. * ager.c (ager_loop): Likewise.
2008-02-152008-02-15 Neal H. Walfield <neal@gnu.org>neal
* pager.c (pager_collect): Replace use of object_desc_unmap with object_desc_flush.
2008-02-132008-02-13 Neal H. Walfield <neal@gnu.org>neal
* pager.c (pager_collect): If CHILD and VICTIM have the same weight steal from the activity with the larger number of pages.
2008-02-05hurd/neal
2008-02-05 Neal H. Walfield <neal@gnu.org> * activity.h (struct activity_stats): New structure. viengoos/ 2008-02-05 Neal H. Walfield <neal@gnu.org> * activity.h (struct activity): Add fields current_period and stats. (ACTIVITY_STATS): New macro. (ACTIVITY_STAT_UPDATE): Likewise. * ager.c (ager_loop): Gather statistics. * pager.c (pager_collect): Likewise.
2008-01-042008-01-04 Neal H. Walfield <neal@gnu.org>neal
* activity.h (struct activity): Add fields eviction_clean and eviction_dirty. Improve comments. (activity_charge): Change asserts to account for unsignedness. * activity.c (activity_destroy): Move all objects owned by VICTIM to its parent. (activity_deprepare): Add additional asserts. (do_activity_dump): Don't assert that ACTIVITY->FRAMES_LOCAL is the sum of the items on ACTIVITY's LRU lists. * object.h (struct object_desc): Add fields eviction_candidate, live, laundry_node and available_node. Make priority_node a union with activity_node, which replaces activity_lru. Remove field global_lru. (object_activity_lru): Rename this list class... (activity_lru): ... to this. Update users. (object_global_lru): Don't generate this list class. (eviction): Generate new list class. (available): Likewise. (laundry): Likewise. (global_active): Remove declaration. (global_inactive_dirty): Likewise. (global_inactive_clean): Likewise. (disowned): Likewise. (laundry): New declaration. (available): Likewise. (memory_object_destroy): Likewise. (object_desc_disown_simple): Remove declaration. (object_disown_simple): Remove function. (object_desc_disown): Likewise. (object_disown): Likewise. (object_desc_claim): Take additional parameter update_accounting. Update users. (object_claim): Likewise. (object_desc_unmap): New function. (object_age): Likewise. (objects_folio_offset): Likewise. (objects_folio): Likewise. (object_free): Implement in terms of the above two functions. * object.c (global_active): Remove variable. (global_inactive_dirty): Likewise. (global_inactive_clean): Likewise. (disowned): Likewise. (laundry): New variable. (available): Likewise. (memory_object_alloc): Initialize ODESC to 0. Call object_desc_claim to attach it to the relevant lists. Assert that ODESC->LIVE is 0. Set ODESC->LIVE to 1. (memory_object_destroy): Remove static qualifier. Require that LRU_LOCK be held on entry. Update users. Use object_desc_claim to disconnect DESC from any lists to which it is attached. Don't call memory_frame_free, that is now the caller's responsibility. Update users. Set DESC->LIVE to 0. (folio_free): Don't disown the folio header. (folio_object_alloc): Call memory_frame_free to really free the memory. (object_desc_disown_simple): Remove function. (object_desc_disown_): Likewise. (object_desc_claim): Take additional parameter update_accounting. If true, update the relevant activities' accounting information. Update connect and disconnect code. Only add an object to one of the priority tree and the lru lists, but not both. * viengoos.c (system_task_load): After allocating the root activity, have the root activity claim it and FOLIO. * ager.c: Include "zalloc.h". (AGE_DELTA): Don't define. (ager_loop): Rewrite to walk the object descriptors sequentially rather than following a linked list. Update object list connection and disconnection code. * pager.h: New file. * pager.c: Likewise. * Makefile.am (viengoos_SOURCES): Add pager.h and pager.c. * memory.h (struct activity): Add forward. (memory_frame_allocate): Take additional parameter activity. Return a uintptr_t instead of an l4_word_t. Update users. * memory.c: Include "pager.h" and "activity.h". (memory_grab): Always get base page sized pages. (memory_frame_allocate): Take additional parameter activity. Return a uintptr_t instead of an l4_word_t. If zalloc fails, check AVAILABLE_LIST. If nothing is applicable, call pager_collect and try again. * t-environment.h (pager_collect): New function.