From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] ffi/gc: restore back rehashing of finalizers table
Date: Fri, 21 Mar 2025 13:17:53 +0000 [thread overview]
Message-ID: <Z91nAbHcXglL1qAF@tarantool.org> (raw)
In-Reply-To: <20250320162018.13257-1-skaplun@tarantool.org>
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
>
<snipped>
> --
> 2.48.1
>
--
Best regards,
IM
next prev parent reply other threads:[~2025-03-21 13:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-20 16:20 Sergey Kaplun via Tarantool-patches
2025-03-20 19:29 ` Sergey Kaplun via Tarantool-patches
2025-03-21 10:28 ` Sergey Bronnikov via Tarantool-patches
2025-03-21 13:17 ` Igor Munkin via Tarantool-patches [this message]
2025-03-21 13:24 ` Sergey Kaplun via Tarantool-patches
2025-03-26 8:54 ` Sergey Kaplun via Tarantool-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z91nAbHcXglL1qAF@tarantool.org \
--to=tarantool-patches@dev.tarantool.org \
--cc=imun@tarantool.org \
--cc=skaplun@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH luajit] ffi/gc: restore back rehashing of finalizers table' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox