Open mpirvu opened 5 years ago
Here's the number and type of messages sent between server and client:
#0000 5475 compilationCode
#0001 51674 mirrorResolvedJ9Method
#0002 30209 get_params_to_construct_TR_j9method
#0105 43941 ResolvedMethod_staticAttributes
#0106 55400 ResolvedMethod_getClassFromConstantPool
#0107 10081 ResolvedMethod_getDeclaringClassFromFieldOrStatic
#0108 161798 ResolvedMethod_classOfStatic
#0109 746 ResolvedMethod_startAddressForJNIMethod
#0110 117222 ResolvedMethod_fieldAttributes
#0111 85483 ResolvedMethod_getResolvedStaticMethodAndMirror
#0112 127961 ResolvedMethod_getResolvedSpecialMethodAndMirror
#0113 704 ResolvedMethod_classCPIndexOfMethod
#0116 288175 ResolvedMethod_getResolvedPossiblyPrivateVirtualMethodAndMirror
#0118 20436 ResolvedMethod_getResolvedInterfaceMethod_2
#0119 75153 ResolvedMethod_getResolvedInterfaceMethodAndMirror_3
#0120 3611 ResolvedMethod_getResolvedInterfaceMethodOffset
#0122 259 ResolvedMethod_isSubjectToPhaseChange
#0125 8251 ResolvedMethod_getRemoteROMString
#0126 2090 ResolvedMethod_fieldOrStaticName
#0127 2685 ResolvedMethod_getRemoteROMClassAndMethods
#0141 633 ResolvedMethod_setWarmCallGraphTooBig
#0147 28800 ResolvedMethod_getResolvedImproperInterfaceMethodAndMirror
#0148 12523 ResolvedMethod_isUnresolvedString
#0149 12524 ResolvedMethod_stringConstant
#0202 5644 VM_getSuperClass
#0208 7 VM_getSystemClassFromClassName
#0211 1 VM_getClassClassPointer
#0212 24861 VM_setJ2IThunk
#0213 2739 VM_getClassOfMethod
#0214 199 VM_getBaseComponentClass
#0215 55781 VM_getLeafComponentClassFromArrayClass
#0216 9477 VM_isClassLoadedBySystemClassLoader
#0217 77700 VM_getClassFromSignature
#0218 154652 VM_jitFieldsAreSame
#0219 26663 VM_jitStaticsAreSame
#0220 10918 VM_getComponentClassFromArrayClass
#0221 59615 VM_classHasBeenReplaced
#0222 25731 VM_classHasBeenExtended
#0229 10387 VM_isClassInitialized
#0231 6992 VM_getByteOffsetToLockword
#0232 1557 VM_isString1
#0233 363 VM_getMethods
#0236 5617 VM_isPrimitiveArray
#0237 33873 VM_getAllocationSize
#0239 27345 VM_stackWalkerMaySkipFrames
#0240 1712 VM_hasFinalFieldsInClass
#0242 19632 VM_getHostClass
#0245 7215 VM_getClassFromNewArrayType
#0246 98 VM_isCloneable
#0247 33880 VM_canAllocateInlineClass
#0248 18261 VM_getArrayClassFromComponentClass
#0258 196 VM_getOffsetOfClassFromJavaLangClassField
#0266 44447 VM_getResolvedVirtualMethod
#0267 14201 VM_sameClassLoaders
#0268 9454 VM_isUnloadAssumptionRequired
#0270 336 VM_getInstanceFieldOffset
#0272 498 VM_hasFinalizer
#0273 3080 VM_getClassDepthAndFlagsValue
#0274 1019 VM_getMethodFromName
#0278 788 VM_getReferenceSlotsInClass
#0282 48 VM_getInterpreterVTableSlot
#0285 482 VM_isOwnableSyncClass
#0291 2 VM_getObjectNewInstanceImplMethod
#0297 125 VM_instanceOfOrCheckCast
#0300 323 VM_getResolvedMethodsAndMirror
#0301 1 VM_getVMInfo
#0401 2 CompInfo_getInvocationCount
#0404 10939 CompInfo_isJNINative
#0405 5470 CompInfo_isJSR292
#0406 5470 CompInfo_getMethodBytecodeSize
#0408 2 CompInfo_setInvocationCountAtomic
#0409 11515 CompInfo_isClassSpecial
#0500 16039 ClassEnv_classFlagsValue
#0501 18239 ClassEnv_classDepthOf
#0502 22619 ClassEnv_classInstanceSize
#0800 1 CHTable_getAllClassInfo
#0801 5476 CHTable_getClassInfoUpdates
#0900 230244 IProfiler_profilingSample
#0901 85885 IProfiler_searchForMethodSample
#0903 15350 IProfiler_setCallCount
#1000 5297 Recompilation_getExistingMethodInfo
A new distribution of messages with a build from 2018/12/04. Warm compilations only with OSR enabled.
Type# #called TypeName
#0000 5415 compilationCode
#0001 35126 mirrorResolvedJ9Method
#0002 24516 get_params_to_construct_TR_j9method
#0105 20364 ResolvedMethod_staticAttributes
#0106 39236 ResolvedMethod_getClassFromConstantPool
#0107 7934 ResolvedMethod_getDeclaringClassFromFieldOrStatic
#0108 38156 ResolvedMethod_classOfStatic
#0109 633 ResolvedMethod_startAddressForJNIMethod
#0110 64041 ResolvedMethod_fieldAttributes
#0111 18924 ResolvedMethod_getResolvedStaticMethodAndMirror
#0112 31741 ResolvedMethod_getResolvedSpecialMethodAndMirror
#0113 426 ResolvedMethod_classCPIndexOfMethod
#0116 46748 ResolvedMethod_getResolvedPossiblyPrivateVirtualMethodAndMirror
#0118 17134 ResolvedMethod_getResolvedInterfaceMethod_2
#0119 35220 ResolvedMethod_getResolvedInterfaceMethodAndMirror_3
#0120 2211 ResolvedMethod_getResolvedInterfaceMethodOffset
#0122 252 ResolvedMethod_isSubjectToPhaseChange
#0125 9146 ResolvedMethod_getRemoteROMString
#0126 2149 ResolvedMethod_fieldOrStaticName
#0127 2817 ResolvedMethod_getRemoteROMClassAndMethods
#0131 2 ResolvedMethod_isUnresolvedCallSiteTableEntry
#0132 1 ResolvedMethod_callSiteTableEntryAddress
#0133 1 ResolvedMethod_getResolvedDynamicMethod
#0141 1198 ResolvedMethod_setWarmCallGraphTooBig
#0147 23467 ResolvedMethod_getResolvedImproperInterfaceMethodAndMirror
#0148 9069 ResolvedMethod_isUnresolvedString
#0149 9069 ResolvedMethod_stringConstant
#0208 7 VM_getSystemClassFromClassName
#0211 1 VM_getClassClassPointer
#0212 20709 VM_setJ2IThunk
#0213 1899 VM_getClassOfMethod
#0217 70073 VM_getClassFromSignature
#0218 79763 VM_jitFieldsAreSame
#0219 15621 VM_jitStaticsAreSame
#0221 46647 VM_classHasBeenReplaced
#0222 21706 VM_classHasBeenExtended
#0229 387 VM_isClassInitialized
#0230 30193 VM_getOSRFrameSizeInBytes
#0232 688 VM_isString1
#0233 368 VM_getMethods
#0239 16612 VM_stackWalkerMaySkipFrames
#0245 3925 VM_getClassFromNewArrayType
#0258 157 VM_getOffsetOfClassFromJavaLangClassField
#0266 28044 VM_getResolvedVirtualMethod
#0270 239 VM_getInstanceFieldOffset
#0273 2443 VM_getClassDepthAndFlagsValue
#0274 967 VM_getMethodFromName
#0278 8847 VM_getReferenceSlotsInClass
#0282 15 VM_getInterpreterVTableSlot
#0291 2 VM_getObjectNewInstanceImplMethod
#0294 1 VM_setInvokeExactJ2IThunk
#0297 105 VM_instanceOfOrCheckCast
#0300 73 VM_getResolvedMethodsAndMirror
#0301 1 VM_getVMInfo
#0401 2 CompInfo_getInvocationCount
#0408 2 CompInfo_setInvocationCountAtomic
#0500 10656 ClassEnv_classFlagsValue
#0800 1 CHTable_getAllClassInfo
#0801 5416 CHTable_getClassInfoUpdates
#0900 13054 IProfiler_profilingSample
#0901 3428 IProfiler_searchForMethodSample
#0903 8570 IProfiler_setCallCount
Ideally, the JIT CPU consumption at the JITaaS client should be very small because compilations are performed in another process. The reality is that the communication overhead is very high in terms of CPU cycles. Here's a perf profile of the lone compilation thread during an AcmeAir benchmark run obtained with:
perf record -e cycles -c 200000 -o profile_client.txt --tid 4823 -- sleep 120
Breakdown per module
As shown above 50% of the CPU goes into Linux kernel to handle socket communication. The ticks in libc are mostly used for malloc/free used during communication (many of them used in protobuf layer)
Even the 17.44% in libj9jit29.so is dominated by routines used for communication
It follows that we must reduce the number of messages exchanged per compilation between server and client