public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jacob Champion <[email protected]>
To: Thomas Munro <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Daniel Gustafsson <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Subject: Re: [PATCH] OAuth: fix performance bug with stuck multiplexer events
Date: Thu, 7 Aug 2025 11:11:02 -0700
Message-ID: <CAOYmi+=FVbELVYRq=kUri4EOjanyxNGjd2F1H-kMY9h2y=bVGg@mail.gmail.com> (raw)
In-Reply-To: <CA+hUKGKV5aM1K3gc_kAMtUq-BkD5AugLUCDVa-RMnbfFypALwQ@mail.gmail.com>
References: <CAOYmi+nDZxJHaWj9_jRSyf8uMToCADAmOfJEggsKW-kY7aUwHA@mail.gmail.com>
	<CAOYmi+mRhhzGUvrcdickepAnsdaGbqhNcboNe4-YvgtkSzGNbQ@mail.gmail.com>
	<CA+hUKGLyS-GK_rkENaVbFVTa4VJ+reJxWtt+q4gmgNUXhptfYA@mail.gmail.com>
	<CAOYmi+k1q3feeMxfbaJA=+hx+XnOFQA0z2JU+0igA7fTUZTmoA@mail.gmail.com>
	<CA+hUKG+H1gwDh96jn5jB6Q3HyXrSC9x2y=uQJAthT8NLs6GN_Q@mail.gmail.com>
	<CAOYmi+n1xRNCDnwZzigXVk8V=+sr7ZzuGpJ0tAyozX-zQT19Gg@mail.gmail.com>
	<CAOYmi+mvk8Y7btYJhBzOGiNTY3cCpYZKjhA4-TP2Lkb=zOr4oQ@mail.gmail.com>
	<CA+hUKGKV5aM1K3gc_kAMtUq-BkD5AugLUCDVa-RMnbfFypALwQ@mail.gmail.com>

On Wed, Aug 6, 2025 at 6:46 PM Thomas Munro <[email protected]> wrote:
> "Unlike epoll descriptors, kqueue descriptors only transition from
> readable to unreadable when kevent() is called and finds nothing,
> after removing level-triggered conditions that have gone away.  We
> therefore need a dummy kevent() call after operations might have been
> performed on the monitored sockets or timer_fd.  Any event returned is
> ignored here, but it also remains queued (being level-triggered) and
> leaves the descriptor readable.  This is a no-op for epoll
> descriptors."

I really like this; I'm working it into the doc comment.

> FWIW I re-read the kqueue paper's discussion of the goals of making
> kqueue descriptors themselves monitorable/pollable, and it seems it
> was mainly intended for hierarchies of kqueues, like your timer_fd,
> with the specific aim of expressing priorities.  It doesn't talk about
> giving them to code that doesn't know it has a kqueue fd (the client)
> and never calls kevent() and infers the events instead (libcurl).

Interesting! It would be nice if they papered over this for us, but I
guess that's water under the bridge.

> s/signalled/signaled/ (= US spelling) in a couple of places.

Ah. Will fix(?) or else lobby the dictionary companies.

Thank you so much for the reviews!

--Jacob





view thread (25+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [PATCH] OAuth: fix performance bug with stuck multiplexer events
  In-Reply-To: <CAOYmi+=FVbELVYRq=kUri4EOjanyxNGjd2F1H-kMY9h2y=bVGg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox