Tarantool development patches archive
 help / color / mirror / Atom feed
From: Georgy Kirichenko <georgy@tarantool.org>
To: Konstantin Osipov <kostja@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH 2/3] Proper unwind for currently executing fiber
Date: Wed, 26 Sep 2018 09:57:07 +0300	[thread overview]
Message-ID: <14423179.bJO8PXla9P@home.lan> (raw)
In-Reply-To: <20180925233402.GJ3137@chai>

[-- Attachment #1: Type: text/plain, Size: 1285 bytes --]

On Wednesday, September 26, 2018 2:34:02 AM MSK Konstantin Osipov wrote:
> * Georgy Kirichenko <georgy@tarantool.org> [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.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2018-09-26  6:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-21 13:20 [tarantool-patches] [PATCH 0/3] Dump lua frames for a fiber traceback Georgy Kirichenko
2018-09-21 13:20 ` [tarantool-patches] [PATCH 1/3] Set a lua state for the main fiber too Georgy Kirichenko
2018-09-25 23:27   ` [tarantool-patches] " Konstantin Osipov
2018-10-05 15:04   ` [tarantool-patches] " Vladimir Davydov
2018-09-21 13:20 ` [tarantool-patches] [PATCH 2/3] Proper unwind for currently executing fiber Georgy Kirichenko
2018-09-25 23:34   ` [tarantool-patches] " Konstantin Osipov
2018-09-26  6:57     ` Georgy Kirichenko [this message]
2018-09-26 17:36       ` Konstantin Osipov
2018-10-04  7:44         ` [tarantool-patches] " Georgy Kirichenko
2018-10-04 22:27           ` [tarantool-patches] " Konstantin Osipov
2018-10-05 15:09           ` [tarantool-patches] " Vladimir Davydov
2018-09-21 13:20 ` [tarantool-patches] [PATCH 3/3] Show names of Lua functions in backtraces Georgy Kirichenko
2018-09-25 23:38   ` [tarantool-patches] " Konstantin Osipov
2018-10-04  7:55     ` [tarantool-patches] " Georgy Kirichenko
2018-10-04 22:28       ` [tarantool-patches] " Konstantin Osipov
2018-10-05 17:49       ` [tarantool-patches] " Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14423179.bJO8PXla9P@home.lan \
    --to=georgy@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH 2/3] Proper unwind for currently executing fiber' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox