From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 7EF3ACED624; Sat, 7 Sep 2024 08:15:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7EF3ACED624 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1725686158; bh=kRmDbFKZK7I80jzxpHXCdKIY0HkALUDYlsIVuDH7dPw=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=SX6HpiFGqanloyg1PsIGCiP+wN1Ps08rwE2DNVNizX4jS1Te06EDnETOn64rXEYYK LwV3Ixp7ZdZyUGd1UmeKmj18jLxB17HowvAqo6s97gtlTHkgzFb/ByiavPx8ZmeOFv pt/iak8oucilvK+sIWm1piexzrLD5U6TocqcB5eE= Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [95.163.41.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 57EDFCED622 for ; Sat, 7 Sep 2024 08:15:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 57EDFCED622 Received: by smtp57.i.mail.ru with esmtpa (envelope-from ) id 1smnnf-00000006Qo3-2nuI; Sat, 07 Sep 2024 08:15:56 +0300 Date: Sat, 7 Sep 2024 08:15:47 +0300 To: Sergey Bronnikov Message-ID: References: <20240902125421.16727-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD926A78C5ED38029837670E18678F607362FA6E331F31AC671182A05F538085040614BBF8E273ED63B2EB5D77EF37489D15C5270D006D220E0E07A2BD39170E35CEED4BE88F6E8E844 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F2EC3597058CFA6DEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CE3A619BB4CB99268638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D802A7B3A41F5CD3C9C7CDC325587E5FC5A61E6BD733BB24A6CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637F924B32C592EA89F389733CBF5DBD5E9B5C8C57E37DE458B9E9CE733340B9D5F3BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735BA6625F88748EAEFC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5CEBDDBCD52BE91405002B1117B3ED6969A53647993461344A13BD6A4B0E00B96823CB91A9FED034534781492E4B8EEAD4ECBDE8281F904F9BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34EE19B6E2433CA0936846BE652B721F6A446A323EBD795ED65BF1C7C5798E60562DE1FC7799D79C921D7E09C32AA3244C241A0B982047D023A0CBE312C330D7D5066E62A182CE069CEA455F16B58544A2557BDE0DD54B3590A5AE236DF995FB59829709634694AABAED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojVp03gUc8VenO6bZUu1mrnA== X-DA7885C5: 4F9DCE9F8B525A9EF255D290C0D534F9EAB8FC266788DF7F99149624EF41405846B02BE3DA47B2C05B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393C6D0B12EA33CAA9BF3297FAAEA171A9C6118D83E3AB8DA25CC9BAF1F28BBEDF1E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] FFI: Drop finalizer table rehash after GC cycle. X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the review! Fixed your comments, rebased the branch on the tarantool/master and force-pushed it. On 06.09.24, Sergey Bronnikov wrote: > Hi, Sergey! > > > thanks for the patch! LGTM with minor comments below > > On 02.09.2024 15:54, Sergey Kaplun wrote: > > From: Mike Pall > > > > Reported by Sergey Kaplun. > > > > (cherry picked from commit fb22d0f80f291827a4004e16bc589b54bcc4a3c7) > > > > The raising of the OOM error when rehashing the finalizer table (when we > > can't allocate a new hash part) leads to crashes in either > > `lj_trace_exit()` or `lj_trace_unwind()` due to unprotected error > > raising, which either has no DWARF eh_frame or loses the context of the > > I would add a link to a page about eh_frame, for example [1] > > Feel free to ignore. > > 1. > https://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html Added, thanks. > > > JIT compiler. > > > > This patch drops rehashing of the finalizer table to avoid these > > I would replace "finalizer" with "cdata finalizer". > > And I would say about drawbacks of this. Otherwise, it looks like Added. See the new commit message below: | FFI: Drop finalizer table rehash after GC cycle. | | Reported by Sergey Kaplun. | | (cherry picked from commit fb22d0f80f291827a4004e16bc589b54bcc4a3c7) | | The raising of the OOM error when rehashing the finalizer table (when we | can't allocate a new hash part) leads to crashes in either | `lj_trace_exit()` or `lj_trace_unwind()` due to unprotected error | raising, which either has no DWARF eh_frame [1] or loses the context of | the JIT compiler. | | This patch drops rehashing of the cdata finalizer table to avoid these | crashes. It will prevent the cdata finalizer table from shrinking when | the huge amount of the cdata objects is collected by the GC. OTOH, the | finzlizer table most probably will grop anyway to the old size, so this | is not crucial. | | Sergey Kaplun: | * added the description and the test for the problem | | [1]: https://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html | | Part of tarantool/tarantool#10199 | Resolves tarantool/tarantool#10290 > > rehashing was not needed from the beginning. > > > crashes. > > > > Sergey Kaplun: > > * added the description and the test for the problem > > > > Part of tarantool/tarantool#10199 > > Resolves tarantool/tarantool#10290 > Usually "Closes" or "Fixes". Feel free to ignore. For LuaJIT, we always use "Resolves", since it is __closed__ when the submodule is bumped in the release branches and master. > > --- > > > > Branch:https://github.com/tarantool/luajit/tree/skaplun/lj-1247-fin-tab-rehashing-on-trace > > Related Issues: > > *https://github.com/tarantool/tarantool/issues/10290 > > *https://github.com/LuaJIT/LuaJIT/issues/1247 > > *https://github.com/tarantool/tarantool/issues/10199 > > -- Best regards, Sergey Kaplun