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 A799DCD3380; Thu, 6 Jun 2024 13:53:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A799DCD3380 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1717671204; bh=3Pn74JUec6tJQukyPRCIwkMRYC1swKaPSSUULrpwqks=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Z5NuX3ZLaf1TfRq0ooEv7kaPHcw+TtjBISzDEONmztVxc6+S9NrYo+W9vBlauj4j1 85tTB07ozvQNG1pjciKMd2HAkOse2WyBp7YnJIZ6cLnht+RNlQMGqPM+6W7qCh+6Wg 78VSZVM8ls2LFGE0u1A7LiCxm+0YSyRNnmeOvUBQ= Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [95.163.41.97]) (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 28F2F6B738A for ; Thu, 6 Jun 2024 13:53:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 28F2F6B738A Received: by smtp59.i.mail.ru with esmtpa (envelope-from ) id 1sFAkC-00000005hyj-3tE7; Thu, 06 Jun 2024 13:53:21 +0300 Content-Type: multipart/alternative; boundary="------------aIrygII88yStV0DU1LsQE0Lq" Message-ID: Date: Thu, 6 Jun 2024 13:53:20 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Sergey Kaplun , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org References: <87a4c5c213df4e9f85eeb77d6cbb98dc2047c084.1713773432.git.skaplun@tarantool.org> Content-Language: en-US In-Reply-To: <87a4c5c213df4e9f85eeb77d6cbb98dc2047c084.1713773432.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD95EAEBA1571A63500BAB8C3FDB126E9E03B3A90406A88B6DE182A05F53808504031FE51FEEC64F5B6D27678DDAA806314178B2C200279ABB562BEE45D99412EB794E1874F75D17E7B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE79145AB6E9E75F07EEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637486F32EF78EC606F8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8B7713497D078225680D452B6053DA4839E37D60A4EF61D5ACC7F00164DA146DAFE8445B8C89999728AA50765F790063793270F7220657A0A389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8B861051D4BA689FCF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C98E93883770458359735652A29929C6C4AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C31DEDF2E2F39E2AF1BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CFED8438A78DFE0A9E1DD303D21008E298D5E8D9A59859A8B6957A4DEDD2346B4275ECD9A6C639B01B78DA827A17800CE7088C41E1DFBEEE9B43847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A5EFA6AF344228D7AF5002B1117B3ED6969B46B42FE1EE6AC3C66B2B37046EC955823CB91A9FED034534781492E4B8EEAD2B25D9E4C92BC8ACBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFA64566602F9990AB7F2B566DFACC30916EBED7A52AB62ED676BF835C7C7A148C792D7E5D32AAB0D000094467C1BF539C4432C59522EF612F04EFA8C02B897285D45C6A39FB133F125F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj3qkQfioj9XSO/z2gpU2iIw== X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D61406EC0A1CB35C7B6312FC33F81B786D8F73D6F1BE6E6B1BF7D0152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v1 1/5] build: introduce option LUAJIT_ENABLE_TABLE_BUMP 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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------aIrygII88yStV0DU1LsQE0Lq Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey thanks for the patch! Please see a question below. On 22.04.2024 11:49, Sergey Kaplun wrote: > This option enables table bump optimization if sink optimization is > enabled. The table bump optimization patches the bytecodes with a table > allocation on the trace recording if the recorded trace exceeds the size > of the allocated table. This optimization still has some bugs, so it is > disabled by default. For more details, see the comment in > . > > Needed for tarantool/tarantool#9924 > --- > CMakeLists.txt | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/CMakeLists.txt b/CMakeLists.txt > index 2355ce17..52014296 100644 > --- a/CMakeLists.txt > +++ b/CMakeLists.txt > @@ -307,6 +307,23 @@ if(LUAJIT_ENABLE_COVERAGE) > include(CodeCoverage) > endif() > > +# Enable table bump optimization. This optimization patches the > +# bytecodes with a table allocation on the trace recording if the > +# recorded trace exceeds the size of the allocated table. > +# This optimization still has some bugs, so it is disabled by > +# default. See also:https://github.com/LuaJIT/LuaJIT/issues/606. > +option(LUAJIT_ENABLE_TABLE_BUMP "Enable table bump optimization" OFF) > +if(LUAJIT_ENABLE_TABLE_BUMP) > + # Within table bump optimization enabled (and due to our > + # modification related to metrics), some offsets in `GG_State` > + # stop fit in 12bit immediate. Hence, the build failed due to > + # the DASM error (DASM_S_RANGE_I). > + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") > + message(FATAL_ERROR "Table Bump optimization is unsupported for aarch64") Table optimization works on all architectures supported by LuaJIT except aarch64, right? > + endif() > + AppendFlags(TARGET_C_FLAGS -DLUAJIT_ENABLE_TABLE_BUMP) > +endif() > + > # --- Main source tree --------------------------------------------------------- > > add_subdirectory(src) --------------aIrygII88yStV0DU1LsQE0Lq Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey


thanks for the patch! Please see a question below.

On 22.04.2024 11:49, Sergey Kaplun wrote:
This option enables table bump optimization if sink optimization is
enabled. The table bump optimization patches the bytecodes with a table
allocation on the trace recording if the recorded trace exceeds the size
of the allocated table. This optimization still has some bugs, so it is
disabled by default. For more details, see the comment in
<CMakeLists.txt>.

Needed for tarantool/tarantool#9924
---
 CMakeLists.txt | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2355ce17..52014296 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -307,6 +307,23 @@ if(LUAJIT_ENABLE_COVERAGE)
   include(CodeCoverage)
 endif()
 
+# Enable table bump optimization. This optimization patches the
+# bytecodes with a table allocation on the trace recording if the
+# recorded trace exceeds the size of the allocated table.
+# This optimization still has some bugs, so it is disabled by
+# default. See also: https://github.com/LuaJIT/LuaJIT/issues/606.
+option(LUAJIT_ENABLE_TABLE_BUMP "Enable table bump optimization" OFF)
+if(LUAJIT_ENABLE_TABLE_BUMP)
+  # Within table bump optimization enabled (and due to our
+  # modification related to metrics), some offsets in `GG_State`
+  # stop fit in 12bit immediate. Hence, the build failed due to
+  # the DASM error (DASM_S_RANGE_I).
+  if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
+    message(FATAL_ERROR "Table Bump optimization is unsupported for aarch64")

Table optimization works on all architectures supported by LuaJIT except aarch64, right?


+  endif()
+  AppendFlags(TARGET_C_FLAGS -DLUAJIT_ENABLE_TABLE_BUMP)
+endif()
+
 # --- Main source tree ---------------------------------------------------------
 
 add_subdirectory(src)
--------------aIrygII88yStV0DU1LsQE0Lq--