Re: AutoVacuum starvation from sinval messages

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: AutoVacuum starvation from sinval messages
Date: 2012-11-08 22:16:23
Message-ID: 20647.1352412983@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Janes <jeff(dot)janes(at)gmail(dot)com> writes:
> On Thu, Nov 8, 2012 at 12:36 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
>> Should gettimeofday be called before and after the poll() and then the
>> difference deducted from timeout?

> Something like this?

Meh. Not like that, because

(1) we shouldn't add overhead when no timeout is requested.
(2) it'd be better to do only one gettimeofday at the start and then
one in the EINTR path, not one per loop; this saves syscalls and also
avoids slippage of the timeout time.
(3) the select() path needs a similar fix.

But I think you have a good idea to use the INSTR_TIME macros instead
of custom code, even though this is Unix-only so there's not more than
one underlying implementation.

Will fix this up and commit.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-11-08 22:24:52 Re: AutoVacuum starvation from sinval messages
Previous Message Tom Lane 2012-11-08 22:12:07 Re: AutoVacuum starvation from sinval messages