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 85F366EC56; Sun, 14 Mar 2021 19:30:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 85F366EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1615739459; bh=+xc93jN0xBVi73DILTSpmVJQtWGXvHBHRxSUfDCHGCw=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=TgBtO6fyK0Vzjw3YPn3fu2Lxc56mflgY80Dp5Zwh3TyNJziBJZxYjwu5I1f7lhXd2 NFJqUOg8n85eoSvNFXNNPOMiqYkm2AewZugdQN79lST/otuwAHWw5yz+SqhQxhglka TGAxKbxIRjbGQmQrDLJYU4cnMDG2LPAdi/2dW6PY= 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 949BD6EC56 for ; Sun, 14 Mar 2021 19:30:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 949BD6EC56 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1lLTdq-00056A-3l; Sun, 14 Mar 2021 19:30:58 +0300 To: Cyrill Gorcunov , tml References: <20210310204710.186461-1-gorcunov@gmail.com> <20210310204710.186461-2-gorcunov@gmail.com> Message-ID: <22029d0a-d7b1-ccb6-b928-a7e277e034c0@tarantool.org> Date: Sun, 14 Mar 2021 17:30:57 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210310204710.186461-2-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9D3134714A9BDB69B54C6354AEEB3BDF9AAE3283F1E6CEA6100894C459B0CD1B99CFD068D9E40E459B667A7F5235D7D3A42B63D32119EB8B832F1CFC60563ED00 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE712EB008F780777E9EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637603D0B7FC8E46DFC8638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C7FF294EE7CC9FD506866CF69D139B08F07A93D2CEC394DB7A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE709B92020B71E24959FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3A12191B5F2BB8629117882F4460429728AD0CFFFB425014E868A13BD56FB6657A7F4EDE966BC389F9E8FC8737B5C2249AC294AFEFA671E80089D37D7C0E48F6CCF19DD082D7633A0E7DDDDC251EA7DABAAAE862A0553A39223F8577A6DFFEA7CAD67A113071E75DA43847C11F186F3C5E7DDDDC251EA7DABCC89B49CDF41148F90DBEB212AEC08F22623479134186CDE6BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5BD5F297A03CEE5AFE913C308039E9B17679C0FE4211786B5D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75F04B387B5D7535DE410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D344F2126FF337FA6512E6FF4A4131F167C6D7AB9044880C5C209ADB919E21142533ED02A408187A07E1D7E09C32AA3244C6059A4F09DFC8B52D71E6F6F1F6D0F13250262A5EE9971B0729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj4I/mOTH/3lFYtIIjDAV99w== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822DF8F29074E6EEB70ED9759A0B0AA223E3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 1/2] gc: use wide integer for schedule counting 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 Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thanks for the patch! > diff --git a/src/box/gc.c b/src/box/gc.c > index 1f8cc818d..86c229c34 100644 > --- a/src/box/gc.c > +++ b/src/box/gc.c > @@ -239,15 +239,15 @@ gc_cleanup_fiber_f(va_list ap) > { > (void)ap; > while (!fiber_is_cancelled()) { > - int delta = gc.cleanup_scheduled - gc.cleanup_completed; > + int64_t delta = gc.cleanup_scheduled - gc.cleanup_completed; > if (delta == 0) { > /* No pending garbage collection. */ > fiber_sleep(TIMEOUT_INFINITY); > continue; > } > - assert(delta > 0); > gc_run_cleanup(); > gc.cleanup_completed += delta; > + assert(delta > 0 && gc.cleanup_completed > 0); You didn't need to change the assertion. If `delta` is always positive, and `cleanup_completed` is populated only from `delta`, it is also positive always.