From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 7191C2AA87 for ; Thu, 18 Apr 2019 13:23:51 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kYLqhPXzQEj4 for ; Thu, 18 Apr 2019 13:23:51 -0400 (EDT) Received: from smtp37.i.mail.ru (smtp37.i.mail.ru [94.100.177.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 2BAF82AA86 for ; Thu, 18 Apr 2019 13:23:51 -0400 (EDT) Received: by smtp37.i.mail.ru with esmtpa (envelope-from ) id 1hHAlJ-00033A-Dz for tarantool-patches@freelists.org; Thu, 18 Apr 2019 20:23:49 +0300 Date: Thu, 18 Apr 2019 20:23:48 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 4/4] swim: do not rebuild packet meta multiple times Message-ID: <20190418172348.GF13022@chai> References: <11325bc37ed084aac81f9bcdb8b8a041f43e08e4.1555530516.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11325bc37ed084aac81f9bcdb8b8a041f43e08e4.1555530516.git.v.shpilevoy@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org * Vladislav Shpilevoy [19/04/18 09:03]: > Before the patch there were 2 cases when an unchanged packet was > rebuilt partially on each send: > > - cached round message's meta section was rebuilt on each > EV_WRITE event in swim_scheduler_on_output() function; > > - broadcast message's meta section was rebuilt too even though > its content does not depend on a broadcast interface. > > The third case appears with indirect pings patch which aggravates > meta building business by routing and packet forwarding. When a > packet needs to be forwarded farther, its meta is built in a > special manner preserving the route before EV_WRITE appears, and > on_output should not touch that meta. > > This patch adds a check preventing unnecessary meta rebuilds. > Besides, the check and the meta building code are moved into a > dedicated function out of swim_scheduler_on_output() - it allows > to completely split logic of packing a message and sending it. > Separated logic helps a lot when indirect pings are introduced. > ok to push. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov