From 7a303c4def4eb1afab8198d7e7b2b2e4d343d1d9 Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Fri, 20 Oct 2017 16:43:00 -0400 Subject: [PATCH] Mostly revert 2df2efd246 That patch caused there to be more page-spanning objects, which is ok for code components (they are rarely touched) but not so great for other objects, because our algorithm for small-object pages forces more scavenging than desired- it can only stop on a page whose successor has scan_start_offset 0. Some improvements to that are pending. --- src/runtime/gencgc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index f1863d3cd..c3dfe88a0 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -1353,6 +1353,15 @@ gc_find_freeish_pages(page_index_t *restart_page_ptr, sword_t bytes, } else if (small_object && page_extensible_p(first_page, gc_alloc_generation, page_type_flag)) { bytes_found = GENCGC_CARD_BYTES - page_bytes_used(first_page); + // XXX: Prefer to start non-code on new pages. + // This is temporary until scavenging of small-object pages + // is made a little more intelligent (work in progress). + if (bytes_found < nbytes && page_type_flag != CODE_PAGE_FLAG) { + if (bytes_found > most_bytes_found) + most_bytes_found = bytes_found; + first_page++; + continue; + } } else { first_page++; continue; -- 2.11.4.GIT