Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH v7 1/2] fiber: set diagnostics at madvise/mprotect failure
Date: Sat, 15 Feb 2020 20:55:47 +0300	[thread overview]
Message-ID: <20200215175547.GB2527@uranus> (raw)
In-Reply-To: <be542694-ae6a-883c-a3ef-0024b1a20440@tarantool.org>

On Sat, Feb 15, 2020 at 04:41:39PM +0100, Vladislav Shpilevoy wrote:
> > 
> > It highly depends on compiler. It might be optimized and not allocated
> > on the stack at all or it might be allocated and loaded in the procedure
> > prologue (which will happen with optimization disabled).
> 
> This is what I don't like - dependency on whether a compiler will
> optimize something or not.

I mean the different thing. If variable declared as const inside
prologue it might be or might be not rolled in without load. To
prevent possible load I use static var.

> > 
> > And I'll have to modify both -- comment and code if we need
> > to change the permissions. Thanks but no. We could do better
> > and keep R|W in one place.
> 
> I can't imagine why would we need other flags here, but anyway if
> that will happen, I am sure it will change much more than just a
> comment. However, this is subjective.

Yup.

> 
> > But if you bothers this approach I could just inline R|W, no problem.
> 
> Usually for similar things, when it is wanted to have a constant
> expression as a single identifier, enum works well, and we use
> that a lot, for the same reasons. So I propose you to consider a
> enum then. Anonymous enum in fiber.c.

Sure, thanks

> > Still there is a really big question remains -- what to do with
> > the issue. I suspect Kostya has something different in mind. So
> > for now I'm giving up cooking this series (until I'll be sure
> > that I really understand the next step to walk).
> 
> Ok. Btw, I don't understand what is wrong with the current
> solution.

I though of extending code on the top of this series to drop
r|w in release builds completely, but not right now. So lets
wait for Kostya to respond.

  reply	other threads:[~2020-02-15 17:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13 20:56 [Tarantool-patches] [PATCH v7 0/2] fiber: Handle stack madvise/mprotect errors Cyrill Gorcunov
2020-02-13 20:56 ` [Tarantool-patches] [PATCH v7 1/2] fiber: set diagnostics at madvise/mprotect failure Cyrill Gorcunov
2020-02-13 23:26   ` Vladislav Shpilevoy
2020-02-14  7:54     ` Cyrill Gorcunov
2020-02-14 22:27       ` Vladislav Shpilevoy
2020-02-15  6:57         ` Cyrill Gorcunov
2020-02-15 15:41           ` Vladislav Shpilevoy
2020-02-15 17:55             ` Cyrill Gorcunov [this message]
2020-02-13 20:56 ` [Tarantool-patches] [PATCH v7 2/2] fiber: leak slab if unable to bring prots back Cyrill Gorcunov
2020-02-13 23:26   ` Vladislav Shpilevoy
2020-02-14  8:25     ` Cyrill Gorcunov
2020-02-13 20:57 ` [Tarantool-patches] [PATCH v7 0/2] fiber: Handle stack madvise/mprotect errors Cyrill Gorcunov
2020-02-13 23:26 ` Vladislav Shpilevoy
2020-02-14  7:07   ` Cyrill Gorcunov

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=20200215175547.GB2527@uranus \
    --to=gorcunov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v7 1/2] fiber: set diagnostics at madvise/mprotect failure' \
    /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