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 2C32DF13960; Thu, 22 Aug 2024 18:17:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2C32DF13960 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1724339835; bh=nybFujklWdlz3Ipc5ZA3qrjwqDyuW6uzEvHX9kfg9wU=; 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=pFarESj1zU18EaktH+JfOTv7CdATrP5u7UqrxClKeVFkca+pI0d5bR0MZodamzXNF hUKwMaBkwF76r+F6Y9SVyhtmkrhLf9HNf7WKTOGLb/LZF2pGfSRD9S9/lbTVr9vfls 4zUSiTbAfXIuDxVQNxOwRtNeusTRUB1yVZ9W2ypk= Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [95.163.41.81]) (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 603D4F13960 for ; Thu, 22 Aug 2024 18:17:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 603D4F13960 Received: by smtp40.i.mail.ru with esmtpa (envelope-from ) id 1sh9Yn-0000000G6Uq-2lcq; Thu, 22 Aug 2024 18:17:13 +0300 Content-Type: multipart/alternative; boundary="------------MeH0TCLmD8ai0Z0OAuiV8JPK" Message-ID: <4f668c7c-4ff4-4542-928c-916e65cf1229@tarantool.org> Date: Thu, 22 Aug 2024 18:17:13 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org References: <84ec3e8d5f88f0f040187b798f5efaa77923b777.1724228998.git.skaplun@tarantool.org> In-Reply-To: <84ec3e8d5f88f0f040187b798f5efaa77923b777.1724228998.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9A67092BE052B1D9E8EC46B20539565FBAAD54790EDBD605A182A05F538085040A08A7DBF10346103479CDAE959BF64248552FD57757DBFA5EDDFFFF196D306A5680F0B1BC0C28F32 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72E4E5201E1C2E308EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637BA5555A0C16230F4EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38B043BF0FB74779F367C24DE88252D920D6D0EBA65803A10CA961AA2D159F18EF0A471835C12D1D9774AD6D5ED66289B5259CC434672EE6371117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE70F3DDF2BBF19B93A9FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE786325E808510DF35D32BA5DBAC0009BE395957E7521B51C2330BD67F2E7D9AF1090A508E0FED6299176DF2183F8FC7C026812BDBB326F95FCD04E86FAF290E2DB606B96278B59C421DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B61F2C8E835678F328089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A54728733F06DCDFC55002B1117B3ED6967572477686463F1647A99E6294EE8661823CB91A9FED034534781492E4B8EEAD27E9584FBD6BDD31BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF3D0369E582BDA46F64FD9CA1C6866BDDBA329FEFCAEE35D51874DE8E16192316136DDA45E01CE4BE2FB0CAD32ADFBF84725681C62084AC585D2F7B84FE1343392382ADEA7C69498D5F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbUwDRTee1XqGnlnxBxcGpA== X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D6140503654E23C0B168386927729795C98D35F447E3E48B66DAD0152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 44/45] test: enable LuaJIT test 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. --------------MeH0TCLmD8ai0Z0OAuiV8JPK Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sergey, On 21.08.2024 11:58, Sergey Kaplun wrote: > This patch moves the aforementioned test to the > test, with refactoring to restore the JIT engine and GC settings after > the test. > > Part of tarantool/tarantool#9398 > --- thanks for the patch! LGTM > test/LuaJIT-tests/misc/wbarrier_obar.lua | 22 ------------- > test/LuaJIT-tests/trace/wbarrier.lua | 41 ++++++++++++++++++++++++ > 2 files changed, 41 insertions(+), 22 deletions(-) > delete mode 100644 test/LuaJIT-tests/misc/wbarrier_obar.lua > > diff --git a/test/LuaJIT-tests/misc/wbarrier_obar.lua b/test/LuaJIT-tests/misc/wbarrier_obar.lua > deleted file mode 100644 > index 258db215..00000000 > --- a/test/LuaJIT-tests/misc/wbarrier_obar.lua > +++ /dev/null > @@ -1,22 +0,0 @@ > --- DSE of USTORE must eliminate OBAR, too. > - > -if jit and jit.opt then pcall(jit.opt.start, "-sink") end > - > -local f > -do > - local x > - f = function() > - local y = 0 > - for i=1,10000 do > - x = {1} > - if y > 0 then end > - x = 1 > - end > - end > -end > - > -collectgarbage() > -collectgarbage("setstepmul", 1) > -collectgarbage("restart") > -f() > - > diff --git a/test/LuaJIT-tests/trace/wbarrier.lua b/test/LuaJIT-tests/trace/wbarrier.lua > index 625c0ff2..9c9c50af 100644 > --- a/test/LuaJIT-tests/trace/wbarrier.lua > +++ b/test/LuaJIT-tests/trace/wbarrier.lua > @@ -1,3 +1,12 @@ > +local function jit_opt_is_on(needed) > + for _, opt in ipairs({jit.status()}) do > + if opt == needed then > + return true > + end > + end > + return false > +end > + > do --- TBAR for HSTORE. > local t = {[0]={}} > for i = 1, 1e5 do t[i] = {t[i - 1]} end > @@ -14,3 +23,35 @@ do --- OBAR for USTORE. > end > f() > end > + > +do --- DSE of USTORE must eliminate OBAR too. > + local need_restore_sink = false > + if jit_opt_is_on("sink") then > + need_restore_sink = true > + jit.opt.start("-sink") > + end > + > + local f > + do > + local x > + f = function() > + local y = 0 > + for _ = 1, 10000 do > + x = {1} > + if y > 0 then end > + x = 1 > + end > + end > + end > + > + collectgarbage() > + local oldstepmul = collectgarbage("setstepmul", 1) > + collectgarbage("restart") > + > + f() > + > + collectgarbage("setstepmul", oldstepmul) > + if need_restore_sink then > + jit.opt.start("+sink") > + end > +end --------------MeH0TCLmD8ai0Z0OAuiV8JPK Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Sergey,

