-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize lseek/read calls in GC_soft_read_dirty (Linux)
Issue #265 (bdwgc). Do not call read(/proc/self/pagemap) if the requested data is already in the buffer (at least partially). Call lseek only when needed and seek to page-aligned positions. * os_dep.c [SOFT_VDB] (VDB_BUF_SZ): Do not define if already defined. * os_dep.c [SOFT_VDB] (pagemap_buf_fpos, pagemap_buf_len): New static variable. * os_dep.c [SOFT_VDB] (pagemap_buffered_read): New static function (move lseek() and PROC_READ() calls from soft_set_grungy_pages). * os_dep.c [SOFT_VDB] (soft_set_grungy_pages): Call pagemap_buffered_read() to get bufp content; remove TODO items; do not abort if incomplete read not multiple of entry size (issue WARN and handle it correctly). * os_dep.c [SOFT_VDB] (GC_soft_read_dirty): Move assertion about GC_page_size to soft_set_grungy_pages(); invalidate soft_vdb_buf when GC_grungy_pages array is cleared; pass the start of next region to soft_set_grungy_pages (as a hint).
- Loading branch information
Showing
1 changed file
with
98 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters