<HTML><BODY><div>Hi team,</div><div> </div><div>QA LGTM</div><div> </div><div> </div><div data-signature-widget="container"><div data-signature-widget="content"><div>--<br>Vitaliia Ioffe</div></div></div><div> </div><div> </div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Вторник, 10 августа 2021, 19:41 +03:00 от Sergey Ostanevich via Tarantool-patches <tarantool-patches@dev.tarantool.org>:<br> <div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16286136632076441486_BODY"><div class="cl_664142">Hi!<div> </div><div>Thanks for the patch, LGTM.</div><div> </div><div>I have no other explanation than that ‘missed flag as a result of compare’.</div><div>But you did it better - took time for me to get to the point. </div><div>BTW, will make easier to grasp with a simple C equivalent, like </div><div> </div><div>-<span style="white-space: pre;" class="Apple-tab-span_mr_css_attr"> </span>if (iswite(str) || closed != 0)</div><div>+<span style="white-space: pre;" class="Apple-tab-span_mr_css_attr"> </span>if (iswite(str) || closed == 0)</div><div> </div><div>Sergos.</div><div> </div><div> <div> <div class="mail-quote-collapse"><blockquote type="cite"><div>On 9 Aug 2021, at 19:01, Sergey Kaplun <<a href="//e.mail.ru/compose/?mailto=mailto%3askaplun@tarantool.org">skaplun@tarantool.org</a>> wrote:</div> <div><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">Igor, thanks for the feedback!</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">On 08.08.21, Igor Munkin wrote:</span><blockquote type="cite" style="font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;orphans: auto;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;">Sergey,<br><br>Thanks for the fixes! See some new comments below.<br><br>On 01.08.21, Sergey Kaplun wrote:<blockquote type="cite">Igor,<br><br>Thanks for the review!<br>Update commit message on the branch, considering you comments.</blockquote><br>Got it, but I still have some more comments regarding it.<br><br> <blockquote type="cite">See answers to you questions below.<br> </blockquote><br><snipped><br><br><br> <blockquote type="cite"><blockquote type="cite"><blockquote type="cite">| ccmp TMP0w, #0, #0, ne<br>| beq <1 // branch out from barrier movement<br>`TMP0w` contains `upvalue->closed` field. If it equals NULL (the first<br>`#0`). The second zero is the value of NZCV condition flags set if the<br>condition (`ne`) is FALSE [1][2]. If the set value is not white, then<br>flags are set to zero and branch is not taken (no Zero flag). If it<br>happens at propagate or atomic GC State and the `lj_gc_barrieruv()`<br>function is called then the gray value to set is marked as white. That<br>leads to the assertion failure in the `gc_mark()` function.</blockquote><br>OK, I understand almost nothing from the part above. Here are the<br>comments:<br>1. "If it equals NULL (the first `#0`)", then what?</blockquote><br>My bad:<br>I mean here:<br>If it equals NULL (the first `#0`), then the upvalue is open.</blockquote><br>So why do you use NULL instead of 0? The field is uint8_t type, so 0 is<br>much clearer.</blockquote><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">Changed.</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"> <blockquote type="cite" style="font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;orphans: auto;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;"><blockquote type="cite">Added this.<br> <blockquote type="cite">2. Just to check we are on the same page: the second "immediate"<br>mentioned in docs[1] is NZCV?</blockquote><br>Yes.<br> <blockquote type="cite"> Then beq <1 branch is not taken since<br>(TMP0w != 0) is FALSE (i.e. upvalue is not closed), but zero flag in<br>NZCV value is not set?</blockquote><br>Yes.<br> <blockquote type="cite"> So how does the color of the value to be stored<br>relate to this control flow?</blockquote><br>This NZCV value isn't set if the upvalue is white, because condition is<br>of the following instruction<br><br>| tst TMP1w, #LJ_GC_WHITES<span style="white-space: pre;" class="Apple-tab-span_mr_css_attr"> </span>// iswhite(str)<br><br>is TRUE. So the <1 branch is taken, because the upvalue is closed.</blockquote><br>Well... I can't imagine how I needed to find this... This relates mostly<br>to ARM docs you've mentioned, but it would be nice to describe this<br>behaviour in the commit message (since you're writing a verbose one).<br><br> <blockquote type="cite"><blockquote type="cite">3. AFAICS, if the branch is not taken and <lj_gc_barrieruv> is called at<br>propagate or atomic phase, the value is colored either to gray or black.</blockquote><br>Yes, that leads to the assertion failure mentioned in the ticket in the<br>LuaJIT upstream.<br><br><br> <blockquote type="cite"><blockquote type="cite">This patch changes yielded NZCV condition flag to 4 (Zero flag is up) to<br>take the correct branch after `ccmp` instruction.<br><br>Sergey Kaplun:<br>* added the description and the test for the problem<br><br>[1]: <a href="https://developer.arm.com/documentation/dui0801/g/pge1427897656225" target="_blank">https://developer.arm.com/documentation/dui0801/g/pge1427897656225</a><br>[2]: <a href="https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/condition-codes-1-condition-flags-and-codes" target="_blank">https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/condition-codes-1-condition-flags-and-codes</a></blockquote><br>Minor: Why #5629 is not mentioned?</blockquote><br>Added.</blockquote><br>Considering everything above, I propose the following wording:<br>| Contributed by Javier Guerra Giraldez.<br>|<br>| (cherry picked from commit c785131ca5a6d24adc519e5e0bf1b69b671d912f)<br>|<br>|<br>| Closed upvalues are never gray. Hence when closed upvalue is marked, it<br>| is marked as black. Black objects can't refer white objects, so for<br>| storing a white value in a closed upvalue, we need to move the barrier<br>| forward and color our value to gray by using `lj_gc_barrieruv()`. This<br>| function can't be called on closed upvalues with non-white values since<br>| there is no need to mark it again.<br>|<br>| USETS bytecode for arm64 architecture has the incorrect NZCV condition<br>| flag value in the instruction that checks the upvalue is closed:<br>| | tst TMP1w, #LJ_GC_WHITES<br>| | ccmp TMP0w, #0, #0, ne<br>| | beq <1 // branch out from barrier movement<br>| `TMP0w` contains `upvalue->closed` field, so the upvalue is open if this<br>| field equals to zero (the first one in `ccmp`). The second zero is the<br>| value of NZCV condition flags[1] yielded if the specified condition<br>| (`ne`) is met for the current values of the condition flags[2]. Hence,<br>| if the value to be stored is not white (`TMP1w` holds its color), then<br>| the condition is FALSE and all flags bits are set to zero so branch is<br>| not taken (Zero flag is not set). If this happens at propagate or atomic<br>| GC phase, the `lj_gc_barrieruv()` function is called and the gray value<br>| to be set is marked like if it is white. That leads to the assertion<br>| failure in the `gc_mark()` function.<br>|<br>| This patch changes NZCV condition flag to 4 (Zero flag is set) to take<br>| the correct branch after `ccmp` instruction.<br>|<br>| Sergey Kaplun:<br>| * added the description and the test for the problem<br>|<br>| [1]: <a href="https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/condition-codes-1-condition-flags-and-codes" target="_blank">https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/condition-codes-1-condition-flags-and-codes</a><br>| [2]: <a href="https://developer.arm.com/documentation/dui0801/g/pge1427897656225" target="_blank">https://developer.arm.com/documentation/dui0801/g/pge1427897656225</a><br>|<br>| Part of tarantool/tarantool#5629</blockquote><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">Updated, as you've suggested.</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><br><br> <blockquote type="cite" style="font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;orphans: auto;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;"><snipped><br><br><br> <blockquote type="cite"><blockquote type="cite"><blockquote type="cite">src/vm_arm64.dasc | 2 +-<br>...6-arm64-incorrect-check-closed-uv.test.lua | 38 +++++++++++++++++++<br>2 files changed, 39 insertions(+), 1 deletion(-)<br>create mode 100644 test/tarantool-tests/lj-426-arm64-incorrect-check-closed-uv.test.lua<br> </blockquote><br><snipped><br> <blockquote type="cite">diff --git a/test/tarantool-tests/lj-426-arm64-incorrect-check-closed-uv.test.lua b/test/tarantool-tests/lj-426-arm64-incorrect-check-closed-uv.test.lua<br>new file mode 100644<br>index 00000000..b757133f<br>--- /dev/null<br>+++ b/test/tarantool-tests/lj-426-arm64-incorrect-check-closed-uv.test.lua<br>@@ -0,0 +1,38 @@<br>+local tap = require('tap')<br>+<br>+local test = tap.test('lj-426-arm64-incorrect-check-closed-uv')<br>+test:plan(1)<br>+<br>+-- Test file to demonstrate LuaJIT USETS bytecode incorrect<br>+-- behaviour on arm64 in case when non-white object is set to<br>+-- closed upvalue.<br>+-- See also, <a href="https://github.com/LuaJIT/LuaJIT/issues/426" target="_blank">https://github.com/LuaJIT/LuaJIT/issues/426</a>.<br>+<br>+-- First, create a closed upvalue.<br>+do</blockquote><br>Minor: I'm not sure, we need a separate lexical block here. Could you<br>please clarify the reason in the comment?</blockquote><br>We need a closed upvalue. I suppose that it is the simpiest way to<br>create one. Please, provide a simplier example if you know one.</blockquote><br>My bad. Yes, the easiest way to emit UCLO bytecode is using a separate<br>lexical block.<br><br><br> <blockquote type="cite"><blockquote type="cite"><blockquote type="cite">+ local uv -- luacheck: no unused<br>+ -- The function's prototype is created with the following<br>+ -- constants at chunk parsing. After adding this constant to<br>+ -- the function's prototype it will be marked as gray during<br>+ -- propogate phase.</blockquote><br>Then what does it test, if the constant is marked as gray? Will this<br>string be white later?</blockquote><br>It shouldn't be white, it should be gray, otherwise the aforementioned<br>condition is TRUE (remember, we need FALSE).</blockquote><br>Again, PEBKAC, thanks for the explanation.<br><br><br> <blockquote type="cite"><blockquote type="cite"><blockquote type="cite">+ local function usets() uv = '' end<br>+ _G.usets = usets<br>+end<br>+<br>+-- Set GC state to GCpause.<br>+collectgarbage()<br>+-- Do GC step as often as possible.<br>+collectgarbage('setstepmul', 100)</blockquote><br>Minor: Don't get, why you need to make GC less aggressive for the test.<br>The test is run, until propagate phase is finished.</blockquote><br>More likely, that it is run, until the upvalue is marked as black<br>during traversing (with the bug). I can remove this line if you insist.</blockquote><br>Drop it, please. I can't even *feel* its effect ;)</blockquote><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">Done.</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><br><br> <blockquote type="cite" style="font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;orphans: auto;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">+<br>+-- We don't know on what exactly step our upvalue is marked as<br>+-- black and USETS become dangerous, so just check it at each<br>+-- step.<br>+-- Don't need to do the full GC cycle step by step.</blockquote></blockquote></blockquote><br>Minor: It would be nice to drop a few words about string and upvalue<br>colours during this loop, but it's up to you.</blockquote><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">Added.</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">The iterative patch is the following:</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">===================================================================</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">diff --git a/test/tarantool-tests/lj-426-arm64-incorrect-check-closed-uv.test.lua b/test/tarantool-tests/lj-426-arm64-incorrect-check-closed-uv.test.lua</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">index b757133f..4cdf1211 100644</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">--- a/test/tarantool-tests/lj-426-arm64-incorrect-check-closed-uv.test.lua</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">+++ b/test/tarantool-tests/lj-426-arm64-incorrect-check-closed-uv.test.lua</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">@@ -21,9 +21,10 @@ end</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">-- Set GC state to GCpause.</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">collectgarbage()</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">--- Do GC step as often as possible.</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">-collectgarbage('setstepmul', 100)</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">+-- We want to wait for the situation, when upvalue is black,</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">+-- the string is gray. Both conditions are satisfied, when the</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">+-- corresponding `usets()` function is marked, for example.</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">-- We don't know on what exactly step our upvalue is marked as</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">-- black and USETS become dangerous, so just check it at each</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">-- step.</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">===================================================================</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"> <blockquote type="cite" style="font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;orphans: auto;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0px;-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;text-decoration: none;"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">+local old_steps_atomic = misc.getmetrics().gc_steps_atomic<br>+while (misc.getmetrics().gc_steps_atomic == old_steps_atomic) do<br>+ collectgarbage('step')<br>+ usets() -- luacheck: no global<br>+end<br>+<br>+test:ok(true)<br>+os.exit(test:check() and 0 or 1)<br>--<span class="Apple-converted-space_mr_css_attr"> </span><br>2.31.0<br> </blockquote><br>[1]: <a href="https://lists.tarantool.org/tarantool-patches/20210719073632.12008-1-skaplun@tarantool.org/T/#u" target="_blank">https://lists.tarantool.org/tarantool-patches/20210719073632.12008-1-skaplun@tarantool.org/T/#u</a><br><br>--<span class="Apple-converted-space_mr_css_attr"> </span><br>Best regards,<br>IM</blockquote><br>--<span class="Apple-converted-space_mr_css_attr"> </span><br>Best regards,<br>Sergey Kaplun</blockquote><br>--<span class="Apple-converted-space_mr_css_attr"> </span><br>Best regards,<br>IM</blockquote><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">--<span class="Apple-converted-space_mr_css_attr"> </span></span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">Best regards,</span><br style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;"><span style="caret-color: rgb(0, 0, 0);font-family: Menlo-Regular;font-size: 11px;font-style: normal;font-variant-caps: normal;font-weight: normal;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;white-space: normal;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration: none;float: none;display: inline !important;">Sergey Kaplun</span></div></blockquote></div></div></div></div></div></div></div></div></blockquote><div> </div></BODY></HTML>