From: Paul Khuong Date: Sun, 3 Jul 2011 01:52:50 +0000 (-0400) Subject: Lazier zero_dirty_pages in gencgc X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=9effe671fd4baacd924b58a25dac89587d38eb27;p=sbcl.git Lazier zero_dirty_pages in gencgc Upon allocation, only zero out pages that haven't already been cleared. --- diff --git a/src/runtime/gencgc-internal.h b/src/runtime/gencgc-internal.h index cdaa456..84178ad 100644 --- a/src/runtime/gencgc-internal.h +++ b/src/runtime/gencgc-internal.h @@ -82,7 +82,7 @@ struct page { * set. No other objects should be allocated to these pages. * This is only valid when the page is allocated. */ large_object :1, - /* True if the page is known to contain only zeroes. */ + /* Cleared if the page is known to contain only zeroes. */ need_to_zero :1; /* the generation that this page belongs to. This should be valid diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 1ea30b4..be5cc4b 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -627,13 +627,13 @@ zero_pages(page_index_t start, page_index_t end) { */ static void zero_dirty_pages(page_index_t start, page_index_t end) { - page_index_t i; + page_index_t i, j; for (i = start; i <= end; i++) { - if (page_table[i].need_to_zero == 1) { - zero_pages(start, end); - break; - } + if (!page_table[i].need_to_zero) continue; + for (j = i+1; (j <= end) && (page_table[j].need_to_zero); j++); + zero_pages(i, j-1); + i = j; } for (i = start; i <= end; i++) {