[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-runtime-dev
Subject:    [jdk16] Integrated: 8259765: ZGC: Handle incorrect processor id reported by the operating system
From:       Per Liden <pliden () openjdk ! java ! net>
Date:       2021-01-28 8:01:47
Message-ID: G7MsPPuwzJXWg7NSPFYiSF0wT58sDelWyHxCB4SAAqs=.b5d623c3-f47d-459c-942f-c3f97ee270ed () github ! com
[Download RAW message or body]

On Fri, 15 Jan 2021 13:48:26 GMT, Per Liden <pliden@openjdk.org> wrote:

> Some environments (e.g. OpenVZ containers) incorrectly report a logical processor \
> id that is higher than the number of processors available. This is problematic, for \
> example, when implementing CPU-local data structures, where the processor id is \
> used to index into an array of length processor_count(). 
> We've received crash reports from Jelastic (a Virtuozzo/OpenVZ user) where they run \
> into this problem. We can workaround the problem in the JVM, until the underlying \
> problem is fixed. Without this workaround ZGC can't be used in this environment. 
> This is currently a ZGC-specific issue, since ZGC is currently the only part of \
> HotSpot that is using CPU-local data structures, but that could change in the \
> future. 
> Just to clarify. In a Virtuozzo/OpenZV environment, it seems the underlying problem \
> is not necessarily that sched_getcpu() returns an incorrect processor id, but \
> rather that sysconf(_SC_NPROCESSORS_CONF) returns a too low number. Either way, \
> sched_getcpu() and syconf(_SC_NPROCESSORS_CONF) seems to have different views of \
> the world. This is not an issue in container environments such as Docker. 
> This patch works around this problem by letting os::processor_id() on Linux detect \
> incorrect processor ids, and convert them to processor id 0. As mentioned in the \
> comment in the code, this is safe, but not optimal for performance if the system \
> actually has more than one processor. There's also a warning printed the first time \
> this happen. 
> Testing: Manual testing with various fake/incorrect values returned from \
> sched_getcpu().

This pull request has now been integrated.

Changeset: e68eac9c
Author:    Per Liden <pliden@openjdk.org>
URL:       https://git.openjdk.java.net/jdk16/commit/e68eac9c
Stats:     37 lines in 1 file changed: 29 ins; 2 del; 6 mod

8259765: ZGC: Handle incorrect processor id reported by the operating system

Reviewed-by: ayang, eosterlund

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

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic