From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: [RFC] proof-of-concept generational GC survives the bootstrap Date: Tue, 04 Sep 2012 19:03:07 +0400 Message-ID: <5046182B.3080202@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000506080306000902030302" X-Trace: ger.gmane.org 1346771024 27477 80.91.229.3 (4 Sep 2012 15:03:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Sep 2012 15:03:44 +0000 (UTC) To: Emacs development discussions Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 04 17:03:43 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T8ufE-0004hG-BK for ged-emacs-devel@m.gmane.org; Tue, 04 Sep 2012 17:03:40 +0200 Original-Received: from localhost ([::1]:45196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8ufB-0005gk-Fx for ged-emacs-devel@m.gmane.org; Tue, 04 Sep 2012 11:03:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8uex-0005BE-D7 for emacs-devel@gnu.org; Tue, 04 Sep 2012 11:03:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8uel-0007ck-5Z for emacs-devel@gnu.org; Tue, 04 Sep 2012 11:03:23 -0400 Original-Received: from forward15.mail.yandex.net ([95.108.130.119]:57613) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8uek-0007bQ-0W for emacs-devel@gnu.org; Tue, 04 Sep 2012 11:03:11 -0400 Original-Received: from smtp13.mail.yandex.net (smtp13.mail.yandex.net [95.108.130.68]) by forward15.mail.yandex.net (Yandex) with ESMTP id 3941F9E1F9E for ; Tue, 4 Sep 2012 19:03:07 +0400 (MSK) Original-Received: from smtp13.mail.yandex.net (localhost [127.0.0.1]) by smtp13.mail.yandex.net (Yandex) with ESMTP id 25EE2E40146 for ; Tue, 4 Sep 2012 19:03:07 +0400 (MSK) Original-Received: from unknown (unknown [37.139.80.10]) by smtp13.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 369KkdYR-369K1tcf; Tue, 4 Sep 2012 19:03:06 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1346770987; bh=JrdLt8tPodWWg2zmoqN2Cv6wvJ8+K7IhI6cA1XN72PE=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type; b=c+X7bCh+h18lZZ91W8BfJxmsI0nNFMxOjW7z/WjO8iQuwwZIROBxRU/fnFBkmxrZv 05tSVEHQ4/h0b/dIK2H8KJaXL65AYuSKNjobUOQZOOFFKsrNIvXWbLJJ37+OVxb1LY ymzA+DIyuc7SmjYwUSOVdryraUU+aEametFQLiD0= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120824 Thunderbird/15.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 95.108.130.119 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152992 Archived-At: This is a multi-part message in MIME format. --------------000506080306000902030302 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit This is a patch against bzr trunk 109851, ant it passes the full bootstrap for me. It's also alive with basic editing operations, but most probably will crash quite soon. There isn't too much comments yet, so I tried to write some notices below. * Object life cycle Each object contains 'struct gc_info' which is used to store additional object information. Allocation routines should call gengc_init to initialize 'gcinfo' slot of the object; it should specify correct GC_OBJ_xxx type and one of GC_NEW (if object will be immediately used) or GC_FREE (if the object will join a free list). If an object survives the GC, gengc_promote should be called to adjust object as GC_OLD; if an object dies, gengc_exit should be called for it. * Write barrier The main routine is gengc_write_barrier; convenient wrappers are gengc_object_write_barrier and PTR_BARRIER/VECTOR_BARRIER macros. Inter-generational objects are stored in gengc_objects without duplications; to record special values, Lisp_Misc_Save_Value is (ab)used to hold either interval pointer or Lisp_Object address. The last one (via gengc_record_address) is used when an Lisp_Object slot's address is obtained; since we can't assume what object type will be written to it (and whether something will be written at all), we conservatively assume that GC_NEW object will be written to this slot of GC_OLD object, and so the slot is a subject for marking traversal during generational collection. * Mark/sweep Collection scheduling is fairly simple: each odd collection is generational, and each even collection is full. During generational collection, only GC_NEW objects are marked with mark_object; the same applies to sweeping (gengc_sweep controls it); gengc_collect tries to collect some statistics about objects (set EMACS_GENGC_VERBOSE environment variable to see it). Dmitry --------------000506080306000902030302 Content-Type: text/plain; charset=UTF-8; name="gengc.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="gengc.patch" PT09IG1vZGlmaWVkIGZpbGUgJ3NyYy9hbGxvYy5jJwotLS0gc3JjL2FsbG9jLmMJMjAxMi0w OC0zMSAxMDo1MzoxOSArMDAwMAorKysgc3JjL2FsbG9jLmMJMjAxMi0wOS0wNCAxNDowODoz MSArMDAwMApAQCAtMTg5LDYgKzE4OSwyNiBAQAogc3RhdGljIEVNQUNTX0lOVCB0b3RhbF9m cmVlX2NvbnNlcywgdG90YWxfZnJlZV9tYXJrZXJzLCB0b3RhbF9mcmVlX3N5bWJvbHM7CiBz dGF0aWMgRU1BQ1NfSU5UIHRvdGFsX2ZyZWVfZmxvYXRzLCB0b3RhbF9mbG9hdHM7CiAKKy8q IE5ldyBnZW5nYyB2YXJpYWJsZXMuICAqLworC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HMuICAqLworICBnLT5nY3R5cGUgPSBHQ19GUkVFOworICBnLT5v Ymp0eXBlID0gR0NfT0JKX0ZSRUU7CisgIGctPmdlbmVyYXRpb24gPSAtMTsKK30KKworLyog Q29sbGVjdCBzb21lIHN0YXRpc3RpY3MgYWJvdXQgb2JqZWN0cyB3ZSdyZSBtYXJraW5nLiAg Ki8KKwordm9pZAorZ2VuZ2NfY29sbGVjdCAoc3RydWN0IGdjX2luZm8gKmcpCit7CisgIGVh c3NlcnQgKGcgIT0gTlVMTCk7CisgIGlmIChnLT5hY2NvdW50ID09IDApCisgICAgeworICAg ICAgaWYgKGctPmdjdHlwZSA9PSBHQ19PTEQpCisJb2xkX29iamVjdHNfcmVhY2hlZCsrOwor ICAgICAgZWxzZSBpZiAoZy0+Z2N0eXBlID09IEdDX05FVykKKwluZXdfb2JqZWN0c19yZWFj aGVkKys7CisgICAgICBlbHNlIGlmIChnLT5nY3R5cGUgPT0gR0NfRlJFRSB8fCBnLT5nY3R5 cGUgPT0gR0NfUFVSRSkKKwl7CisJICBMaXNwX09iamVjdCBvd25lciA9IGdldF9nY19pbmZv X29iaiAoZyk7CisKKwkgIGlmIChJTlRFR0VSUCAob3duZXIpKQorCSAgICBmcHJpbnRmIChz dGRlcnIsICIqKiogbWFya2luZyBvYmplY3Qgd2l0aCBnY3R5cGUgJWRcbiIsIGctPmdjdHlw ZSk7CisJICBlbHNlCisJICAgIGZwcmludGYgKHN0ZGVyciwgIioqKiBtYXJraW5nIG9iamVj dCAlbHggKHR5cGUgJWQpIHdpdGggZ2N0eXBlICVkXG4iLAorCQkgICAgIFhMSSAob3duZXIp LCBYVFlQRSAob3duZXIpLCBnLT5nY3R5cGUpOworCSAgYWJvcnQgKCk7CisJfQorICAgICAg Zy0+YWNjb3VudCA9IDE7CisgICAgfQorfQorCisvKiBTaG93IGNvbGxlY3RlZCBzdGF0aXN0 aWNzIGFuZCByZXNldCBjb3VudGVycy4gICovCisKK3N0YXRpYyB2b2lkCitzaG93X2djX2lu Zm8gKHZvaWQpCit7CisgIGlmIChnZW5nY192ZXJib3NlKQorICAgIHsKKyAgICAgIGRvdWJs ZSBuZXdvYmpzLCBvbGRvYmpzLCB0b3RhbG9ianM7CisKKyAgICAgIG9sZG9ianMgPSBvbGRf b2JqZWN0c19yZWFjaGVkOworICAgICAgbmV3b2JqcyA9IG5ld19vYmplY3RzX3JlYWNoZWQ7 CisgICAgICB0b3RhbG9ianMgPSBvbGRvYmpzICsgbmV3b2JqczsKKyAgICAgIGZwcmludGYg KHN0ZGVyciwgIiVsZCAoJS4yZiUlKSBvbGQgKyAlbGQgKCUuMmYlJSkgbmV3IG9iamVjdHMg bWFya2VkXG4iLAorCSAgICAgICBvbGRfb2JqZWN0c19yZWFjaGVkLCBvbGRvYmpzIC8gdG90 YWxvYmpzICogMTAwLjAsIAorCSAgICAgICBuZXdfb2JqZWN0c19yZWFjaGVkLCBuZXdvYmpz IC8gdG90YWxvYmpzICogMTAwLjApOworCisgICAgICBvbGRvYmpzID0gb2xkX29iamVjdHNf ZGllZDsKKyAgICAgIG5ld29ianMgPSBuZXdfb2JqZWN0c19kaWVkOworICAgICAgdG90YWxv YmpzID0gb2xkb2JqcyArIG5ld29ianM7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIlbGQg KCUuMmYlJSkgb2xkICsgJWxkICglLjJmJSUpIG5ldyBvYmplY3RzIGRpZWRcbiIsCisJICAg ICAgIG9sZF9vYmplY3RzX2RpZWQsIG9sZG9ianMgLyB0b3RhbG9ianMgKiAxMDAuMCwgCisJ ICAgICAgIG5ld19vYmplY3RzX2RpZWQsIG5ld29ianMgLyB0b3RhbG9ianMgKiAxMDAuMCk7 CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIlbGQgb2JqZWN0cyBwcm9tb3RlZFxuXG4iLCBv YmplY3RzX3Byb21vdGVkKTsKKyAgICB9CisKKyAgb2xkX29iamVjdHNfcmVhY2hlZCA9IG5l d19vYmplY3RzX3JlYWNoZWQgPSAwOworICB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IChvYmopLT5oZWFkZXIuZ2NpbmZv KTsKKworICAgIGNhc2UgTGlzcF9GbG9hdDoKKyAgICAgIHJldHVybiAmKFhGTE9BVCAob2Jq KS0+Z2NpbmZvKTsKKworICAgIGNhc2UgTGlzcF9TeW1ib2w6CisgICAgICByZXR1cm4gJihY U1lNQk9MIChvYmopLT5nY2luZm8pOworCisgICAgY2FzZSBMaXNwX01pc2M6CisgICAgICBy ZXR1cm4gJihYTUlTQ0FOWSAob2JqKS0+Z2NpbmZvKTsKKworICAgIGRlZmF1bHQ6CisgICAg ICBhYm9ydCAoKTsKKyAgICB9Cit9CisKKy8qIEdldCBMaXNwX09iamVjdCB0aGlzIEdDIGlu Zm8gYmVsb25ncyB0by4gICovCisKK0xJU1BfSU5MSU5FIExpc3BfT2JqZWN0CitnZXRfZ2Nf aW5mb19vYmogKHN0cnVjdCBnY19pbmZvICpnKQoreworICBMaXNwX09iamVjdCBvYmo7CisK KyAgZWFzc2VydCAoZyAhPSBOVUxMKTsKKworICBzd2l0Y2ggKGctPm9ianR5cGUpCisgICAg eworICAgIGNhc2UgR0NfT0JKX1NZTUJPTDoKKyAgICAgIFhTRVRTWU1CT0wgKG9iaiwgKGNo YXIgKikgZyAtIG9mZnNldG9mIChzdHJ1Y3QgTGlzcF9TeW1ib2wsIGdjaW5mbykpOworICAg ICAgYnJlYWs7CisKKyAgICBjYXNlIEdDX09CSl9NSVNDOgorICAgICAgWFNFVE1JU0MgKG9i aiwgKGNoYXIgKikgZyAtIG9mZnNldG9mIChzdHJ1Y3QgTGlzcF9NaXNjX0FueSwgZ2NpbmZv KSk7CisgICAgICBicmVhazsKKworICAgIGNhc2UgR0NfT0JKX1NUUklORzoKKyAgICAgIFhT RVRTVFJJTkcgKG9iaiwgKGNoYXIgKikgZyAtIG9mZnNldG9mIChzdHJ1Y3QgTGlzcF9TdHJp bmcsIGdjaW5mbykpOworICAgICAgYnJlYWs7CisKKyAgICBjYXNlIEdDX09CSl9WRUNUT1I6 CisgICAg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