Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] refactoring: drop excess 16Kb bss buffer
Date: Mon, 13 Jan 2020 23:00:50 +0100	[thread overview]
Message-ID: <96b3011a-c4ce-d685-3b9e-4b2d2f497206@tarantool.org> (raw)
In-Reply-To: <20200109200636.26308-1-skaplun@tarantool.org>

Hi! Thanks for the patch!

> diff --git a/src/lib/core/backtrace.cc b/src/lib/core/backtrace.cc
> index 77f77b05c..eabd986df 100644
> --- a/src/lib/core/backtrace.cc
> +++ b/src/lib/core/backtrace.cc
> @@ -55,8 +56,6 @@
>  
>  #define BACKTRACE_NAME_MAX 200
>  
> -static char backtrace_buf[4096 * 4];
> -
>  static __thread struct region cache_region;
>  static __thread struct mh_i64ptr_t *proc_cache = NULL;
>  
> @@ -140,8 +139,9 @@ backtrace()
>  	unw_getcontext(&unw_context);
>  	unw_cursor_t unw_cur;
>  	unw_init_local(&unw_cur, &unw_context);
> +	char *backtrace_buf = (char *)static_alloc(SMALL_STATIC_SIZE);

Perhaps it is worth increasing SMALL_STATIC_SIZE with 4096
additional bytes so as not to decrease backtrace buffer size.
Backtrace was using 4096 * 4, while SMALL_STATIC_SIZE is
4096 * 3.

On the other hand, increase of static buffer size would make
total size of BSS section even bigger than before the patch,
because the static buffer is thread local. So + 4096 for this
buffer means at least + 4096 * 3 because we have at least 3
threads.

I am ok with both options. Because I don't know whether do we
really need so big buffer for a backtrace or not.

Also Cyrill is right, it is worth adding an assertion
that static_alloc does not fail.

      parent reply	other threads:[~2020-01-13 22:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09 20:06 Sergey Kaplun
2020-01-09 20:15 ` Cyrill Gorcunov
2020-01-09 20:18   ` Cyrill Gorcunov
2020-01-13 22:00 ` Vladislav Shpilevoy [this message]

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=96b3011a-c4ce-d685-3b9e-4b2d2f497206@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=skaplun@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] refactoring: drop excess 16Kb bss buffer' \
    /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