Re: Memory unit GUC range checks - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Memory unit GUC range checks
Date
Msg-id 20180516194137.2ra7op2bopmxb7yt@alap3.anarazel.de
Whole thread Raw
In response to Re: Memory unit GUC range checks  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Memory unit GUC range checks  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
List pgsql-hackers
Hi,

On 2018-05-16 15:49:29 +0300, Heikki Linnakangas wrote:
> Here's a pretty straightforward fix for these two issues. Any objections or
> better ideas?

Generally ok, two minor points:

> diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
> index 7cd2d2d80e..93402030f7 100644
>      {"TB", GUC_UNIT_BLOCKS, (1024 * 1024 * 1024) / (BLCKSZ / 1024)},
>      {"GB", GUC_UNIT_BLOCKS, (1024 * 1024) / (BLCKSZ / 1024)},
>      {"MB", GUC_UNIT_BLOCKS, 1024 / (BLCKSZ / 1024)},
>      {"kB", GUC_UNIT_BLOCKS, -(BLCKSZ / 1024)},
> +    {"B", GUC_UNIT_BLOCKS, -(BLCKSZ / (1024 * 1024))},

Isn't this 0 in the common case of 8k pages?


>      {"TB", GUC_UNIT_XBLOCKS, (1024 * 1024 * 1024) / (XLOG_BLCKSZ / 1024)},
>      {"GB", GUC_UNIT_XBLOCKS, (1024 * 1024) / (XLOG_BLCKSZ / 1024)},
>      {"MB", GUC_UNIT_XBLOCKS, 1024 / (XLOG_BLCKSZ / 1024)},
>      {"kB", GUC_UNIT_XBLOCKS, -(XLOG_BLCKSZ / 1024)},
> +    {"B", GUC_UNIT_XBLOCKS, -(XLOG_BLCKSZ / (1024 * 1024))},

Same?

Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Odd procedure resolution
Next
From: Simon Riggs
Date:
Subject: Re: Removing unneeded self joins