[jdk16] RFR: 8259765: ZGC: Handle incorrect processor id reported by the operating system [v2]

Per Liden pliden at openjdk.java.net
Tue Jan 19 08:35:45 UTC 2021


On Fri, 15 Jan 2021 22:02:44 GMT, Per Liden <pliden at openjdk.org> wrote:

>> src/hotspot/os/linux/os_linux.cpp line 4769:
>> 
>>> 4767:   const int id = Linux::sched_getcpu();
>>> 4768: 
>>> 4769:   if (id >= 0 && id < processor_count()) {
>> 
>> Do we really need to check if the returned processor ID is negative? That seems a whole new level of environment screwup to me.
>
> I'm thinking we should make this safe to call in all cases. God knows what a broken environment might return.

After some discussions, we agreed to not to check for negative processor ids.

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

PR: https://git.openjdk.java.net/jdk16/pull/124



More information about the hotspot-gc-dev mailing list