]> granicus.if.org Git - postgresql/commit
Avoid floating-point underflow while tracking buffer allocation rate.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 19 Nov 2011 05:35:29 +0000 (00:35 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 19 Nov 2011 05:35:59 +0000 (00:35 -0500)
commit590ceed6f21fd243a6caf7233d3b2ce01350ecb6
treebd049d962af40fcef15d35fb927671ef7f53baf5
parent663e27c405a0e6bfe7c4fd7e23dce67a46fb07e9
Avoid floating-point underflow while tracking buffer allocation rate.

When the system is idle for awhile after activity, the "smoothed_alloc"
state variable in BgBufferSync converges slowly to zero.  With standard
IEEE float arithmetic this results in several iterations with denormalized
values, which causes kernel traps and annoying log messages on some
poorly-designed platforms.  There's no real need to track such small values
of smoothed_alloc, so we can prevent the kernel traps by forcing it to zero
as soon as it's too small to be interesting for our purposes.  This issue
is purely cosmetic, since the iterations don't happen fast enough for the
kernel traps to pose any meaningful performance problem, but still it seems
worth shutting up the log messages.

The kernel log messages were previously reported by a number of people,
but kudos to Greg Matthews for tracking down exactly where they were coming
from.
src/backend/storage/buffer/bufmgr.c