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 906E46F873; Fri, 28 Jan 2022 02:20:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 906E46F873 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1643325614; bh=9FOLZDY+jQM1Tu48gutSuarr/kpJEO7dEOFbzR6Pkto=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=kaBbOE2ygwY+5j0Zw0b7FFsgHtLbs2JN+6McYn1k0I8QmhdrSvMQAxHCyvw2yjEcb 4+xkUL3N72yWPDmTUYgvdG5PcJhXW4WnhEVLwP1OWqqYzTfajaX51+SgoLUeXhjEGt I+IH2kNI43mm2iI9+SQlOpd+IYz7fkiKOBR9iXUk= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C58CC6F873 for ; Fri, 28 Jan 2022 02:20:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C58CC6F873 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1nDE3n-0006Sz-Nw; Fri, 28 Jan 2022 02:20:12 +0300 Date: Fri, 28 Jan 2022 02:18:47 +0300 To: Sergey Kaplun Message-ID: References: <20211229122731.31617-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211229122731.31617-1-skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9AA78FDF62ECAE61F54255EDFAF4B1D201624D376D056B765182A05F53808504001F08FF47F1BD181BAA09AC35528B276A677A745937016F21EEED1234BC41907 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE710FC7AC39A8009ECEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063781C5E355D70FD85B8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8156E6D2B71D0A40DC572708550AEC008117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2EE5AD8F952D28FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD1828451B159A507268D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6821DB69C87B6DA73089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A547A88298AE464F038B611E6AF3934F4BFF3348DF2FD2A454D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75438CC92D4039F4E2410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3498EF79680EE3725C5BE3DA772C81930A3DCEE43B57AC36B2A191D963905C1FB04919989B15D607741D7E09C32AA3244CAC4901C3A07B961EA90C89CDF52CC1A2E8FBBEFAE1C4874C927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojqLK0kLh8sGf+74oxR/fGAg== X-Mailru-Sender: 689FA8AB762F739339CABD9B3CA9A7D678C3E519A26EBD4E3829DCDF2F93FF46A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Actually implement maxirconst trace limit. 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Sergey, Thanks for the patch! LGTM, except a couple of nits. On 29.12.21, Sergey Kaplun wrote: > From: Mike Pall > > Suggested by spacewander. > > (cherry picked from 9ff94c4a1fcec2c310dcb092da694f23186e23) Typo: s/9ff94c4a1fcec2c310dcb092da694f23186e23/0a9ff94c4a1fcec2c310dcb092da694f23186e23/. > > `maxirconst` should restrict the amount of IR constants for 1 trace. Typo: It's better s/for 1/per/, but feel free to ignore. > Nevertheless, its value isn't checked anywhere. Lol, classic. > > This patch adds the corresponding check after instruction recording. > > Sergey Kaplun: > * added the description and the test for the problem > > Part of tarantool/tarantool#6548 > --- > > Issue: https://github.com/LuaJIT/LuaJIT/issues/430 > Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-430-maxirconst-actually-implement-full-ci > Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/lj-430-maxirconst-actually-implement-full-ci > > src/lj_record.c | 5 ++- > .../lj-430-maxirconst.test.lua | 43 +++++++++++++++++++ > 2 files changed, 46 insertions(+), 2 deletions(-) > create mode 100644 test/tarantool-tests/lj-430-maxirconst.test.lua > > diff --git a/test/tarantool-tests/lj-430-maxirconst.test.lua b/test/tarantool-tests/lj-430-maxirconst.test.lua > new file mode 100644 > index 00000000..1829b37d > --- /dev/null > +++ b/test/tarantool-tests/lj-430-maxirconst.test.lua > @@ -0,0 +1,43 @@ > +-- XXX: avoid any other traces compilation due to hotcount > +-- collisions for predictible results. Typo: s/predictible/predictable/. > +jit.off() > +jit.flush() Minor: I'd rather move this part closer to 'jit.opt.start' to save the test structure closer to the other test chunks. Feel free to ignore. > + > +-- Disabled on *BSD due to #4819. > +require('utils').skipcond(jit.os == 'BSD', 'Disabled due to #4819') > + > +local tap = require('tap') > + > +local test = tap.test('lj-430-maxirconst') > +test:plan(2) > + > +-- XXX: trace always has at least 3 IR constants: for nil, false > +-- and true. > +jit.opt.start('hotloop=1', 'maxirconst=3') > + > +-- This function has only 3 IR constant. > +local function irconst3() > +end > + > +-- This function has 4 IR constants before optimizations. > +local function irconst4() > + local _ = 42 > +end > + > +local ntrace_old = misc.getmetrics().jit_trace_num > +jit.on() > +irconst3() > +irconst3() > +jit.off() > +test:ok(ntrace_old + 1 == misc.getmetrics().jit_trace_num, > + 'trace number increases') Typo: I doubt we use tabs in Lua sources, but I might be wrong... > + > +ntrace_old = misc.getmetrics().jit_trace_num > +jit.on() > +irconst4() > +irconst4() > +jit.off() > +test:ok(ntrace_old == misc.getmetrics().jit_trace_num, > + 'trace number is the same') Ditto. > + > +os.exit(test:check() and 0 or 1) > -- > 2.34.1 > -- Best regards, IM