Re: Let's remove DSM_IMPL_NONE.

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: michael(at)paquier(dot)xyz, tgl(at)sss(dot)pgh(dot)pa(dot)us, andres(at)anarazel(dot)de, robertmhaas(at)gmail(dot)com
Subject: Re: Let's remove DSM_IMPL_NONE.
Date: 2018-07-06 21:08:02
Message-ID: 07bdeea7-e11c-ab13-9aa1-999e13ce2e92@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 26.06.18 09:10, Kyotaro HORIGUCHI wrote:
> --- a/src/bin/initdb/initdb.c
> +++ b/src/bin/initdb/initdb.c
> @@ -984,6 +984,16 @@ test_config_settings(void)
> ok_buffers = 0;
>
>
> + /*
> + * Server doesn't confirm that the server-default DSM implementation is
> + * actually workable. Choose a fine one for probing then it is used on the
> + * new database.
> + */
> + printf(_("selecting dynamic shared memory implementation ... "));
> + fflush(stdout);
> + dynamic_shared_memory_type = choose_dsm_implementation();
> + printf("%s\n", dynamic_shared_memory_type);
> +
> printf(_("selecting default max_connections ... "));
> fflush(stdout);
>

I don't understand that comment. initdb does test whether dsm=posix
works. What more were you hoping for?

> @@ -996,10 +1006,11 @@ test_config_settings(void)
> "\"%s\" --boot -x0 %s "
> "-c max_connections=%d "
> "-c shared_buffers=%d "
> - "-c dynamic_shared_memory_type=none "
> + "-c dynamic_shared_memory_type=%s "
> "< \"%s\" > \"%s\" 2>&1",
> backend_exec, boot_options,
> test_conns, test_buffs,
> + dynamic_shared_memory_type,
> DEVNULL, DEVNULL);
> status = system(cmd);
> if (status == 0)

We could perhaps avoid some variability here by running the
bootstrapping runs in initdb using hardcoded dsm settings of
"sysv"/"windows".

> --- a/src/include/storage/dsm_impl.h
> +++ b/src/include/storage/dsm_impl.h
> @@ -14,11 +14,10 @@
> #define DSM_IMPL_H
>
> /* Dynamic shared memory implementations. */
> -#define DSM_IMPL_NONE 0
> -#define DSM_IMPL_POSIX 1
> -#define DSM_IMPL_SYSV 2
> -#define DSM_IMPL_WINDOWS 3
> -#define DSM_IMPL_MMAP 4
> +#define DSM_IMPL_POSIX 0
> +#define DSM_IMPL_SYSV 1
> +#define DSM_IMPL_WINDOWS 2
> +#define DSM_IMPL_MMAP 3

I would avoid renumbering here. It was kind of sensible to have NONE =
0, so I'd keep the non-NONE ones as non-zero.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-07-06 21:10:18 Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query
Previous Message Sergei Kornilov 2018-07-06 20:56:22 Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query