pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Matthews <gregory.a.matthews@nasa.gov>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Claudio Freire <klaussfreire@gmail.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: probably cause (and fix) for floating-point assist faults on itanium
Date: Fri, 18 Nov 2011 08:37:07 -0800
Message-ID: <Pine.LNX.4.64.1111180834420.10000@linux105.nas.nasa.gov> (raw)
In-Reply-To: <18092.1321632701@sss.pgh.pa.us>
References: <Pine.LNX.4.64.1111171643570.10000@linux105.nas.nasa.gov>
	<CAGTBQpYjs8GHBk1mf__dYVH=4g7ZK2jHrN7ubNYJtYX+47OzNg@mail.gmail.com>
	<18092.1321632701@sss.pgh.pa.us>

Looks good to me. I built PG with this change, no kernel warnings after 
~10 minutes of running. I'll continue to monitor but I think this fixes 
the syndrome. Thanks Tom.

-Greg


On Fri, 18 Nov 2011, Tom Lane wrote:

> Claudio Freire <klaussfreire@gmail.com> writes:
>> On Thu, Nov 17, 2011 at 10:07 PM, Greg Matthews
>> <gregory.a.matthews@nasa.gov> wrote:
>>>        if (smoothed_alloc <= (float) recent_alloc)
>>>                smoothed_alloc = recent_alloc;
>>>        else if (smoothed_alloc >= 0.00001)
>>>                smoothed_alloc += ((float) recent_alloc - smoothed_alloc) /
>>>                        smoothing_samples;
>>>
>
>> I don't think that logic is sound.
>
>> Rather,
>
>>        if (smoothed_alloc <= (float) recent_alloc) {
>>                smoothed_alloc = recent_alloc;
>>        } else {
>>                if (smoothed_alloc < 0.000001)
>>                    smoothed_alloc = 0;
>>                smoothed_alloc += ((float) recent_alloc - smoothed_alloc) /
>>                        smoothing_samples;
>>        }
>
> The real problem with either of these is the cutoff number is totally
> arbitrary.  I'm thinking of something like this:
>
>    /*
>     * Track a moving average of recent buffer allocations.  Here, rather than
>     * a true average we want a fast-attack, slow-decline behavior: we
>     * immediately follow any increase.
>     */
>    if (smoothed_alloc <= (float) recent_alloc)
>        smoothed_alloc = recent_alloc;
>    else
>        smoothed_alloc += ((float) recent_alloc - smoothed_alloc) /
>            smoothing_samples;
>
>    /* Scale the estimate by a GUC to allow more aggressive tuning. */
>    upcoming_alloc_est = smoothed_alloc * bgwriter_lru_multiplier;
>
> +    /*
> +    * If recent_alloc remains at zero for many cycles,
> +    * smoothed_alloc will eventually underflow to zero, and the
> +    * underflows produce annoying kernel warnings on some platforms.
> +    * Once upcoming_alloc_est has gone to zero, there's no point in
> +    * tracking smaller and smaller values of smoothed_alloc, so just
> +    * reset it to exactly zero to avoid this syndrome.
> +    */
> +   if (upcoming_alloc_est == 0)
> +       smoothed_alloc = 0;
>
>    /*
>     * Even in cases where there's been little or no buffer allocation
>     * activity, we want to make a small amount of progress through the buffer
>
>
> 			regards, tom lane
>



view thread (5+ messages)  latest in thread

Message-ID: <Pine.LNX.4.64.1111180834420.10000@linux105.nas.nasa.gov>
Permalink:  ../Pine.LNX.4.64.1111180834420.10000@linux105.nas.nasa.gov/
Also on:    postgresql.org/message-id/Pine.LNX.4.64.1111180834420.10000@linux105.nas.nasa.gov

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: gregory.a.matthews@nasa.gov, tgl@sss.pgh.pa.us, klaussfreire@gmail.com
  Subject: Re: probably cause (and fix) for floating-point assist faults on itanium
  In-Reply-To: <Pine.LNX.4.64.1111180834420.10000@linux105.nas.nasa.gov>
  References: <Pine.LNX.4.64.1111171643570.10000@linux105.nas.nasa.gov> <CAGTBQpYjs8GHBk1mf__dYVH=4g7ZK2jHrN7ubNYJtYX+47OzNg@mail.gmail.com> <18092.1321632701@sss.pgh.pa.us> <Pine.LNX.4.64.1111180834420.10000@linux105.nas.nasa.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox