RFR: 8286597: Implement PollerProvider on AIX [v9]

Martin Doerr mdoerr at openjdk.org
Wed May 24 10:06:02 UTC 2023


On Sat, 20 May 2023 07:09:31 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>>> Are there alternatives like using alloca?
>> 
>> Cool suggestion! I actually hadn't heard of it before. I am still not totally sure how it's different from just using local variables which should be on the stack anyway. From a quick man-page search it looks viable to do this here.
>> 
>> Another possibility: I could use Option 2, but not use such a large value for MAX_FDS. The max we choose just dictates how many results are returned by each call to pollset_poll. Any fds not returned in one call should just be returned the next call, and the poll loop is constantly making poll calls.
>> 
>> Some quick testing suggests that pollset does a pretty good job of returning unseen events first. Polling a set of 8 files that could all be read with a pollset size of 1, I saw 8 unique fds.
>> 
>> So, I'm leaning towards Option 2 with MAX_FDS of ~16. Does that seems like a reasonable compromise?
>
>> Option 2 seems to be the popular choice, and I'm amenable to changing that. It does seems a bit silly to allocate 2 * 512 * 8 bytes == 8 KiB for each Poller when I've only seen 4 * 8 bytes in use.
> 
> There are 2 Poller threads per VM. They run in a loop that does a blocking poll (pollset_poll in the discussion here) to pick up events in bulk. 8K doesn't seem too bad and you could reduce the 512 to a small batch size if you want.
> 
> Another point is that there is configuration knob to control the registration. In "direct" mode, virtual threads that need to block on I/O will will attempt to directly arm the file descriptor. This means that implRegister will be called concurrently by many threads, the implRegister implementation in the changes here will increment and decrement setsize without synchronization. You may not have seen this as the default uses "indirect" mode.

I agree. 8K per Poller threads sounds still affordable.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13452#discussion_r1203832861


More information about the hotspot-dev mailing list