Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@janvorli
Copy link
Member

@janvorli janvorli commented Nov 29, 2019

Customer impact

Prevents running Linux Alpine tests on checked runtime on Jetson TX2 ARM boards used by our lab. This bug causes the checked runtime to assert and crash during startup on this board.

Customers may see degraded GC performance on Jetson TX2 and similar devices.

Regression?

Regression from 2.1, introduced by the docker/cgroup changes.

Risk

Low


Ports dotnet/runtime#206 to release/3.1.

The code in PAL_GetCurrentThreadAffinitySet relied on the fact that the
number of processors reported as configured in the system is always
larger than the maximum CPU index. However, it turns out that it is not
true on some devices / distros. The Jetson TX2 reports CPUs 0, 3, 4 and
5 in the affinity mask and the 1 and 2 are never reported. GLIBC reports
6 as the number of configured CPUs, however MUSL reports just 4. The
PAL_GetCurrentThreadAffinitySet was using the number of CPUs reported as
configured as the upper bound for scanning affinity set, so on Jetson
TX2, the affinity mask returned had just two bits set while there were
4 CPUs. That triggered an assert in the GCToOSInterface::Initialize.

This change fixes that by reading the maximum CPU index from the
/proc/cpuinfo. It falls back to using the number of processors
configured when the /proc/cpuinfo is not available (on macOS, FreeBSD, ...)

Fixes dotnet/runtime#170

Ports dotnet/runtime#206 to release/3.1.

The code in PAL_GetCurrentThreadAffinitySet relied on the fact that the
number of processors reported as configured in the system is always
larger than the maximum CPU index. However, it turns out that it is not
true on some devices / distros. The Jetson TX2 reports CPUs 0, 3, 4 and
5 in the affinity mask and the 1 and 2 are never reported. GLIBC reports
6 as the number of configured CPUs, however MUSL reports just 4. The
PAL_GetCurrentThreadAffinitySet was using the number of CPUs reported as
configured as the upper bound for scanning affinity set, so on Jetson
TX2, the affinity mask returned had just two bits set while there were
4 CPUs. That triggered an assert in the GCToOSInterface::Initialize.

This change fixes that by reading the maximum CPU index from the
/proc/cpuinfo. It falls back to using the number of processors
configured when the /proc/cpuinfo is not available (on macOS, FreeBSD, ...)

Fixes dotnet/runtime#170
@janvorli janvorli added area-GC Servicing-consider Issue for next servicing release review labels Nov 29, 2019
@janvorli janvorli added this to the 3.1 milestone Nov 29, 2019
@janvorli janvorli requested a review from jkotas November 29, 2019 22:01
@janvorli janvorli self-assigned this Nov 29, 2019
@jashook
Copy link

jashook commented Dec 2, 2019

/azp run coreclr-ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jeffschwMSFT jeffschwMSFT modified the milestones: 3.1, 3.1.x Dec 2, 2019
@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Dec 5, 2019
@leecow leecow modified the milestones: 3.1.x, 3.1.2 Dec 5, 2019
@vivmishra
Copy link

Moved to Mar as per Tactics. Will need to be explicitly approved for Feb, if required.

@vivmishra vivmishra modified the milestones: 3.1.2, 3.1.3 Jan 9, 2020
@Anipik Anipik modified the milestones: 3.1.3, 3.1.2 Jan 14, 2020
@Anipik
Copy link

Anipik commented Jan 14, 2020

As per offline discussion we can merge the approved changes in 3.1.2

@Anipik Anipik merged commit 8c478a8 into dotnet:release/3.1 Jan 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-GC Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants