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 C20D06F15B; Tue, 23 Aug 2022 13:23:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C20D06F15B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1661250205; bh=Pl7C7wyKa6DJhiSkv/W90mneZJ715B3pYQp0oFAubg8=; h=In-Reply-To:Date:References:To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=yR5hlT2K9OeftRaxk2iFQRL3N8zaf13cBHD4112+evKckWvZ3GsRQd1XCMP92qLOG k8gd58LvkvnPL539MDHwlaDRsU2KxbmD5RsIZsnpCodWhUFh18jWhkBawwh/kXdz4j 71z2U87UqJ4OYftz3ysoO4hTNpoimwYYDotIsR1Y= Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [94.100.177.92]) (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 4DBD76F15B for ; Tue, 23 Aug 2022 13:23:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4DBD76F15B Received: by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1oQR47-0003OF-8r; Tue, 23 Aug 2022 13:23:23 +0300 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) In-Reply-To: <20220817092424.19463-1-skaplun@tarantool.org> Date: Tue, 23 Aug 2022 13:23:22 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20220817092424.19463-1-skaplun@tarantool.org> To: Sergey Kaplun X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD92C1BB4A9562080D0241FCA21F9D358A9F086B9F0FA6F79DF182A05F5380850404C228DA9ACA6FE279B9B469F535DD2CF0D8598B12ED450A39652EF4F2CE5F598C8B852B68A46605A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72407438AC6002944EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063779018AFA06A12C538638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D895958EADC5F5A311446D25B1AA3C09C9117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCECADA55FE5B58BB7A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735209ECD01F8117BC8BEA471835C12D1D977C4224003CC836476EB9C4185024447017B076A6E789B0E975F5C1EE8F4F765FC9027BE0CB4C802D33AA81AA40904B5D9CF19DD082D7633A078D18283394535A93AA81AA40904B5D98AA50765F79006375379A718C98AB21AD81D268191BDAD3D698AB9A7B718F8C4D1B931868CE1C5781A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F9963BF7538DF330742539A7722CA490CB5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 9604B64F49C60606AD91A466A1DEF99B296C473AB1E142185AC9E3593CE4B31AB1881A6453793CE9274300E5CE05BD4401A9E91200F654B0F56C66D0505D9834D9A1D0B5FC830B80D4BD9E8B6D6AEAAA5EE94BECDA18CB7B9C2B6934AE262D3EE7EAB7254005DCED8DA55E71E02F9FC08E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A5112A9AECFE11B13A8EE0549E928C3978F7CC7C3D99FCD8FDDFCE1103CF3307C024FCED7CA8EE6D1D7E09C32AA3244CFF8BED781B83091479E5226F6AFA06143A76366E8A9DE7CAFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojzEOgLjt8B1ophVuNh+RZqA== X-Mailru-Sender: 5AA3D5B9D8C486462A43268960EC4D12C51780B8CE8A741569D697AC24826AC99649D20B9839D7A619381EE24192DF5555834048F03EF5D4C9A814A92B2E3B1BA4250FC3964EA4964198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] test: disable jit tests at M1 for Tarantool 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: sergos via Tarantool-patches Reply-To: sergos Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the patch! See some comments below. > On 17 Aug 2022, at 12:24, Sergey Kaplun wrote: >=20 > During running JIT-related tests on Tarantool the trace assembling > occasionally fails with the error "failed to allocate mcode memory" > because there are no suitable addresses available. I would rephrase to be more on the spot: Trace assembling can fail with an error of mcode memory allocation due = to the branch offset limitation of +-32Mb on an ARM platform. For the time = we=E2=80=99re elaborating a correct fix we disable tests proven to be flaky because of = this reason. I would propose to separate the refactor commit as a preparational, = since sysprof is out of this patch context. >=20 > This patch disables those tests for Tarantool in a similar way as it = is > done for FreeBSD. Also, this patch refactors `utils.skipcond()` a bit > to make it call readable with multiple conditions/reasons pairs. >=20 > Relates to tarantool/tarantool#7571 > --- >=20 > Tarantool PR: https://github.com/tarantool/tarantool/pull/7578 > Issue: https://github.com/tarantool/tarantool/issues/7571 > Branch: = https://github.com/tarantool/luajit/tree/skaplun/gh-7571-disable-jit-tests= -m1-full-ci >=20 > Side note: Looks like adding the trampoline, as Sergos suggested is = the > correct solution of this issue. For now just disable JIT related tests > only for Tarantool. I believe we can pre-allocate a 64Mb mcode buffer ahead of regular = Tarantool memory allocation activities, since it can=E2=80=99t be bigger on ARM = anyways? Trampoline will remove those limitations although. >=20 > .../gh-4199-gc64-fuse.test.lua | 2 +- > .../gh-4427-ffi-sandwich.test.lua | 7 ++++-- > .../gh-5813-resolving-of-c-symbols.test.lua | 10 ++++----- > ...4-add-proto-trace-sysprof-default.test.lua | 12 +++++----- > .../lj-430-maxirconst.test.lua | 8 +++++-- > ...lj-672-cdata-allocation-recording.test.lua | 8 +++++-- > .../lj-flush-on-trace.test.lua | 7 ++++-- > .../misclib-getmetrics-capi.test.lua | 8 +++++-- > .../misclib-getmetrics-lapi.test.lua | 8 +++++-- > .../misclib-memprof-lapi.test.lua | 17 +++++++------- > .../misclib-sysprof-capi.test.lua | 11 +++++----- > .../misclib-sysprof-lapi.test.lua | 11 +++++----- > test/tarantool-tests/utils.lua | 22 ++++++++++++++----- > 13 files changed, 83 insertions(+), 48 deletions(-) >=20 > diff --git a/test/tarantool-tests/gh-4199-gc64-fuse.test.lua = b/test/tarantool-tests/gh-4199-gc64-fuse.test.lua > index 4d69250f..04950fd2 100644 > --- a/test/tarantool-tests/gh-4199-gc64-fuse.test.lua > +++ b/test/tarantool-tests/gh-4199-gc64-fuse.test.lua > @@ -1,6 +1,6 @@ > -- The test is GC64 only. > local ffi =3D require('ffi') > -require('utils').skipcond(not ffi.abi('gc64'), 'test is GC64 only') > +require('utils').skipcond({not ffi.abi('gc64'), 'test is GC64 only'}) >=20 > local tap =3D require('tap') > local test =3D tap.test('gh-4199-gc64-fuse') > diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua = b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua > index dd02130c..fea1d181 100644 > --- a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua > +++ b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua > @@ -1,7 +1,10 @@ > local utils =3D require('utils') >=20 > --- Disabled on *BSD due to #4819. > -utils.skipcond(jit.os =3D=3D 'BSD', 'Disabled due to #4819') > +utils.skipcond( > + {jit.os =3D=3D 'BSD', 'Disabled due to #4819'}, > + --luacheck: no global > + {_TARANTOOL and utils.is_M1(), 'Disabled due to #7571'} > +) >=20 > utils.selfrun(arg, { > { > diff --git = a/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua = b/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua > index d589dddf..ff0c48e6 100644 > --- a/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua > +++ b/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua > @@ -1,8 +1,8 @@ > --- Memprof is implemented for x86 and x64 architectures only. > -require("utils").skipcond( > - jit.arch ~=3D "x86" and jit.arch ~=3D "x64" or jit.os ~=3D "Linux", > - jit.arch.." architecture or "..jit.os.. > - " OS is NIY for memprof c symbols resolving" > +local utils =3D require("utils") > +utils.skipcond( > + {jit.arch ~=3D "x86" and jit.arch ~=3D "x64", jit.arch .. > + " architecture is NIY for memprof c symbols resolving"}, > + {jit.os ~=3D "Linux", jit.os .. " OS is NIY for memprof c symbols = resolving"} > ) >=20 > local tap =3D require("tap") > diff --git = a/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua = b/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua > index 15bd0a8b..332d4711 100644 > --- = a/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua > +++ = b/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua > @@ -1,9 +1,9 @@ > --- Sysprof is implemented for x86 and x64 architectures only. > -require('utils').skipcond( > - jit.arch ~=3D 'x86' and jit.arch ~=3D 'x64' or jit.os ~=3D 'Linux' > - or require('ffi').abi('gc64'), > - jit.arch..' architecture or '..jit.os.. > - ' OS is NIY for sysprof' > +local utils =3D require('utils') > +utils.skipcond( > + {jit.arch ~=3D 'x86' and jit.arch ~=3D 'x64', jit.arch .. > + ' architecture is NIY for sysprof'}, > + {jit.os ~=3D 'Linux', jit.os .. ' OS is NIY for sysprof'}, > + {require('ffi').abi('gc64'), 'GC64 mode is NIY for sysprof'} > ) >=20 > local tap =3D require('tap') > diff --git a/test/tarantool-tests/lj-430-maxirconst.test.lua = b/test/tarantool-tests/lj-430-maxirconst.test.lua > index cd3587a8..b95aacbd 100644 > --- a/test/tarantool-tests/lj-430-maxirconst.test.lua > +++ b/test/tarantool-tests/lj-430-maxirconst.test.lua > @@ -3,8 +3,12 @@ > jit.off() > jit.flush() >=20 > --- Disabled on *BSD due to #4819. > -require('utils').skipcond(jit.os =3D=3D 'BSD', 'Disabled due to = #4819') > +local utils =3D require('utils') > +utils.skipcond( > + {jit.os =3D=3D 'BSD', 'Disabled due to #4819'}, > + --luacheck: no global > + {_TARANTOOL and utils.is_M1(), 'Disabled due to #7571'} > +) >=20 > local tap =3D require('tap') > local traceinfo =3D require('jit.util').traceinfo > diff --git = a/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua = b/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua > index 1dc741d8..c72688d6 100644 > --- a/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua > +++ b/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua > @@ -1,5 +1,9 @@ > --- Disabled on *BSD due to #4819. > -require('utils').skipcond(jit.os =3D=3D 'BSD', 'Disabled due to = #4819') > +local utils =3D require('utils') > +utils.skipcond( > + {jit.os =3D=3D 'BSD', 'Disabled due to #4819'}, > + --luacheck: no global > + {_TARANTOOL and utils.is_M1(), 'Disabled due to #7571'} > +) >=20 > local ffi =3D require('ffi') > local traceinfo =3D require('jit.util').traceinfo > diff --git a/test/tarantool-tests/lj-flush-on-trace.test.lua = b/test/tarantool-tests/lj-flush-on-trace.test.lua > index c46b93f0..006c61f0 100644 > --- a/test/tarantool-tests/lj-flush-on-trace.test.lua > +++ b/test/tarantool-tests/lj-flush-on-trace.test.lua > @@ -1,7 +1,10 @@ > local utils =3D require('utils') >=20 > --- Disabled on *BSD due to #4819. > -utils.skipcond(jit.os =3D=3D 'BSD', 'Disabled due to #4819') > +utils.skipcond( > + {jit.os =3D=3D 'BSD', 'Disabled due to #4819'}, > + --luacheck: no global > + {_TARANTOOL and utils.is_M1(), 'Disabled due to #7571'} > +) >=20 > utils.selfrun(arg, { > { > diff --git a/test/tarantool-tests/misclib-getmetrics-capi.test.lua = b/test/tarantool-tests/misclib-getmetrics-capi.test.lua > index 0cbc6cae..f747500b 100644 > --- a/test/tarantool-tests/misclib-getmetrics-capi.test.lua > +++ b/test/tarantool-tests/misclib-getmetrics-capi.test.lua > @@ -1,5 +1,9 @@ > --- Disabled on *BSD due to #4819. > -require('utils').skipcond(jit.os =3D=3D 'BSD', 'Disabled due to = #4819') > +local utils =3D require('utils') > +utils.skipcond( > + {jit.os =3D=3D 'BSD', 'Disabled due to #4819'}, > + --luacheck: no global > + {_TARANTOOL and utils.is_M1(), 'Disabled due to #7571'} > +) >=20 > local path =3D arg[0]:gsub('%.test%.lua', '') > local suffix =3D package.cpath:match('?.(%a+);') > diff --git a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua = b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua > index 222e7d01..50a4fce3 100644 > --- a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua > +++ b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua > @@ -2,8 +2,12 @@ > -- Major portions taken verbatim or adapted from the LuaVela testing = suite. > -- Copyright (C) 2015-2019 IPONWEB Ltd. >=20 > --- Disabled on *BSD due to #4819. > -require('utils').skipcond(jit.os =3D=3D 'BSD', 'Disabled due to = #4819') > +local utils =3D require('utils') > +utils.skipcond( > + {jit.os =3D=3D 'BSD', 'Disabled due to #4819'}, > + --luacheck: no global > + {_TARANTOOL and utils.is_M1(), 'Disabled due to #7571'} > +) >=20 > local tap =3D require('tap') >=20 > diff --git a/test/tarantool-tests/misclib-memprof-lapi.test.lua = b/test/tarantool-tests/misclib-memprof-lapi.test.lua > index a11f0be1..66fb2108 100644 > --- a/test/tarantool-tests/misclib-memprof-lapi.test.lua > +++ b/test/tarantool-tests/misclib-memprof-lapi.test.lua > @@ -1,7 +1,8 @@ > -- Memprof is implemented for x86 and x64 architectures only. > -require("utils").skipcond( > - jit.arch ~=3D "x86" and jit.arch ~=3D "x64", > - jit.arch.." architecture is NIY for memprof" > +local utils =3D require('utils') > +utils.skipcond( > + {jit.arch ~=3D "x86" and jit.arch ~=3D "x64", > + jit.arch .. " architecture is NIY for memprof"} > ) >=20 > local tap =3D require("tap") > @@ -189,9 +190,9 @@ test:test("output", function(subtest) > -- one is the number of allocations. 1 event - alocation of > -- table by itself + 1 allocation of array part as far it is > -- bigger than LJ_MAX_COLOSIZE (16). > - subtest:ok(check_alloc_report(alloc, { line =3D 35, linedefined =3D = 33 }, 2)) > + subtest:ok(check_alloc_report(alloc, { line =3D 36, linedefined =3D = 34 }, 2)) > -- 20 strings allocations. > - subtest:ok(check_alloc_report(alloc, { line =3D 40, linedefined =3D = 33 }, 20)) > + subtest:ok(check_alloc_report(alloc, { line =3D 41, linedefined =3D = 34 }, 20)) >=20 > -- Collect all previous allocated objects. > subtest:ok(free.INTERNAL.num =3D=3D 22) > @@ -291,10 +292,10 @@ test:test("jit-output", function(subtest) > -- 10 allocations in interpreter mode, 1 allocation for a trace > -- recording and assembling and next 9 allocations will happen > -- while running the trace. > - subtest:ok(check_alloc_report(alloc, { line =3D 40, linedefined =3D = 33 }, 11)) > - subtest:ok(check_alloc_report(alloc, { traceno =3D 1, line =3D 38 = }, 9)) > + subtest:ok(check_alloc_report(alloc, { line =3D 41, linedefined =3D = 34 }, 11)) > + subtest:ok(check_alloc_report(alloc, { traceno =3D 1, line =3D 39 = }, 9)) > -- See same checks with jit.off(). > - subtest:ok(check_alloc_report(alloc, { line =3D 35, linedefined =3D = 33 }, 2)) > + subtest:ok(check_alloc_report(alloc, { line =3D 36, linedefined =3D = 34 }, 2)) >=20 > -- Restore default JIT settings. > jit.opt.start(unpack(jit_opt_default)) > diff --git a/test/tarantool-tests/misclib-sysprof-capi.test.lua = b/test/tarantool-tests/misclib-sysprof-capi.test.lua > index afb99cf2..32f00ffd 100644 > --- a/test/tarantool-tests/misclib-sysprof-capi.test.lua > +++ b/test/tarantool-tests/misclib-sysprof-capi.test.lua > @@ -1,10 +1,11 @@ > -- Sysprof is implemented for x86 and x64 architectures only. > local ffi =3D require("ffi") > -require("utils").skipcond( > - jit.arch ~=3D "x86" and jit.arch ~=3D "x64" or jit.os ~=3D "Linux" > - or ffi.abi("gc64"), > - jit.arch.." architecture or "..jit.os.. > - " OS is NIY for sysprof" > +local utils =3D require("utils") > +utils.skipcond( > + {jit.arch ~=3D "x86" and jit.arch ~=3D "x64", jit.arch .. > + " architecture is NIY for sysprof"}, > + {jit.os ~=3D "Linux", jit.os .. " OS is NIY for sysprof"}, > + {ffi.abi("gc64"), "GC64 mode is NIY for sysprof"} > ) >=20 > local testsysprof =3D require("testsysprof") > diff --git a/test/tarantool-tests/misclib-sysprof-lapi.test.lua = b/test/tarantool-tests/misclib-sysprof-lapi.test.lua > index 9e0a8a77..e9ae182e 100644 > --- a/test/tarantool-tests/misclib-sysprof-lapi.test.lua > +++ b/test/tarantool-tests/misclib-sysprof-lapi.test.lua > @@ -1,10 +1,11 @@ > -- Sysprof is implemented for x86 and x64 architectures only. > local ffi =3D require("ffi") > -require("utils").skipcond( > - jit.arch ~=3D "x86" and jit.arch ~=3D "x64" or jit.os ~=3D "Linux" > - or ffi.abi("gc64"), > - jit.arch.." architecture or "..jit.os.. > - " OS is NIY for sysprof" > +local utils =3D require("utils") > +utils.skipcond( > + {jit.arch ~=3D "x86" and jit.arch ~=3D "x64", jit.arch .. > + " architecture is NIY for sysprof"}, > + {jit.os ~=3D "Linux", jit.os .. " OS is NIY for sysprof"}, > + {ffi.abi("gc64"), "GC64 mode is NIY for sysprof"} > ) >=20 > local tap =3D require("tap") > diff --git a/test/tarantool-tests/utils.lua = b/test/tarantool-tests/utils.lua > index a1906498..d8412e03 100644 > --- a/test/tarantool-tests/utils.lua > +++ b/test/tarantool-tests/utils.lua > @@ -20,6 +20,10 @@ ffi.cdef([[ > } GCHeader; > ]]) >=20 > +function M.is_M1() > + return jit.os =3D=3D 'OSX' and jit.arch =3D=3D 'arm64' > +end > + > function M.gcisblack(obj) > local objtype =3D type(obj) > local address =3D objtype =3D=3D 'string' > @@ -95,12 +99,18 @@ function M.selfrun(arg, checks) > os.exit(test:check() and 0 or 1) > end >=20 > -function M.skipcond(condition, message) > - if not condition then return end > - local test =3D tap.test(arg[0]:match('/?(.+)%.test%.lua')) > - test:plan(1) > - test:skip(message) > - os.exit(test:check() and 0 or 1) > +function M.skipcond(...) Rather crucial change to the interface. Is it documented in some way? Should it? Some in-line, or a readme? Nottin?..=20 > + local conditions =3D {...} > + local ncond =3D #conditions > + for i =3D 1, ncond do > + local condition, message =3D conditions[i][1], conditions[i][2] > + if condition then > + local test =3D tap.test(arg[0]:match('/?(.+)%.test%.lua')) > + test:plan(1) > + test:skip(message) > + os.exit(test:check() and 0 or 1) > + end > + end > end >=20 > function M.hasbc(f, bytecode) > --=20 > 2.34.1 >=20