Skip to content

CRIU resets j.l.VirtualThread.ForkJoinPool.parallelism after restore - #17618

Merged
tajila merged 1 commit into
eclipse-openj9:masterfrom
JasonFengJ9:updatefjpparallelism
Sep 12, 2023
Merged

CRIU resets j.l.VirtualThread.ForkJoinPool.parallelism after restore#17618
tajila merged 1 commit into
eclipse-openj9:masterfrom
JasonFengJ9:updatefjpparallelism

Conversation

@JasonFengJ9

@JasonFengJ9 JasonFengJ9 commented Jun 19, 2023

Copy link
Copy Markdown
Member

CRIU resets j.l.VirtualThread.ForkJoinPool.parallelism after restore

If there is no system property jdk.virtualThreadScheduler.parallelism set at VM startup, j.l.VirtualThread.ForkJoinPool.parallelism value is reset to match Runtime.getRuntime().availableProcessors() after CRIU
restore;
Added VM_VMHelpers methods getStaticFieldObject/findinstanceFieldOffset/setObjectFieldI32;
Changed hashClassTableAt to peekClassHashTable;
Minor refactoring;
Added tests.

Signed-off-by: Jason Feng fengj@ca.ibm.com

@JasonFengJ9 JasonFengJ9 added comp:vm criu Used to track CRIU snapshot related work jdk20 labels Jun 19, 2023
@JasonFengJ9
JasonFengJ9 requested a review from tajila June 19, 2023 12:21
Comment thread runtime/vm/CRIUHelpers.cpp Outdated
Comment thread runtime/vm/CRIUHelpers.cpp Outdated
Comment thread runtime/vm/CRIUHelpers.cpp Outdated
Comment thread runtime/oti/VMHelpers.hpp Outdated
@JasonFengJ9
JasonFengJ9 force-pushed the updatefjpparallelism branch 2 times, most recently from a29effa to a76f932 Compare July 28, 2023 14:37
Comment thread runtime/nls/j9vm/j9vm.nls Outdated
If there is no system property jdk.virtualThreadScheduler.parallelism
set at VM startup, j.l.VirtualThread.ForkJoinPool.parallelism value is
reset to match Runtime.getRuntime().availableProcessors() after CRIU
restore;
Added VM_VMHelpers methods
getStaticFieldObject/findinstanceFieldOffset/setObjectFieldI32;
Changed hashClassTableAt to peekClassHashTable;
Minor refactoring;
Added tests.

Signed-off-by: Jason Feng <fengj@ca.ibm.com>
@JasonFengJ9
JasonFengJ9 force-pushed the updatefjpparallelism branch from a76f932 to ac50591 Compare August 29, 2023 15:30
@tajila

tajila commented Sep 11, 2023

Copy link
Copy Markdown
Contributor

Im wondering if we should just use vmconstantpool for this. Im trying to think of a downside, but I think the cost to startup is negligeable

@JasonFengJ9

Copy link
Copy Markdown
Member Author

Im wondering if we should just use vmconstantpool for this. Im trying to think of a downside, but I think the cost to startup is negligeable

This mimics the earlier modification of java/util/concurrent/atomic/AtomicLong.value. There were discussions about loading it at startup via vmconstantpool #14365 (comment), it was decided not to do so to avoid unnecessary class instances.
In addition, besides minor startup costs, it also adds a dependency on OpenJDK class initialisation at OpenJ9 bootup stage though most of the time is fine.
vmconstantpool does offer a simpler way for the field modification.

@tajila

tajila commented Sep 11, 2023

Copy link
Copy Markdown
Contributor

I mention it here, because with VirtualThreads ForkJoinPool will certainly be used. I guess it may not be with pre-JDK 21 builds

@tajila

tajila commented Sep 11, 2023

Copy link
Copy Markdown
Contributor

jenkins compile win jdk8

@tajila

tajila commented Sep 11, 2023

Copy link
Copy Markdown
Contributor

jenkins test sanity alinux64 jdk21

@tajila
tajila merged commit dce0276 into eclipse-openj9:master Sep 12, 2023
@JasonFengJ9
JasonFengJ9 deleted the updatefjpparallelism branch September 12, 2023 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:vm criu Used to track CRIU snapshot related work jdk20

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants