diff options
author | neal <neal> | 2008-06-16 21:27:40 +0000 |
---|---|---|
committer | neal <neal> | 2008-06-16 21:27:40 +0000 |
commit | 0cc9b9efcad805a9118c368b72b13417315526c9 (patch) | |
tree | 03548e0caa9ec35d3f5326195e9b3ecc30d40679 /benchmarks | |
parent | 64639177cfc19f25b4c65ec7a8f8af110264c907 (diff) |
libhurd-mm/
2008-06-16 Neal H. Walfield <neal@gnu.org>
* map.h: New file.
* map.c: New file.
* Makefile.am (libhurd_mm_a_SOURCES): Add map.h and map.c.
* headers.m4: Link map.h to sysroot/include/hurd/map.h.
* pager.h: Rewrite.
* pager.c: Likewise.
* anonymous.h (ANONYMOUS_STAGING_AREA): New define.
(anonymous_pager_fill_t): Don't pass the base of the region. Pass
the location of the storage corresponding to the pages on which
the faults were raised and the offset into the region. Update
users.
(struct anonymous_pager): Add fields map_area, map_area_count and
lock. Remove field alloced_region.
(anonymous_pager_alloc): Replace size parameter with length
parameter. Take access parameter indicating the desired access.
Update users.
* anonymous.c (offset_compare): Compare the values, not the
pointers.
(fault): Update signature to be consistent with new API. Lock
ANON->LOCK. Always look up the storage descriptor corresponding
to the faulted page. Copy the storage to the faulted address as
required. Update how we call ANON->FILL to be consistent with the
new API.
(destroy): Free ANON->STAGING_AREA.
(anonymous_pager_alloc): Update signature to be consistent with
new API. Allocate the staging area if ANONYMOUS_STAGING_AREA is
set. Allocate it separately from the main map. Create a map
corresponding to the region.
(anonymous_pager_destroy): Just lock ANON->LOCK. Don't call
destroy, call pager_deinit.
* mmap.c: Include <hurd/map.h>.
(mmap): Add support for protection other than read/write.
(munmap): Rewrite to use new API. Use map_split to support
splitting of memory maps.
* exceptions.c: Don't include "pager.h", include "map.h".
(exception_handler_normal): Don't call pager_fault but map_fault.
(exception_handler_activated): Likewise.
ruth/
2008-06-16 Neal H. Walfield <neal@gnu.org>
* ruth.c (main): Improve mmap test. Update use of
anonymous_pager_alloc to be consistent with new API. Update fill
functions to be consistent with new API. Remove redundant test.
benchmarks/
2008-06-16 Neal H. Walfield <neal@gnu.org>
* activity-distribution.c (main): Update use of
anonymous_pager_alloc to be consistent with new API. Update fill
functions to be consistent with new API.
Diffstat (limited to 'benchmarks')
-rw-r--r-- | benchmarks/ChangeLog | 6 | ||||
-rw-r--r-- | benchmarks/activity-distribution.c | 21 |
2 files changed, 21 insertions, 6 deletions
diff --git a/benchmarks/ChangeLog b/benchmarks/ChangeLog index 5444d97..dabe13a 100644 --- a/benchmarks/ChangeLog +++ b/benchmarks/ChangeLog @@ -1,5 +1,11 @@ 2008-06-16 Neal H. Walfield <neal@gnu.org> + * activity-distribution.c (main): Update use of + anonymous_pager_alloc to be consistent with new API. Update fill + functions to be consistent with new API. + +2008-06-16 Neal H. Walfield <neal@gnu.org> + * shared-memory-distribution.c (main): Set NEXT_PERIOD based on the first stat buffer, not the last one. diff --git a/benchmarks/activity-distribution.c b/benchmarks/activity-distribution.c index 1f5be81..e287d28 100644 --- a/benchmarks/activity-distribution.c +++ b/benchmarks/activity-distribution.c @@ -70,11 +70,13 @@ main (int argc, char *argv[]) printf ("%d kb memory available\n", available / 1024); bool my_fill (struct anonymous_pager *anon, - void *base, uintptr_t offset, - uintptr_t pages, + uintptr_t offset, uintptr_t count, + void *pages[], struct exception_info info) { - * (int *) (base + offset) = 1; + uintptr_t *p = pages[0]; + p[0] = offset; + p[1] = l4_myself (); return true; } @@ -107,7 +109,7 @@ main (int argc, char *argv[]) /* Allocate a (discardable) buffer. */ { pagers[i] - = anonymous_pager_alloc (ADDR_VOID, NULL, SIZE, + = anonymous_pager_alloc (ADDR_VOID, NULL, SIZE, MAP_ACCESS_ALL, OBJECT_POLICY (true, OBJECT_PRIORITY_LRU), 0, my_fill, &buffers[i]); @@ -116,8 +118,15 @@ main (int argc, char *argv[]) } int j; - for (j = 0; j < SIZE / PAGESIZE; j ++) - t += * (int *) (buffers[i] + j * PAGESIZE); + for (j = 0; j < SIZE; j += PAGESIZE) + { + uintptr_t *p = buffers[i] + j; + assertx (p[0] == j && p[1] == l4_myself (), + "%x: %x =? %x, thread: %x", + p, p[0], j, p[1]); + + t += * (int *) (buffers[i] + j); + } /* 100ms. */ l4_sleep (l4_time_period (100 * 1000)); |