Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: tml <tarantool-patches@freelists.org>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	Konstantin Osipov <kostja@tarantool.org>
Subject: Re: [PATCH] box/memtx: strip_core -- Warn on linux only
Date: Thu, 29 Aug 2019 15:19:05 +0300	[thread overview]
Message-ID: <20190829121905.h6v6hfheq6g3ejhy@tkn_work_nb> (raw)
In-Reply-To: <20190828181322.16768-1-gorcunov@gmail.com>

LGTM.

My thoughts on the topic are below.

WBR, Alexander Turenko.

On Wed, Aug 28, 2019 at 09:13:22PM +0300, Cyrill Gorcunov wrote:
> We know that madvise(MADV_DONTDUMP) is present
> on linux based platforms only (macos doesn't
> support it at all, freebsd requires MADV_NOCORE
> or similar which is unsupported by now) thus
> we should not print a warning on other systems
> to not spam users.
> 
> Fixes #4464
> ---
> Sasha, could you please check if it fixes the problem?

The warning is not shown on Mac OS at box.cfg{} after the patch.

> 
>  src/main.cc | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/src/main.cc b/src/main.cc
> index 5776aa41d..b16cfa5fe 100644
> --- a/src/main.cc
> +++ b/src/main.cc
> @@ -496,7 +496,19 @@ load_cfg()
>  	 */
>  	if (cfg_geti("strip_core")) {
>  		if (!small_test_feature(SMALL_FEATURE_DONTDUMP)) {
> -			say_warn("'strip_core' is set but unsupported");
> +			static const char strip_msg[] =
> +				"'strip_core' is set but unsupported";
> +#ifdef TARGET_OS_LINUX
> +			/*
> +			 * Linux is known to support madvise(DONT_DUMP)
> +			 * feature, thus warn on this platform only. The
> +			 * rest should be notified on verbose level only
> +			 * to not spam a user.
> +			 */
> +			say_warn(strip_msg);
> +#else
> +			say_verbose(strip_msg);
> +#endif

I think it is okay: it is the minor thing and an easiest way to solve is
the better way.

If we'll have more OS dependent features (hopefully we'll not), then
maybe it will be worth to do two things:

* Check whether a user asks to enable something explicitly (or it was
  set by default); give a warning only for an explicit choose.
* Check whether libsmall was compiled with a feature supported and don't
  give a warning if a tarantool build does not support a feature on a
  platform at all (it is instead of TARGET_OS_LINUX check).

Those bullets implemented will give us the following logic: give a
warning only if a user explicitly asks a feature AND it is supported on
a platform AND it is not supported at runtime.

  parent reply	other threads:[~2019-08-29 12:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28 18:13 Cyrill Gorcunov
2019-08-29 10:39 ` [tarantool-patches] " Konstantin Osipov
2019-08-29 12:19 ` Alexander Turenko [this message]
2019-08-29 18:55   ` Cyrill Gorcunov
2019-08-29 22:16     ` Alexander Turenko
2019-08-30  7:24       ` Cyrill Gorcunov
2019-08-29 19:28 ` [tarantool-patches] " Kirill Yukhin

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=20190829121905.h6v6hfheq6g3ejhy@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH] box/memtx: strip_core -- Warn on linux only' \
    /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