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 703F164661; Sun, 7 Feb 2021 21:13:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 703F164661 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1612721622; bh=noaAbciFpkmv0l692kDiMSKR7Wj1rBfsCZ8jQJfiDvE=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Zwy4vsUsoBxpzQe9WPWdPt3SE8zJYqpj9/xEUEh+L49FWfDHEWQhnAE+yqLHYXnGe hgVAZh3BSsTod1zzNdyLvXrsU5xZ7Eal6lJT0MbrZ/NUC8BC6kI54rfMxqmuBA6HGu +jFAgu4GXfyDGqBXBIVWYL7xZL1H4eOjEnNi1/cU= Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [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 3D3776EC58 for ; Sat, 6 Feb 2021 20:55:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3D3776EC58 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1l8Rnc-0003zn-8x; Sat, 06 Feb 2021 20:55:12 +0300 To: Cyrill Gorcunov , tml References: <20210205185436.638894-1-gorcunov@gmail.com> Message-ID: <1a9a104a-89eb-2acd-3ed0-f65f59d80084@tarantool.org> Date: Sat, 6 Feb 2021 18:55:11 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210205185436.638894-1-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD953AC099BC0052A9C4647521586BE7E6324520D2A088600D8182A05F5380850403B7BB06C66536AE7F4549CDBA4F4193AB0D98204036191358B0D76B806BBB126 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE754CF51794FD91028EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637B0052F7941B60F658638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FCA44FD8501F9B515BD29C8E0A2954AE8FBE6A856DB70987C2389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0D9442B0B5983000E8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B64854413538E1713FCC7F00164DA146DA6F5DAA56C3B73B23C77107234E2CFBA567F23339F89546C55F5C1EE8F4F765FC924EEDD5C05CD7BD75ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE4930A3850AC1BE2E735BAAD9279A72BC9ABC4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F93F060FBA3C93C613B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A522993ACE9CF820C4C7E83B422DA81DD3BE1C7DAE45990C13D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34351729636A02D1DEDC3A8812E14FA28E1675BF8D709A0DE35907F201883A54E87A30C27592A228FA1D7E09C32AA3244C93C7AA701B47A50A642AB466D85DEFB2F26BFA4C8A6946B883B48618A63566E0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojrtzFuKLsNbwkNCPYbwgEZg== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638227C96053D1ACFE6672220B1DF84D1A31E3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v15 00/11] box: implement cmod Lua module 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Cc: Mons Anderson Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thanks for the patchset! > v15: > - report module state cached/orphan > - update test cases > - do not prevent functions lookup in orphan modules > - there was an idea to use box.shema.func cache as on > top of cmod's one, but this doesn't work because in case > if module doesnt exist in any caches we would put it into > into cmod's one as well but there wont be a module on > cmod level which would clean it up later (which makes > code a way more comple if we choose to track state > of modules). It wouldn't be related to cmod. Did you really try? The cache would work on the level of module_cache. And entries there would be reference counted. If a module is used only by box.schema.func, it has ref counter 1. If it not used anymore, it gets counter 0 and is deleted. If it also used by cmod, its counter is not 0, and it is not deleted. What is the problem? > branch gorcunov/gh-4642-func-ro-15 > issue https://github.com/tarantool/tarantool/issues/4642 > > Cyrill Gorcunov (11): > box/func: factor out c function entry structure > module_cache: move module handling into own subsystem > module_cache: direct update a cache value on reload > module_cache: rename calls to ref in module structure > module_cache: add comment about weird resolving > module_cache: module_reload - drop redundant parameter > module_cache: use references as a main usage counter > module_cache: make module to carry hash it belongs to > module_cache: use own hash for box.schema.func requests > box/cmod: implement cmod Lua module > test: box/cfunc -- add cmod test > > src/box/CMakeLists.txt | 2 + > src/box/call.c | 10 +- > src/box/func.c | 491 +------------------------- > src/box/func.h | 41 +-- > src/box/func_def.h | 14 - > src/box/lua/cmod.c | 610 ++++++++++++++++++++++++++++++++ > src/box/lua/cmod.h | 24 ++ > src/box/lua/init.c | 2 + > src/box/module_cache.c | 756 ++++++++++++++++++++++++++++++++++++++++ > src/box/module_cache.h | 178 ++++++++++ > test/box/CMakeLists.txt | 2 + > test/box/cfunc1.c | 58 +++ > test/box/cfunc2.c | 137 ++++++++ > test/box/cmod.result | 336 ++++++++++++++++++ > test/box/cmod.test.lua | 130 +++++++ > test/box/suite.ini | 2 +- > 16 files changed, 2248 insertions(+), 545 deletions(-) > create mode 100644 src/box/lua/cmod.c > create mode 100644 src/box/lua/cmod.h > create mode 100644 src/box/module_cache.c > create mode 100644 src/box/module_cache.h > create mode 100644 test/box/cfunc1.c > create mode 100644 test/box/cfunc2.c > create mode 100644 test/box/cmod.result > create mode 100644 test/box/cmod.test.lua > > > base-commit: 7722a81c6a5a3c57c27a688c957fb187d81850f0 >