On 21.08.2024 11:58, Sergey Kaplun wrote:
This patch moves the aforementioned test to the <trace/wbarrier.lua>
test, with refactoring to restore the JIT engine and GC settings after
the test.

Part of tarantool/tarantool#9398
---
thanks for the patch! LGTM
 test/LuaJIT-tests/misc/wbarrier_obar.lua | 22 -------------
 test/LuaJIT-tests/trace/wbarrier.lua     | 41 ++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 22 deletions(-)
 delete mode 100644 test/LuaJIT-tests/misc/wbarrier_obar.lua

diff --git a/test/LuaJIT-tests/misc/wbarrier_obar.lua b/test/LuaJIT-tests/misc/wbarrier_obar.lua
deleted file mode 100644
index 258db215..00000000
--- a/test/LuaJIT-tests/misc/wbarrier_obar.lua
+++ /dev/null
@@ -1,22 +0,0 @@
--- DSE of USTORE must eliminate OBAR, too.
-
-if jit and jit.opt then pcall(jit.opt.start, "-sink") end
-
-local f
-do
-  local x
-  f = function()
-    local y = 0
-    for i=1,10000 do
-      x = {1}
-      if y > 0 then end
-      x = 1
-    end
-  end
-end
-
-collectgarbage()
-collectgarbage("setstepmul", 1)
-collectgarbage("restart")
-f()
-
diff --git a/test/LuaJIT-tests/trace/wbarrier.lua b/test/LuaJIT-tests/trace/wbarrier.lua
index 625c0ff2..9c9c50af 100644
--- a/test/LuaJIT-tests/trace/wbarrier.lua
+++ b/test/LuaJIT-tests/trace/wbarrier.lua
@@ -1,3 +1,12 @@
+local function jit_opt_is_on(needed)
+  for _, opt in ipairs({jit.status()}) do
+    if opt == needed then
+      return true
+    end
+  end
+  return false
+end
+
 do --- TBAR for HSTORE.
   local t = {[0]={}}
   for i = 1, 1e5 do t[i] = {t[i - 1]} end
@@ -14,3 +23,35 @@ do --- OBAR for USTORE.
   end
   f()
 end
+
+do --- DSE of USTORE must eliminate OBAR too.
+  local need_restore_sink = false
+  if jit_opt_is_on("sink") then
+    need_restore_sink = true
+    jit.opt.start("-sink")
+  end
+
+  local f
+  do
+    local x
+    f = function()
+      local y = 0
+      for _ = 1, 10000 do
+        x = {1}
+        if y > 0 then end
+        x = 1
+      end
+    end
+  end
+
+  collectgarbage()
+  local oldstepmul = collectgarbage("setstepmul", 1)
+  collectgarbage("restart")
+
+  f()
+
+  collectgarbage("setstepmul", oldstepmul)
+  if need_restore_sink then
+    jit.opt.start("+sink")
+  end
+end
--------------MeH0TCLmD8ai0Z0OAuiV8JPK--