Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Removed CLOCK_MONOTONIC_COARSE support

Maxim Dounin
October 21, 2021 11:42AM
Hello!

On Tue, Oct 19, 2021 at 03:07:24PM +0300, Sergey Kandaurov wrote:

> > On 11 Oct 2021, at 21:53, Maxim Dounin <mdounin@mdounin.ru> wrote:
> >
> > # HG changeset patch
> > # User Maxim Dounin <mdounin@mdounin.ru>
> > # Date 1633978301 -10800
> > # Mon Oct 11 21:51:41 2021 +0300
> > # Node ID 3217b92006f8807d16134246a064baab64fa7b32
> > # Parent ae7c767aa491fa55d3168dfc028a22f43ac8cf89
> > Removed CLOCK_MONOTONIC_COARSE support.
> >
> > While clock_gettime(CLOCK_MONOTONIC_COARSE) is faster than
> > clock_gettime(CLOCK_MONOTONIC), the latter is fast enough on Linux for
> > practical usage, and the difference is negligible compared to other costs
> > at each event loop iteration. On the other hand, CLOCK_MONOTONIC_COARSE
> > causes various issues with typical CONFIG_HZ=250, notably very inacurate
>
> "inaccurate"

Fixed, thnx.

> > limit_rate handling in some edge cases (ticket #1678) and negative difference
> > between $request_time and $upstream_response_time (ticket #1965).
> >
> > diff --git a/src/core/ngx_times.c b/src/core/ngx_times.c
> > --- a/src/core/ngx_times.c
> > +++ b/src/core/ngx_times.c
> > @@ -200,10 +200,6 @@ ngx_monotonic_time(time_t sec, ngx_uint_
> >
> > #if defined(CLOCK_MONOTONIC_FAST)
> > clock_gettime(CLOCK_MONOTONIC_FAST, &ts);
> > -
> > -#elif defined(CLOCK_MONOTONIC_COARSE)
> > - clock_gettime(CLOCK_MONOTONIC_COARSE, &ts);
> > -
> > #else
> > clock_gettime(CLOCK_MONOTONIC, &ts);
> > #endif
> >
>
> While fast clock is certainly important in general,
> and _COARSE is faster even in userspace clock_gettime(),
> I tend to agree that it has too coarse granularity,
> which causes more harm than good.

Committed, thnx for the review.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Removed CLOCK_MONOTONIC_COARSE support

Maxim Dounin 352 October 11, 2021 02:54PM

Re: [PATCH] Removed CLOCK_MONOTONIC_COARSE support

Sergey Kandaurov 143 October 19, 2021 08:08AM

Re: [PATCH] Removed CLOCK_MONOTONIC_COARSE support

Maxim Dounin 121 October 21, 2021 11:42AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 308
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready