Re: AutoVacuum starvation from sinval messages - Mailing list pgsql-hackers

From Tom Lane
Subject Re: AutoVacuum starvation from sinval messages
Date
Msg-id 20647.1352412983@sss.pgh.pa.us
Whole thread Raw
In response to Re: AutoVacuum starvation from sinval messages  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-hackers
Jeff Janes <jeff.janes@gmail.com> writes:
> On Thu, Nov 8, 2012 at 12:36 PM, Jeff Janes <jeff.janes@gmail.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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: AutoVacuum starvation from sinval messages
Next
From: Tom Lane
Date:
Subject: Re: AutoVacuum starvation from sinval messages