Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcJFK-0005Ax-2S for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Mar 2023 05:00:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pcJFI-0002Hy-UL for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Mar 2023 05:00:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcJFI-0002Hp-Jy for pgsql-hackers@lists.postgresql.org; Wed, 15 Mar 2023 05:00:16 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pcJFF-0005Bo-D6 for pgsql-hackers@postgresql.org; Wed, 15 Mar 2023 05:00:15 +0000 Received: by mail-ed1-x536.google.com with SMTP id cy23so70644132edb.12 for ; Tue, 14 Mar 2023 22:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678856412; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zmKZtPrM1vy5onbmGZCbObUENMe+Gb5814pnzSn9xHI=; b=SC6t0vesBZE4zTprEk0BkD2Rh+Tj1bB4/bweiYVviujz1M+Nhk1WCgGN3o/U9E/nzo Qxt6eP9+pRCydx0sURfpzhDh/jOVLavwMMBNGKoYX13EUiOyNyNZTYhEJiFNuoM/aoYK 3pTQh9AQ/SRvjcxqKG/tQ15Uxkho5oFhOkU8q5VVn/ggK6qqK53f0tXnWPcQkTHKIimL jBo5WI7sITor3G201CsWLN9PDFZuCi6OzFUF9jb0Tjou/2SuqvWTOQtPnJ2kSSczktO1 xvqjmMk77IbwQmKzr8diEZ0hTR4f/9edD4M6gNhfNe+uzPLQVa1MQH3ZMe0PFNZ0Syks YfVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678856412; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zmKZtPrM1vy5onbmGZCbObUENMe+Gb5814pnzSn9xHI=; b=wNo9ZDVw/wpgQixSoxAY2kT9YsOe847IslGzaDU4eVY/eKfoz2aMaQgnWXv19YLcqq ndo1SgFDwEeqhvU40ioSFDYpGAFj8oPs2gRe9x5Bo+ZmQn/1pBZmRqhpfPYE0m1Ev+NW xRkxmoDEjpxQ1eQzt2vxPNPdNrrsAg4+rDZM856juceNdSMmMOZBa2wwCOE4CmJOKKS/ j/j83fOd8pKe9I1WRPsN7Q8/14EV78ZoVOdfzzkxCugup6rFKNAcGhQbTIWCgHxjUSky sGOqUpJTjD4Lmpyl33/CMpPVztmiicsIyi/ek+UfEAiksqEzBs8oXNyPzJJ6wyQk3QtW JuPQ== X-Gm-Message-State: AO0yUKUB1qErcZPvmDWQYtG4dH8/EZ7tW4Xo79Mtk7L+TSUo9Y6jaCvs qPNAQhruhA49B6XADijQIr7rR54BBGsoogDcqiU= X-Google-Smtp-Source: AK7set+rlDnU36kkcQYzX6YGyGJ3LM/Z+7olpZs9UXHBhLgRvnep1pwL+17Pt3ACOt6f6q/Avf6dKCdSAwtSi4cQ5LE= X-Received: by 2002:a17:906:8552:b0:8ae:9f1e:a1c5 with SMTP id h18-20020a170906855200b008ae9f1ea1c5mr2388265ejy.3.1678856412277; Tue, 14 Mar 2023 22:00:12 -0700 (PDT) MIME-Version: 1.0 References: <705469.1678409199@sss.pgh.pa.us> <709425.1678411315@sss.pgh.pa.us> <1020590.1678488594@sss.pgh.pa.us> <20230313231008.GB428842@nathanxps13> <20230314185428.GA431737@nathanxps13> In-Reply-To: <20230314185428.GA431737@nathanxps13> From: Thomas Munro Date: Wed, 15 Mar 2023 17:59:35 +1300 Message-ID: Subject: Re: Sub-millisecond [autovacuum_]vacuum_cost_delay broken To: Nathan Bossart Cc: Tom Lane , Melanie Plageman , Pg Hackers , Stephen Frost Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Mar 15, 2023 at 7:54=E2=80=AFAM Nathan Bossart wrote: > Here is roughly what I had in mind: > > NOTE: Although the delay is specified in microseconds, older Unix= en and > Windows use periodic kernel ticks to wake up, which might increas= e the > delay time significantly. We've observed delay increases as larg= e as > 20 milliseconds on supported platforms. Sold. And pushed. I couldn't let that 20ms !=3D 1s/100 problem go, despite my claim that I would, and now I see: NetBSD does have 10ms resolution, so everyone can relax, arithmetic still works. It's just that it always or often adds on one extra tick, for some strange reason. So you can measure 20ms, 30ms, ... but never as low as 10ms. *Shrug*. Your description covered that nicely. https://marc.info/?l=3Dnetbsd-current-users&m=3D144832117108168&w=3D2 > > (The word "interrupt" is a bit overloaded, which doesn't help with > > this discussion.) > > Yeah, I think it would be clearer if "interrupt" was disambiguated. OK, I rewrote it to avoid that terminology. On small detail, after reading Tom's 2019 proposal to do this[1]: He mentioned SUSv2's ENOSYS error. I see that SUSv3 (POSIX.1-2001) dropped that. Systems that don't have the "timers" option simply shouldn't define the function, but we already require the "timers" option for clock_gettime(). And more practically, I know that all our target systems have it and it works. Pushed. [1] https://www.postgresql.org/message-id/4902.1552349020@sss.pgh.pa.us