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 A446E2B314 for ; Wed, 26 Sep 2018 13:36:30 -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 dTsg2oOw1zho for ; Wed, 26 Sep 2018 13:36:30 -0400 (EDT) Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [217.69.128.37]) (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 F3D1A2AEB7 for ; Wed, 26 Sep 2018 13:36:29 -0400 (EDT) Received: from [185.6.245.178] (port=40750 helo=atlas.local) by smtp57.i.mail.ru with esmtpa (envelope-from ) id 1g5Djf-0006Wp-OW for tarantool-patches@freelists.org; Wed, 26 Sep 2018 20:36:27 +0300 Date: Wed, 26 Sep 2018 20:36:25 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 2/3] Proper unwind for currently executing fiber Message-ID: <20180926173625.GO30528@chai> References: <7b844650e2e0799813e82b32ea2d637982bc3395.1537535602.git.georgy@tarantool.org> <20180925233402.GJ3137@chai> <14423179.bJO8PXla9P@home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14423179.bJO8PXla9P@home.lan> 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 * Georgy Kirichenko [18/09/26 10:46]: > On Wednesday, September 26, 2018 2:34:02 AM MSK Konstantin Osipov wrote: > > * Georgy Kirichenko [18/09/22 00:21]: > > > A fiber's coro context stores execution state for a corresponding > > > already yielded fiber. If fiber is on the execution then it hasn't > > > valid stored coro state and might be backtraced without a special unwind > > > context builder. > > > > I did not understand what's going on from the comment. I assume > > this is an optimization, in which you try to avoid re-fetching the > > registers in some cases? > > > > Please clarify. > > > > > -- > > Each yielded fiber has a preserved coro state stored in a corresponding > variable however an executing fiber has a volatile state placed in CPU > registers (stack pointer, instruction pointer and non-volatile registers) and > corresponding context-storing variable value is invalid. > For already yielded fiber we use a special asm-written handler to make a > temporary switch to the preserved state and capture executing context what is > not needed for executing fiber. > After the patch for the executing fiber NULL is passed to the backtrace > function as coro context and then backtrace function could decide should it > use special context-switching handler or might just use unw_getcontext from > the unwind library. this is more clear, please add to the source code as a comment. ok to push. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov