summaryrefslogtreecommitdiff
path: root/libpager/pagemap.c
AgeCommit message (Collapse)Author
2021-05-07libpager: Properly zero-initialize pagemapSergey Bugaev
Unlike mmap () and calloc (), reallocarray () does not automatically zero-fill the newly allocated memory. Do so explicitly. Message-Id: <CAN9u=Hd21Es7Kc4tVBAUeLaKo9CWKO1e577TqnXMzmmvwLi22Q@mail.gmail.com>
2021-05-07libpager: Use libc heap for pagemapSergey Bugaev
libc already implements the functionality for allocating and managing memory blocks like the pagemap. Using libc functions gives us some additional niceties like overflow checking in reallocarray (). it also means that we will not allocate a whole page of memory if we need to store just a few integers. Message-Id: <20210506125631.79117-7-bugaevc@gmail.com>
2021-05-07libpager: Fix overallocating pagemapSergey Bugaev
The code tried to round up the allocation size to a multiple of page size. But we actually allocate newsize * sizeof (*p->pagemap) bytes, not newsize bytes, which meant allocations were sizeof (*p->pagemap) times larger than they needed to be. Message-Id: <20210506125631.79117-6-bugaevc@gmail.com>
2021-05-06libpager: Store pagemapsize as vm_size_tSergey Bugaev
On a 64-bit system, there can be a lot more pages than a 32-bit int can fit. Message-Id: <20210506125631.79117-5-bugaevc@gmail.com>
2014-12-10Replace `bcopy' with `memcpy' or `memmove' as appropriateJustus Winter
* ext2fs/inode.c: Replace `bcopy' with `memcpy' or `memmove' as appropriate. * ext2fs/pager.c: Likewise. * isofs/lookup.c: Likewise. * isofs/main.c: Likewise. * isofs/rr.c: Likewise. * libdiskfs/file-get-trans.c: Likewise. * libiohelp/return-buffer.c: Likewise. * libpager/pagemap.c: Likewise. * libpipe/pq.c: Likewise. * libpipe/pq.h: Likewise. * libstore/unzipstore.c: Likewise. * mach-defpager/default_pager.c: Likewise. * pfinet/ethernet.c: Likewise. * pfinet/tunnel.c: Likewise. * storeio/dev.c: Likewise.
2000-07-252000-07-25 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* priv.h (PM_WRITEWAIT): New pagemap bit. * data-return.c (_pager_do_write_request): Don't proceed with a pageout if one is already in progress. Once we finish, wake up any potential PM_WRITEWAIT waiters. * priv.h (PM_INIT): Provide value again. * data-return.c (_pager_do_write_request): Track PM_INIT again. * priv.h (struct pager): Make pagemap consist of 16-bit elements instead of only 8 bits. * data-request.c (_pager_seqnos_memory_object_data_request): Make PM_ENTRY a short pointer. * data-return.c (_pager_do_write_request): Make PM_ENTRIES a short pointer. * lock-object.c (_pager_lock_object): Make PM_ENTRIES a short pointer. * mark-error.c (_pager_mark_next_request_error): Make P a short pointer. (_pager_mark_object_error): Likewise. * offer-page.c (pager_offer_page): Make PM_ENTRY a short pointer. * object-terminate.c (_pager_free_structure): Interpret pagemapsize correctly. * pagemap.c (_pager_pagemap_resize): Likewise.
1999-07-111999-07-09 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* pagemap.c (_pager_pagemap_resize): Use mmap instead of vm_allocate.
1999-07-031999-07-03 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* data-return.c (_pager_do_write_request): Use munmap instead of vm_deallocate. * object-terminate.c (_pager_free_structure): Likewise. * pagemap.c (_pager_pagemap_resize): Likewise. * pager-memcpy.c (pager_memcpy): Likewise. * pager.h (pager_write_page): Doc adjustment.
1997-02-12(_pager_pagemap_resize):Miles Bader
Return errors.
1994-01-25entered into RCSMichael I. Bushnell
1994-01-22Formerly pagemap.c.~3~Michael I. Bushnell
1994-01-19Formerly pagemap.c.~2~Michael I. Bushnell
1994-01-13Initial revisionMichael I. Bushnell