summaryrefslogtreecommitdiff
path: root/mach-defpager/priv.h
AgeCommit message (Collapse)Author
2016-03-16Add getting swap information from swapon and procfsSamuel Thibault
* hurd/default_pager.defs (default_pager_storage_info): New RPC. * hurd/default_pager_reply.defs: Skip default_pager_storage_info RPC. * hurd/default_pager_types.h: Include <mach/machine/vm_types.h>. (vm_size_array_t): New type. * mach-defpager/priv.h (part): Add `name' field. * mach-defpager/default_pager.c (new_partition): Allocate and fill `part->name' field. Free it on error. (destroy_paging_partition): Free `part->name' field. (S_default_pager_storage_info): New function. * procfs/Makefile (SRCS): Add default_pagerUser.c. * procfs/rootdir.c: Include "default_pager_U.h". (rootdir_gc_swaps): New function. (rootdir_entries): Add "swaps" entry. * sutils/swapon.c: Include <argz.h> (show): New variable. (options): Add --show/-S option. (def_pager, dev_master): New variables (swaponoff): Move getting `def_pager' to... (get_def_pager): ... new function. (main): Support 'S' option. * trans/proxy-defpager.c (S_default_pager_storage_info): New function.
2014-03-25mach-defpager: replace the magic typecast with a hash tableJustus Winter
Previously, the mach-defpager used a "magic typecast" for object lookups. It renamed the port to the address of the associated object, and upon receiving a message it would cast the port name back to a pointer. While this might seem like an optimization, it actually makes the port handling in the kernel less efficient. Ports with small continuous names are stored in an array, while other ports get spilled in a splay tree. Replace the linked list of default_port_t objects with a hash table. Do not rename the ports, rather use the hash table to lookup objects associated with ports. * mach-defpager/default_pager.c (struct pager_port): Replace queue with hash table, remove count, move type declaration to priv.h. (pager_port_list_init): Adjust accordingly. (pager_port_list_insert): Likewise. (pager_port_list_delete): Likewise. (destroy_paging_partition): Replace queue_iterate with HURD_IHASH_ITERATE. (S_default_pager_objects): Likewise. (S_default_pager_object_pages): Likewise. (seqnos_memory_object_create): Do not rename the port but store it in the hash table. (S_default_pager_object_create): Likewise. * mach-defpager/priv.h (struct dstruct): Add fast-removal pointer. (pnameof): Remove obsolete macro definition. (dnameof): Likewise. * mach-defpager/mig-decls.h (begin_using_default_pager): Replace the magic typecast with a hash table lookup. * mach-defpager/Makefile (HURDLIBS): Add ihash.
2014-03-25mach-defpager: fix receiver lookupsJustus Winter
Previously, the receiver lookup was done manually in all the server functions. Use mig translator functions instead. * mach-defpager/mig-decls.h: New file. * mach-defpager/mig-mutate.h: Likewise. * mach-defpager/Makefile (MIGSFLAGS): Include mig-mutate.h. * mach-defpager/mach-defpager.c: Fix receiver lookups, move type definitions... * mach-defpager/priv.h: ... here, so that they can be used in mig-decls.h.