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 620367030C; Fri, 5 Mar 2021 00:02:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 620367030C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614891733; bh=Dcc/MhdhXidKstEWM7naHMuimwjzAAFntT6aPj6Xw/E=; 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=AXr6mShCAH5R70tGr+cvq9KT2bPFj8XBqaEmLSyRye/QFZs0dCRiuue1GmMbi2PUC Rv8/fj0o5Hf0rZ5s7Bgu6vwEXDo+QSxPHqfCxPy8mtUAKnANuJ3L+DCFUDp1zzPaiL 7ckNYd0nS3Y1r5gqc/MHK6PgZMvILbgmZuti1O+o= Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (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 767207030C for ; Fri, 5 Mar 2021 00:02:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 767207030C Received: by smtp54.i.mail.ru with esmtpa (envelope-from ) id 1lHv6p-0002Tc-MZ; Fri, 05 Mar 2021 00:02:12 +0300 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org, yaroslav.dynnikov@tarantool.org References: <02df9747667f254ee5734cfafa681eead566f212.1614039039.git.v.shpilevoy@tarantool.org> Message-ID: <755b27df-bf31-85cc-4392-69792884049e@tarantool.org> Date: Fri, 5 Mar 2021 00:02:10 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <02df9747667f254ee5734cfafa681eead566f212.1614039039.git.v.shpilevoy@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92A98208ECBDD29F5A6709E93A77B8502A831FF4624BDF5D2182A05F538085040A317849DF06F9AD6645B4C13C43082AC630DED461A0AC54D2AFA385685B3380F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72407438AC6002944EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637A975286280E7A0BD8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FCC96B397E54282530A2395C129DA379646BD0D3280DA7506F389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C06030C3405640F6718941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B611E5B64A728E1589CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C2249EFF2E4566065E9BF76E601842F6C81A12EF20D2F80756B5F7E9C4E3C761E06A776E601842F6C81A127C277FBC8AE2E8B0953A2E98198554F3AA81AA40904B5D9DBF02ECDB25306B2B25CBF701D1BE8734AD6D5ED66289B5278DA827A17800CE765B758295022C16667F23339F89546C5A8DF7F3B2552694A6FED454B719173D6725E5C173C3A84C39C7C06E116D69A5E35872C767BF85DA2F004C906525384306FED454B719173D6462275124DF8B9C9DE2850DD75B2526BE5BFE6E7EFDEDCD789D4C264860C145E X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24A6D60772A99906F8E1CD14B953EB46DA94851DA85CB5BA2355D89D7DBCDD132 X-C1DE0DAB: 0D63561A33F958A5491DBED786885B2DD3C296BC0893C0070A2D69993834EEDAD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D349FD10E01B3CDC9E2CB1FAAEA0453DC33374CB18C03B3E0E53073F195B370C91A40E7E3FC22B289851D7E09C32AA3244CC9981FB89E08CF2F3885397C01309F1663871F383B54D9B3FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojSsmoOoMLSh3vL2OQz+0+lg== X-Mailru-Sender: 583F1D7ACE8F49BD3369739A12991F4DC4CF61A6B229E6DCB27639069A60BF94E6787E94E2B4368E23E75C7104EB1B885DEE61814008E47C7013064206BFB89F93956FB04BA385BE9437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH vshard 10/11] sched: introduce vshard.storage.sched 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: Oleg Babin via Tarantool-patches Reply-To: Oleg Babin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! I've looked your patch again. See one comment below. On 23.02.2021 03:15, Vladislav Shpilevoy wrote: > +-- > +-- Return the remaining timeout in case there was a yield. This helps to save > +-- current clock get in the caller code if there were no yields. > +-- > +local function sched_ref_start(timeout) > + local deadline = fiber_clock() + timeout > + local ok, err > + -- Fast-path. Moves are extremely rare. No need to inc-dec the ref queue > + -- then nor try to start some loops. > + if M.move_count == 0 and M.move_queue == 0 then > + goto success > + end > + > + M.ref_queue = M.ref_queue + 1 > + > +::retry:: > + if M.move_count > 0 then > + goto wait_and_retry > + end > + -- Even if move count is zero, must ensure the time usage is fair. Does not > + -- matter in case the moves have no quota at all. That allows to ignore them > + -- infinitely until all refs end voluntarily. > + if M.move_queue > 0 and M.ref_strike >= M.ref_quota and > + M.move_quota > 0 then Is it reasonable to check `move_quota > 0`. According tests it always should be positive. I see similar check for `ref_quota` as well.