Tarantool development patches archive
 help / color / mirror / Atom feed
From: Maxim Kokryashkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: "Igor Munkin" <imun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches]  [PATCH luajit 2/2] test: relax JIT setup in misc.getmetrics test
Date: Mon, 05 Dec 2022 13:52:57 +0300	[thread overview]
Message-ID: <1670237577.981858899@f151.i.mail.ru> (raw)
In-Reply-To: <ba9d9c8462ecb97ac34293d3f3c24afd99ac0965.1669926435.git.imun@tarantool.org>

[-- Attachment #1: Type: text/plain, Size: 3962 bytes --]


Hi, Igor!
Thanks for the patch!
LGTM, except for the single nit Sergey has already mentioned.
--
Best regards,
Maxim Kokryashkin
 
 
> 
>>To test whether <jit_snap_restore> metric is counted right for side
>>exits <minstitch> JIT engine parameter is tighted to prevent side trace
>>compilation (considering <math.fmod> being used for the corresponding
>>branch of execution, the side trace will try to compile with stitching).
>>However, if test is run on the platform configured with the option
>>LUAJIT_ENABLE_CHECKHOOK enabled, the resulting trace exceeds the
>>hardcoded <minstitch> limit and the metric is miscounted due to this new
>>trace. To resolve this issue <minstitch> limit is set to the maximum
>>amount of IRRef in the trace, preventing trace compilation for any
>>LuaJIT configuration.
>>
>>Relates to tarantool/tarantool#7762
>>
>>Signed-off-by: Igor Munkin < imun@tarantool.org >
>>---
>> test/tarantool-tests/misclib-getmetrics-capi.test.lua | 7 +++++--
>> test/tarantool-tests/misclib-getmetrics-lapi.test.lua | 7 +++++--
>> test/tarantool-tests/utils.lua | 9 +++++++++
>> 3 files changed, 19 insertions(+), 4 deletions(-)
>>
>>diff --git a/test/tarantool-tests/misclib-getmetrics-capi.test.lua b/test/tarantool-tests/misclib-getmetrics-capi.test.lua
>>index 0cbc6cae..42a9adf9 100644
>>--- a/test/tarantool-tests/misclib-getmetrics-capi.test.lua
>>+++ b/test/tarantool-tests/misclib-getmetrics-capi.test.lua
>>@@ -1,5 +1,7 @@
>>+local utils = require('utils')
>>+
>> -- Disabled on *BSD due to #4819.
>>-require('utils').skipcond(jit.os == 'BSD', 'Disabled due to #4819')
>>+utils.skipcond(jit.os == 'BSD', 'Disabled due to #4819')
>> 
>> local path = arg[0]:gsub('%.test%.lua', '')
>> local suffix = package.cpath:match('?.(%a+);')
>>@@ -94,7 +96,8 @@ end))
>> 
>> -- Compiled loop with a side exit which does not get compiled.
>> test:ok(testgetmetrics.snap_restores(function()
>>- jit.opt.start(0, "hotloop=1", "hotexit=2", "minstitch=15")
>>+ jit.opt.start(0, "hotloop=1", "hotexit=2",
>>+ ("minstitch=%d"):format(utils.const.maxnins))
>> 
>>     local function foo(i)
>>         -- math.fmod is not yet compiled!
>>diff --git a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
>>index 222e7d01..19dfd199 100644
>>--- a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
>>+++ b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
>>@@ -2,8 +2,10 @@
>> -- Major portions taken verbatim or adapted from the LuaVela testing suite.
>> -- Copyright (C) 2015-2019 IPONWEB Ltd.
>> 
>>+local utils = require('utils')
>>+
>> -- Disabled on *BSD due to #4819.
>>-require('utils').skipcond(jit.os == 'BSD', 'Disabled due to #4819')
>>+utils.skipcond(jit.os == 'BSD', 'Disabled due to #4819')
>> 
>> local tap = require('tap')
>> 
>>@@ -279,7 +281,8 @@ test:test("snap-restores-loop-side-exit-non-compiled", function(subtest)
>>     -- Compiled loop with a side exit which does not get compiled.
>>     subtest:plan(1)
>> 
>>- jit.opt.start(0, "hotloop=1", "hotexit=2", "minstitch=15")
>>+ jit.opt.start(0, "hotloop=1", "hotexit=2",
>>+ ("minstitch=%d"):format(utils.const.maxnins))
>> 
>>     local function foo(i)
>>         -- math.fmod is not yet compiled!
>>diff --git a/test/tarantool-tests/utils.lua b/test/tarantool-tests/utils.lua
>>index 87f7ff15..eb11d40d 100644
>>--- a/test/tarantool-tests/utils.lua
>>+++ b/test/tarantool-tests/utils.lua
>>@@ -135,4 +135,13 @@ function M.profilename(name)
>>   return (arg[0]:gsub('^(.+)/([^/]+)%.test%.lua$', replacepattern))
>> end
>> 
>>+M.const = {
>>+ -- XXX: Max nins is limited by max IRRef, that equals to
>>+ -- REF_DROP - REF_BIAS. Unfortunately, these constants are not
>>+ -- provided to Lua space, so we ought to make some math:
>>+ -- * REF_DROP = 0xffff
>>+ -- * REF_BIAS = 0x8000
>>+ maxnins = 0xffff - 0x8000,
>>+}
>>+
>> return M
>>--
>>2.34.0
> 

[-- Attachment #2: Type: text/html, Size: 4923 bytes --]

  parent reply	other threads:[~2022-12-05 10:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01 20:28 [Tarantool-patches] [PATCH luajit 0/2] Fix tests for LUAJIT_ENABLE_CHECKHOOK Igor Munkin via Tarantool-patches
2022-12-01 20:28 ` [Tarantool-patches] [PATCH luajit 1/2] test: relax JIT setup in lj-430-maxirconst test Igor Munkin via Tarantool-patches
2022-12-05  7:52   ` Sergey Kaplun via Tarantool-patches
2022-12-05 21:33     ` Igor Munkin via Tarantool-patches
2022-12-05 10:47   ` Maxim Kokryashkin via Tarantool-patches
2022-12-05 21:34     ` Igor Munkin via Tarantool-patches
2022-12-01 20:28 ` [Tarantool-patches] [PATCH luajit 2/2] test: relax JIT setup in misc.getmetrics test Igor Munkin via Tarantool-patches
2022-12-05  7:57   ` Sergey Kaplun via Tarantool-patches
2022-12-05 21:40     ` Igor Munkin via Tarantool-patches
2022-12-05 10:52   ` Maxim Kokryashkin via Tarantool-patches [this message]
2022-12-05 21:40     ` Igor Munkin via Tarantool-patches
2022-12-02 10:01 ` [Tarantool-patches] [PATCH luajit 3/2] test: remove TAP side effects in getmetrics tests Igor Munkin via Tarantool-patches
2022-12-05  8:01   ` Sergey Kaplun via Tarantool-patches
2022-12-05 21:46     ` Igor Munkin via Tarantool-patches
2022-12-05 11:06   ` Maxim Kokryashkin via Tarantool-patches
2022-12-05 21:47     ` Igor Munkin via Tarantool-patches
2022-12-02 10:05 ` [Tarantool-patches] [PATCH luajit 0/2] Fix tests for LUAJIT_ENABLE_CHECKHOOK Igor Munkin via Tarantool-patches
2022-12-12  9:42 ` Igor Munkin 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=1670237577.981858899@f151.i.mail.ru \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=m.kokryashkin@tarantool.org \
    --subject='Re: [Tarantool-patches]  [PATCH luajit 2/2] test: relax JIT setup in misc.getmetrics test' \
    /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