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 78ED12B387 for ; Wed, 26 Sep 2018 02:57:15 -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 cxtyvWZyK6AG for ; Wed, 26 Sep 2018 02:57:15 -0400 (EDT) Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [217.69.128.35]) (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 C069A2B386 for ; Wed, 26 Sep 2018 02:57:14 -0400 (EDT) From: Georgy Kirichenko Subject: [tarantool-patches] Re: [PATCH 2/3] Proper unwind for currently executing fiber Date: Wed, 26 Sep 2018 09:57:07 +0300 Message-ID: <14423179.bJO8PXla9P@home.lan> In-Reply-To: <20180925233402.GJ3137@chai> References: <7b844650e2e0799813e82b32ea2d637982bc3395.1537535602.git.georgy@tarantool.org> <20180925233402.GJ3137@chai> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart5371470.TTZhJH8K3A"; micalg="pgp-sha256"; protocol="application/pgp-signature" 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: Konstantin Osipov Cc: tarantool-patches@freelists.org --nextPart5371470.TTZhJH8K3A Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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. --nextPart5371470.TTZhJH8K3A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBJFDbU76LsBbgHBsvKOmCX79zb4FAlurLcMACgkQvKOmCX79 zb6ZBAf7BApxYyi/7xD7HaAQneJTWAcYAK0eBZLeOk4ULJL33c0WBpzyH3fkwfKh SoS0XQiAZeT7IZKZlCJl78K6K3fhReuh7TszAtv+YmhBz8SdboNC04nHkgqo3fDf +DAI+DaV8u2jRfmmUAotrkybilTxAdpXf3i13ImTu9Pa6+dSyEogXax6boQwt5wU WtX7Qiw19cqJoPaNYIR+U10XVoC9yXa5NRUQ0o8rQ1qA/VR+g2d68F9wA5GG6yF+ 4TevX2mXyE/al/EQ1zHiOBqDD7KCyaEVFluv+mw5SbP9i90ugGt5hhxRu7zI6y5s aoHLCqphPa0JTaMFG3Kq4sOAYUh8dg== =UjIi -----END PGP SIGNATURE----- --nextPart5371470.TTZhJH8K3A--