From: | Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Bogus sizing parameters in some AllocSetContextCreate calls |
Date: | 2016-08-28 14:52:32 |
Message-ID: | 921fabd9-727a-bf7f-2819-ff39cb6362ae@2ndquadrant.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 08/28/2016 04:41 PM, Tom Lane wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> Also, I think we ought to replace this code in aset.c:
>
>> initBlockSize = MAXALIGN(initBlockSize);
>> if (initBlockSize < 1024)
>> initBlockSize = 1024;
>> maxBlockSize = MAXALIGN(maxBlockSize);
>
>> With this:
>
>> Assert(initBlockSize >= 1024 && initBlockSize == MAXALIGN(initBlockSize));
>> Assert(maxBlockSize == MAXALIGN(maxBlockSize));
>
> Good idea --- if we'd had it that way, these errors would never have
> gotten committed in the first place. I'm for doing that only in HEAD
> though.
>
Then maybe also add
Assert(initBlockSize <= maxBlockSize);
And perhaps also an assert making sure the minContextSize value makes
sens with respect to the min/max block sizes?
I'm however pretty sure this will have absolutely no impact on profiles.
It might save a few cycles, but this only runs when creating the memory
context and all profiles I've seen are about palloc/pfree.
It might matter when creating many memory contexts, but then you
probably have other things to worry about.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Tomas Vondra | 2016-08-28 14:53:07 | Re: Bogus sizing parameters in some AllocSetContextCreate calls |
Previous Message | Tom Lane | 2016-08-28 14:41:59 | Re: Bogus sizing parameters in some AllocSetContextCreate calls |