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 95E14730326; Fri, 21 Mar 2025 16:20:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 95E14730326 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1742563258; bh=VKbrnfWqrXeSM36WiwUdjT6n5hHk13QtoZb3krGyKZM=; 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=acOY4e0+IpkDOrTaUVggYvSN7ilu4BptHOLD1W/UsIcfhCUoMe/MYGo58ZXbRINkK BWbZHftmrNZbMkW12k7ZHUoGXym8/rTu4EaHFULj33cb/7vjOi3od25MjNcB/Ztgz3 KFwyfbeAj0ZLaJHx4ZRPP/W5QHwFfp9cOfEVeYhA= Received: from send152.i.mail.ru (send152.i.mail.ru [89.221.237.247]) (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 1A2F6730326 for ; Fri, 21 Mar 2025 16:20:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1A2F6730326 Received: by exim-smtp-75f69ddc6c-f9b5f with esmtpa (envelope-from ) id 1tvcIy-00000000LW5-0ge2; Fri, 21 Mar 2025 16:20:56 +0300 Date: Fri, 21 Mar 2025 13:17:53 +0000 To: Sergey Kaplun Message-ID: References: <20250320162018.13257-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20250320162018.13257-1-skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92A53477891B58793E614F6A1CAB05B9FEE21BD121D6F0C23182A05F5380850402FB53DFC4680890A3DE06ABAFEAF6705BC6CF091B34D6821C5D1FF1886720349CFC0F0949690F79B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7B114C2C2C20B7E62EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566C835A30D5A7E169F3271667A7D8665C722BC8BFB377C05664526F52591FF69A0389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0ECC8AC47CD0EDEFF8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B65FF0BFC5AEE34BE6CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C224996AFF475DCAA52263AA81AA40904B5D9CF19DD082D7633A0C84D3B47A649675F3AA81AA40904B5D98AA50765F7900637D25329B51072FB6AEC76A7562686271ED91E3A1F190DE8FD2E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298D5E8D9A59859A8B6D082881546D9349175ECD9A6C639B01B78DA827A17800CE70C86C1DC21A599BB731C566533BA786AA5CC5B56E945C8DA X-87b9d050: 1 X-C1DE0DAB: 0D63561A33F958A587F1CA059622E9A95002B1117B3ED6968553B84288A264A1E99897350C7C491E823CB91A9FED034534781492E4B8EEADF5E532225D4D775BBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742DC8270968E61249B1004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34BDCC71B3781C9C959B4856D8D33291ED5E9DD4F6F800CB81C11195C7F4040B444287E1AA97DA3B551D7E09C32AA3244CEE14AEB530F92BFD77DD89D51EBB7742179B70A8FBB088D9EA455F16B58544A2557BDE0DD54B3590E9CAF2BECF134D6894F255A82739648EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVRxnlmV4XzQlRFu1becaux8= X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D53148E8F30E79587ABE0B9BF4F79351F7574FC75576606EBD32043E7F37D901F8A3F5EE5212A79745119D086FC03DADA47A24EDF3BD9585A06DEEABBE9EE6587A054198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] ffi/gc: restore back rehashing of finalizers table 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Sergey, Thanks for the patch! For the history: as we discussed, the patch LGTM. BTW, I'd rather prefer to split the revert and the fix into two separate patches, but I haven't been here for so long since you're in charge ;) On 20.03.25, Sergey Kaplun via Tarantool-patches wrote: > This is a follow-up to the commits > 2115828bc6fae911215cd07593df2ae0a83a0f42 ("FFI: Drop finalizer table > rehash after GC cycle.") and bfcbaa70e7b3e720578c05db3f66d832419e8566 > ("Drop unused function wrapper."). After them, the rehashing of the cdata > finalizer table at the end of the GC cycle is dropped. Without > reshashing of this table, the table increases the estimated amount of > memory for the GC. Hence, with the bigger `estimate`, the threshold > before starting the GC cycle is increased too. This allows allocating > more cdata objects and increasing the size of the finalizer table again. > This increases the memory estimate again and so on. As a result, we have > unlimited memory growth without rehashing of the table for the > cdata-intensive workloads. > > This patch reverts back the code changes (but not the test) of the > aforementioned commits. Also, it fixes the possible crash after > rehashing of the cdata finalizers table by adding the protected call to > the GC steps on the trace itself and on the trace exit. > --- > > Branch: https://github.com/tarantool/luajit/tree/refs/heads/skaplun/gh-noticket-fix-gc-finalizer-pressure > Related issue: https://github.com/LuaJIT/LuaJIT/issues/1350 > > See also: > * https://github.com/LuaJIT/LuaJIT/issues/1247 > * https://github.com/LuaJIT/LuaJIT/pull/946 > > src/lj_gc.c | 31 +++++++++- > src/lj_obj.h | 2 +- > src/lj_tab.c | 7 +++ > src/lj_tab.h | 3 + > src/lj_trace.c | 20 +++++- > ...lj-1350-fix-gc-finalizer-pressure.test.lua | 61 +++++++++++++++++++ > 6 files changed, 119 insertions(+), 5 deletions(-) > create mode 100644 test/tarantool-tests/lj-1350-fix-gc-finalizer-pressure.test.lua > > -- > 2.48.1 > -- Best regards, IM