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

[Arm64/Unix] Use portable MP optimized new/alloc #12333

Merged
merged 1 commit into from
Aug 22, 2017

Conversation

sdmaclea
Copy link

No description provided.

@sdmaclea
Copy link
Author

sdmaclea commented Jun 16, 2017

@arm64-contrib @jkotas @janvorli This is a big win on MP ARM64. Total elapsed test time to run 11K tests reduced 33%.

The data point was flawed. The methodology of total elapsed runtime depends on the longest running test. I had disabled the longest running test(s) to fix intermittent failures. Effectively this clipped the tail, and reduce the total elapsed time 33%. It had nothing to do with this change.

@sdmaclea
Copy link
Author

Code is largely copied from jitinterfacegen.cpp's version of void InitJITHelpers1()


_ASSERTE(g_SystemInfo.dwNumberOfProcessors != 0);

// TODO-ARM64-NYI !defined(FEATURE_IMPLICIT_TLS) Use helpers optimized w/ inline TLS access...
Copy link
Member

@jkotas jkotas Jun 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO is not necessary. FEATURE_IMPLICIT_TLS is as good as what you can get with the handcrafter helpers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is for the Windows !FEATURE_IMPLICIT_TLS case.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like FEATURE_IMPLICIT_TLS is not defined for Windows. Am I wrong?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the root clrdefinitions.cmake:

if (CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)
  add_definitions(-DFEATURE_IMPLICIT_TLS)
  set(FEATURE_IMPLICIT_TLS 1)
endif(CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)

So for ARM64, it is defined for both Windows and Unix.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Closed #12332

@sdmaclea
Copy link
Author

@dotnet-bot test Ubuntu arm64 Cross Debug Build

@sdmaclea
Copy link
Author

@jkotas @janvorli This is ready to merge

@jkotas
Copy link
Member

jkotas commented Jun 16, 2017

@jashook Could you please trigger whatever arm64 testing is appropriate?

@jashook
Copy link

jashook commented Jun 16, 2017

Currently testing is offline and I am looking into the issue. If I cannot find the solution in a reasonable amount of time it is probably worth not blocking.

@sdmaclea
Copy link
Author

FYI, I did run this through Unix/Arm64 testing locally.

@sdmaclea
Copy link
Author

@dotnet-bot test Ubuntu arm64 Cross Debug Build

@sdmaclea
Copy link
Author

ping

@jashook
Copy link

jashook commented Jun 29, 2017

@dotnet-bot test Windows_NT Arm64 Checked

@jashook
Copy link

jashook commented Jun 29, 2017

Thank you for waiting @sdmaclea

@jashook
Copy link

jashook commented Jun 30, 2017

@sdmaclea looks like there is a contract violation

@sdmaclea
Copy link
Author

@jashook What does a contract violation mean? I have seen these CONTRACT things floating around, but I haven't figured out the syntax or the tool used to check them.

@jkotas
Copy link
Member

jkotas commented Jun 30, 2017

The CONTRACT things are described in https://github.com/dotnet/coreclr/blob/master/Documentation/coding-guidelines/clr-code-guide.md#2.10

They get checked as asserts at runtime - on Windows only. The contract violation is basically a special form of assertion failure.

I have fixed a contract violation in #12542. Was this change included in the run?

@jashook
Copy link

jashook commented Jun 30, 2017

It is hard to say, I can restart the job to to see if it repros now.

@dotnet-bot test Windows_NT Arm64 Checked

@sdmaclea
Copy link
Author

sdmaclea commented Jul 3, 2017

Build timeout
@dotnet-bot test Windows_NT Arm64 Checked

@sdmaclea
Copy link
Author

sdmaclea commented Jul 5, 2017

@jkotas Contract violation occurs with #12542. My guess is the CV is in the arm64 tip. Triggered "Windows_NT arm64 Cross Checked Build and Test" on #12436 to test hypothesis.

@jashook
Copy link

jashook commented Jul 5, 2017

@sdmaclea Windows arm64 jobs should be clean currently.

@sdmaclea
Copy link
Author

sdmaclea commented Jul 5, 2017

@jashook @jkotas Confirming #12436 completed w/o contract violation.

@sdmaclea
Copy link
Author

sdmaclea commented Jul 5, 2017

@dotnet-bot test Ubuntu arm64 Cross Debug Build

@sdmaclea
Copy link
Author

sdmaclea commented Jul 7, 2017

@sdmaclea
Copy link
Author

@jkotas I removed the contract line I added. Since I do not have a Windows Arm64 platform, this the CV is not something I can easily debug. I'll open an issue to add the contract.

@sdmaclea
Copy link
Author

sdmaclea commented Aug 1, 2017

@jkotas @dotnet/arm64-contrib please review and/or merge

@jkotas
Copy link
Member

jkotas commented Aug 1, 2017

@dotnet/arm64-contrib Are Windows arm64 tests passing on this change?

I see that Windows_NT arm64 Cross Debug Build is green, but I do not see any tests run in the log.

Remove change to InitJITHelpers1() contract

IIRC, contracts that failed on this earlier were not related to InitJITHelpers1. I do not think that there was anything wrong with the InitJITHelpers1 contract that you have added. It is ok to look into it independently since you have filled issue on it.

@sdmaclea
Copy link
Author

sdmaclea commented Aug 1, 2017

@dotnet-bot test Windows_NT arm64 Checked

@sdmaclea sdmaclea changed the title [Arm64] Use portable MP optimized new/alloc [Arm64/Unix] Use portable MP optimized new/alloc Aug 16, 2017
@sdmaclea
Copy link
Author

@jkotas Since I do not have Windows test platform to debug Contract violation, I disabled the change for Windows and changed #13053 to match.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some chance that the contract violation on Windows flagged a problem that exists on non-Windows as well (the runtime contract checks are Windows-only). I assume that you have done a test pass to verify that there are not regressions on Linux. (The regression will likely show up as a intermittent crash during GC.)

@sdmaclea
Copy link
Author

sdmaclea commented Aug 16, 2017

@jkotas

I assume that you have done a test pass to verify that there are not regressions on Linux.

Yes. I have been using the patch for all my runs for the last two months. Either way, I will try to get someone from the QDT windows team to debug the Contract violation.

The regression will likely show up as a intermittent crash during GC.

Will GC stress testing help flush it out?

arm64 GC is not perfect yet. there are still interrmittent failures. So It may not be obvious that it is a CV related issue.

@jkotas
Copy link
Member

jkotas commented Aug 16, 2017

I have been using the patch for all my runs for the last two months

This should be good enough.

Will GC stress testing help flush it out?

Maybe. It is best to debug the known problem on Windows first, I think.

@sdmaclea
Copy link
Author

@dotnet-bot test Ubuntu arm64 Cross Debug Build

@sdmaclea
Copy link
Author

Please merge

@jkotas jkotas merged commit f0e8660 into dotnet:master Aug 22, 2017
@@ -1086,6 +1087,31 @@ void JIT_TailCall()
#if !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
void InitJITHelpers1()
{
#ifdef FEATURE_PAL // TODO
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed to support Windows

@karelz karelz modified the milestone: 2.1.0 Aug 28, 2017
@sdmaclea sdmaclea deleted the PR-ARM64-MP-NEW branch December 4, 2017 16:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants