SlideShare une entreprise Scribd logo
1  sur  18
OpenJ9 JDK on RISC-V
Cheng Jin (jincheng@ca.ibm.com)
OpenJ9 VM Software Developer, IBM Runtime Technologies
chengjin
ChengJin01
Important Disclaimers & Legal Notice
• THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY.
• IBM AND THE IBM LOGO ARE TRADEMARKS OR REGISTERED TRADEMARKS OF IBM CORPORATION, IN THE UNITED STATES, OTHER COUNTRIES OR
BOTH.
• JAVA AND ALL JAVA-BASED MARKS, AMONG OTHERS, ARE TRADEMARKS OR REGISTERED TRADEMARKS OF ORACLE IN THE UNITED STATES, OTHER
COUNTRIES OR BOTH.
• OTHER COMPANY, PRODUCT AND SERVICE NAMES MAY BE TRADEMARKS OR SERVICE MARKS OF OTHERS.
• WHILST EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS
PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.
• ALL PERFORMANCE DATA INCLUDED IN THIS PRESENTATION HAVE BEEN GATHERED IN A CONTROLLED
ENVIRONMENT. YOUR OWN TEST RESULTS MAY VARY BASED ON HARDWARE, SOFTWARE OR INFRASTRUCTURE DIFFERENCES.
• ALL DATA INCLUDED IN THIS PRESENTATION ARE MEANT TO BE USED ONLY AS A GUIDE.
• IN ADDITION, THE INFORMATION CONTAINED IN THIS PRESENTATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE
SUBJECT TO CHANGE BY IBM, WITHOUT NOTICE.
• IBM AND ITS AFFILIATED COMPANIES SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS
PRESENTATION OR ANY OTHER DOCUMENTATION.
• NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF:
• CREATING ANY WARRANT OR REPRESENTATION FROM IBM, ITS AFFILIATED COMPANIES OR ITS OR THEIR SUPPLIERS AND/OR LICENSORS
Agenda
 Background & Motivation of OpenJ9/RISC-V
 A Brief History of OpenJ9
 What is OpenJ9?
 Porting OpenJ9 to RISC-V
 Status of OpenJ9/RISC-V
 Future Work
 Demo
Background & Motivation of OpenJ9/RISC-V
Cloud Computing (Centralized)
 Long distance from the data source
 Network bottleneck for huge volume of data
 Security risk for sensitive data
Edge Computing (Decentralized)
 Close to the data source
 Fast response to real-time data
 Data localization
1
“Around 10% of enterprise-generated data is
created and processed outside a traditional
centralized data center or cloud. By 2025,
Gartner predicts this figure will reach 75%”
https://www.gartner.com/smarterwithgartner/what-edge-
computing-means-for-infrastructure-and-operations-leaders
Cloud Computing vs Edge Computing
Background & Motivation of OpenJ9/RISC-V (Cont.)
AIoT Edge Node
Runtime / Java
OS
Realtime Control
Management
Data Analysis
AI processing
Hardware
X86
Cloud
Wireless / 5G
Wired / FTTX
2
A solution for AIoT & Edge with lower cost & Lower power consumption is preferable to others
A Brief History of OpenJ9
 J9 VM developed independently by IBM as Enterprise middleware over 20 years (high
performance, scalability & reliability)
 Transition from ENVY/Smalltalk to C/C++ in recent years to lower barrier for developers
 Donated to the Eclipse Foundation in 2017 as Eclipse OpenJ9 (currently led by IBM)
 Dual License: Eclipse Public License v2.0 & Apache v2.0
 J9 is not Java 9 (the naming convention for the Smalltalk source code)
https://en.wikipedia.org/wiki/OpenJ9
3
o OpenJDK (https://github.com/ibmruntimes/openj9-openjdk-jdk11): Building framework/Java Class libraries)
o OpenJ9 (https://github.com/eclipse/openj9): Java Virtual Machine Core (equivalent of Hotspot)
o OMR (https://github.com/eclipse/omr): Split from IBM J9 & refactored for polyglot runtimes
What is OpenJ9?
4
OpenJDK/OpenJ9
OMR
Open JDK
HotSpot
OpenJDK/Hotspot
Open JDK
The Architecture of OpenJ9 VM
Classloader
JCL natives
Verification
Interpreter
Thread /Port Library
OMR GC
OpenJ9 RAS & DDR
OMR JIT/AOT
OpenJ9 GC OpenJ9 JIT/AOT
OMR
OMR RAS/DDR
OpenJ9 VM
SCC
• Direct Dump Reader (DDR): diagnose issues of OpenJ9 in Java stacktraces at the bytecode level
https://www.slideshare.net/Dev_Events/secrets-of-building-a-debuggable-runtime-learn-how-language-implementors-solve-your-runtime-issues
• Shared Classes Cache (SCC): store J9 ROM Classes & AOT code for better performance (startup time & footprint)
https://developer.ibm.com/technologies/java/tutorials/j-class-sharing-openj9/
What is OpenJ9? (Cont.)
5
Porting OpenJ9 JDK to RISC-V (1)
Preparation of Software
 Toolchain for cross-compilation
 RISC-V GNU Compiler Toolchain at https://github.com/riscv/riscv-gnu-toolchain (compiled from source)
 Emulator on the Host system
 RISC-V QEMU (riscv64) > 5.0 at https://www.qemu.org/ (compiled from source)
 The building instruction at https://wiki.qemu.org/Documentation/Platforms/RISCV/
 Linux-based Host System
 Ubuntu v19 (Fedora v32, Debian v10, etc)
 Linux-based Target System (https://github.com/riscv/riscv-software-list)
 64 bit Fedora/RISC-V at https://dl.fedoraproject.org/pub/alt/risc-v/repo/virt-builder-images/images/
 64 bit Debian/RISC-V at https://github.com/janvrany/riscv-debian (customized to HiFive U540)
6
Porting OpenJ9 JDK to RISC-V (2)
Preparation of Hardware
 HiFive Unleashed 540 (64bit U540 SoC)
o Linux-capable RISC-V processor with multi-core
o 8GB DDR4 RAM with ECC
o MicroSD Card (Removable Storage)
o MicroUSB connector
o RJ45 Gigabit Ethernet port
https://sifive.cdn.prismic.io/sifive/8328bc5d-b7ea-4885-a7f9-30fc108b7222_HiFive_Unleashed_Getting_Started_Guide-v1p2.pdf
7
Porting OpenJ9 JDK to RISC-V (3)
Development of OpenJ9 JDK on RISC-V
8
OpenJDK
OpenJ9 OMR
Building scripts & Configuration
VM/Interpreter mode
LibFFI-JNI/RISC-V
MISC
Little-Endian
DDR/RISC-V
Port Library
Gencon GC
Atomic Support/CAS
MISC
JIT/AOT (disabled)
Java Native Interface (JNI) support
 the Foreign Function Interface (FFI) library on RISC-V from https://github.com/libffi/libffi/tree/master/src/riscv
Porting OpenJ9 JDK to RISC-V (4)
Mix of local complication & cross-compilation in OpenJ9 JDK on RISC-V
 Local toolchain (on the host system): /usr/bin/gcc & g++, etc
 Cross-toochain (on the host system): riscv64-linux-gnu-gcc & g++, etc
9
OpenJ9 JDK
Source
The Host System
OpenJ9 Cross-Build
Cross-Compilation
Local Compilation
Trace
Tools
Trace Constant
& Headers
OpenJ9 bootstrap
& build JDK
Compilation of OpenJ9 JDK/RISC-V
Porting OpenJ9 JDK to RISC-V (5)
• OpenJ9 on RISC-V: https://github.com/eclipse/openj9/blob/master/doc/build-instructions/Build_Instructions_V11.md#riscv64
• Fedora/RISCV on U540: https://fedoraproject.org/wiki/Architectures/RISC-V/Installing 10
Debian/RISC-V
Install all libraries
for OpenJDK11
Mounted onto
the host system
WITH
bootstrap
& build JDK
Upload the cross-build to the
target system (emulator)
Upload the
cross-build to
the target
system (U540)
Fedora/RISC-V
Fedora/RISC-V
X86_64
Steps of the cross-compilation Fedora/RISC-V
Debian/RISC-V
U540
Fedora/RISC-V
U540
https://adoptopenjdk.net/releases.html?variant=openjdk11&jvmVariant=openj9
Porting OpenJ9 JDK to RISC-V (6)
Downloading links of bootstrap JDK at AdoptOpenJDK
11
Status of OpenJ9 JDK on RISC-V
Execution of OpenJ9 JDK (Interpreter mode)
QEMU (Emulator)
1. Debian/RISC-V
 Debian (Linux kernel 5.0) with Berkeley Boot Loader (BBL)
 RISC-V (Linux kernel > 5.3 ) with Open Source Supervisor Binary Interface (OpenSBI) (supported since linux
kernel > 5.3)
2. Fedora/RISC-V
 Fedora stage4 + Linux kernel 4.19 (first bootstrap image) with BBL
 Linux kernel > 5.3 with OpenSBI
HiFive U540 (Dev board)
1. Debian ( Linux kernel 5.0) with BBL
2. Java exception on Fedora & Debian (Linux kernel > 5.3) with OpenSBI (under investigation)
12
Future Work
• JIT support
• Various GC strategies
• DDR generation via cross-compilation
• Java 8 & other JDK LTS support
13
Demo
Want to get involved?
https://github.com/eclipse/openj9/issues/5058
https://openj9.slack.com/ (channel #risc-v)

Contenu connexe

Tendances

OpenStack: Inside Out
OpenStack: Inside OutOpenStack: Inside Out
OpenStack: Inside Out
Etsuji Nakai
 
[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화
[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화
[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화
OpenStack Korea Community
 

Tendances (20)

OpenStack: Inside Out
OpenStack: Inside OutOpenStack: Inside Out
OpenStack: Inside Out
 
대용량 분산 아키텍쳐 설계 #5. rest
대용량 분산 아키텍쳐 설계 #5. rest대용량 분산 아키텍쳐 설계 #5. rest
대용량 분산 아키텍쳐 설계 #5. rest
 
Ceph issue 해결 사례
Ceph issue 해결 사례Ceph issue 해결 사례
Ceph issue 해결 사례
 
A crash course in CRUSH
A crash course in CRUSHA crash course in CRUSH
A crash course in CRUSH
 
Ceph on arm64 upload
Ceph on arm64   uploadCeph on arm64   upload
Ceph on arm64 upload
 
Open vSwitch 패킷 처리 구조
Open vSwitch 패킷 처리 구조Open vSwitch 패킷 처리 구조
Open vSwitch 패킷 처리 구조
 
Block Storage For VMs With Ceph
Block Storage For VMs With CephBlock Storage For VMs With Ceph
Block Storage For VMs With Ceph
 
QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?
 
Ceph Performance and Sizing Guide
Ceph Performance and Sizing GuideCeph Performance and Sizing Guide
Ceph Performance and Sizing Guide
 
Ceph and RocksDB
Ceph and RocksDBCeph and RocksDB
Ceph and RocksDB
 
Red Hat OpenStack 17 저자직강+스터디그룹_4주차
Red Hat OpenStack 17 저자직강+스터디그룹_4주차Red Hat OpenStack 17 저자직강+스터디그룹_4주차
Red Hat OpenStack 17 저자직강+스터디그룹_4주차
 
FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)
 
Embracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with FlywayEmbracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with Flyway
 
Storage Requirements and Options for Running Spark on Kubernetes
Storage Requirements and Options for Running Spark on KubernetesStorage Requirements and Options for Running Spark on Kubernetes
Storage Requirements and Options for Running Spark on Kubernetes
 
[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화
[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화
[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화
 
Red Hat OpenStack 17 저자직강+스터디그룹_5주차
Red Hat OpenStack 17 저자직강+스터디그룹_5주차Red Hat OpenStack 17 저자직강+스터디그룹_5주차
Red Hat OpenStack 17 저자직강+스터디그룹_5주차
 
도메인 주도 설계의 본질
도메인 주도 설계의 본질도메인 주도 설계의 본질
도메인 주도 설계의 본질
 
RBD: What will the future bring? - Jason Dillaman
RBD: What will the future bring? - Jason DillamanRBD: What will the future bring? - Jason Dillaman
RBD: What will the future bring? - Jason Dillaman
 
Testing Persistent Storage Performance in Kubernetes with Sherlock
Testing Persistent Storage Performance in Kubernetes with SherlockTesting Persistent Storage Performance in Kubernetes with Sherlock
Testing Persistent Storage Performance in Kubernetes with Sherlock
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HA
 

Similaire à Open j9 jdk on RISC-V

17294_HiperSockets.pdf
17294_HiperSockets.pdf17294_HiperSockets.pdf
17294_HiperSockets.pdf
Eeszt
 

Similaire à Open j9 jdk on RISC-V (20)

J9: Under the hood of the next open source JVM
J9: Under the hood of the next open source JVMJ9: Under the hood of the next open source JVM
J9: Under the hood of the next open source JVM
 
FOSDEM 2017 - Open J9 The Next Free Java VM
FOSDEM 2017 - Open J9 The Next Free Java VMFOSDEM 2017 - Open J9 The Next Free Java VM
FOSDEM 2017 - Open J9 The Next Free Java VM
 
EclipseOMRBuildingBlocks4Polyglot_TURBO18
EclipseOMRBuildingBlocks4Polyglot_TURBO18EclipseOMRBuildingBlocks4Polyglot_TURBO18
EclipseOMRBuildingBlocks4Polyglot_TURBO18
 
z/OS V2.4 Preview: z/OS Container Extensions - Running Linux on Z docker cont...
z/OS V2.4 Preview: z/OS Container Extensions - Running Linux on Z docker cont...z/OS V2.4 Preview: z/OS Container Extensions - Running Linux on Z docker cont...
z/OS V2.4 Preview: z/OS Container Extensions - Running Linux on Z docker cont...
 
OpenStack and z/VM – What is it and how do I get it?
OpenStack and z/VM – What is it and how do I get it?OpenStack and z/VM – What is it and how do I get it?
OpenStack and z/VM – What is it and how do I get it?
 
17294_HiperSockets.pdf
17294_HiperSockets.pdf17294_HiperSockets.pdf
17294_HiperSockets.pdf
 
JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best Practices
 
OpenPOWER Update
OpenPOWER UpdateOpenPOWER Update
OpenPOWER Update
 
NFF-GO (YANFF) - Yet Another Network Function Framework
NFF-GO (YANFF) - Yet Another Network Function FrameworkNFF-GO (YANFF) - Yet Another Network Function Framework
NFF-GO (YANFF) - Yet Another Network Function Framework
 
Under the Hood of the Testarossa JIT Compiler
Under the Hood of the Testarossa JIT CompilerUnder the Hood of the Testarossa JIT Compiler
Under the Hood of the Testarossa JIT Compiler
 
The OMR GC talk - Ruby Kaigi 2015
The OMR GC talk - Ruby Kaigi 2015The OMR GC talk - Ruby Kaigi 2015
The OMR GC talk - Ruby Kaigi 2015
 
Software Define your Current Storage with Opensource
Software Define your Current Storage with OpensourceSoftware Define your Current Storage with Opensource
Software Define your Current Storage with Opensource
 
Splunk Conf 2014 - Splunking the Java Virtual Machine
Splunk Conf 2014 - Splunking the Java Virtual MachineSplunk Conf 2014 - Splunking the Java Virtual Machine
Splunk Conf 2014 - Splunking the Java Virtual Machine
 
Red Hat for IBM Power Systems (System p) Update v6
Red Hat for IBM Power Systems (System p) Update v6Red Hat for IBM Power Systems (System p) Update v6
Red Hat for IBM Power Systems (System p) Update v6
 
JVMs in Containers
JVMs in ContainersJVMs in Containers
JVMs in Containers
 
MongoDB Linux Porting, Performance Measurements and and Scaling Advantage usi...
MongoDB Linux Porting, Performance Measurements and and Scaling Advantage usi...MongoDB Linux Porting, Performance Measurements and and Scaling Advantage usi...
MongoDB Linux Porting, Performance Measurements and and Scaling Advantage usi...
 
Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019
 
20191119 Cloud Native Java : GraalVM
20191119 Cloud Native Java : GraalVM20191119 Cloud Native Java : GraalVM
20191119 Cloud Native Java : GraalVM
 
DevOps for Mainframe: Open Source Fast Track
DevOps for Mainframe: Open Source Fast TrackDevOps for Mainframe: Open Source Fast Track
DevOps for Mainframe: Open Source Fast Track
 
Java on z overview 20161107
Java on z overview 20161107Java on z overview 20161107
Java on z overview 20161107
 

Plus de RISC-V International

Plus de RISC-V International (20)

WD RISC-V inliner work effort
WD RISC-V inliner work effortWD RISC-V inliner work effort
WD RISC-V inliner work effort
 
RISC-V Zce Extension
RISC-V Zce ExtensionRISC-V Zce Extension
RISC-V Zce Extension
 
RISC-V Online Tutor
RISC-V Online TutorRISC-V Online Tutor
RISC-V Online Tutor
 
London Open Source Meetup for RISC-V
London Open Source Meetup for RISC-VLondon Open Source Meetup for RISC-V
London Open Source Meetup for RISC-V
 
RISC-V Introduction
RISC-V IntroductionRISC-V Introduction
RISC-V Introduction
 
Ziptillion boosting RISC-V with an efficient and os transparent memory comp...
Ziptillion   boosting RISC-V with an efficient and os transparent memory comp...Ziptillion   boosting RISC-V with an efficient and os transparent memory comp...
Ziptillion boosting RISC-V with an efficient and os transparent memory comp...
 
Static partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-VStatic partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-V
 
Standardizing the tee with global platform and RISC-V
Standardizing the tee with global platform and RISC-VStandardizing the tee with global platform and RISC-V
Standardizing the tee with global platform and RISC-V
 
Semi dynamics high bandwidth vector capable RISC-V cores
Semi dynamics high bandwidth vector capable RISC-V coresSemi dynamics high bandwidth vector capable RISC-V cores
Semi dynamics high bandwidth vector capable RISC-V cores
 
Security and functional safety
Security and functional safetySecurity and functional safety
Security and functional safety
 
Reverse Engineering of Rocket Chip
Reverse Engineering of Rocket ChipReverse Engineering of Rocket Chip
Reverse Engineering of Rocket Chip
 
RISC-V NOEL-V - A new high performance RISC-V Processor Family
RISC-V NOEL-V - A new high performance RISC-V Processor FamilyRISC-V NOEL-V - A new high performance RISC-V Processor Family
RISC-V NOEL-V - A new high performance RISC-V Processor Family
 
RISC-V 30910 kassem_ summit 2020 - so_c_gen
RISC-V 30910 kassem_ summit 2020 - so_c_genRISC-V 30910 kassem_ summit 2020 - so_c_gen
RISC-V 30910 kassem_ summit 2020 - so_c_gen
 
RISC-V 30908 patra
RISC-V 30908 patraRISC-V 30908 patra
RISC-V 30908 patra
 
RISC-V 30907 summit 2020 joint picocom_mentor
RISC-V 30907 summit 2020 joint picocom_mentorRISC-V 30907 summit 2020 joint picocom_mentor
RISC-V 30907 summit 2020 joint picocom_mentor
 
RISC-V 30906 hex five multi_zone iot firmware
RISC-V 30906 hex five multi_zone iot firmwareRISC-V 30906 hex five multi_zone iot firmware
RISC-V 30906 hex five multi_zone iot firmware
 
RISC-V 30946 manuel_offenberg_v3_notes
RISC-V 30946 manuel_offenberg_v3_notesRISC-V 30946 manuel_offenberg_v3_notes
RISC-V 30946 manuel_offenberg_v3_notes
 
RISC-V software state of the union
RISC-V software state of the unionRISC-V software state of the union
RISC-V software state of the union
 
Ripes tracking computer architecture throught visual and interactive simula...
Ripes   tracking computer architecture throught visual and interactive simula...Ripes   tracking computer architecture throught visual and interactive simula...
Ripes tracking computer architecture throught visual and interactive simula...
 
Porting tock to open titan
Porting tock to open titanPorting tock to open titan
Porting tock to open titan
 

Dernier

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Open j9 jdk on RISC-V

  • 1. OpenJ9 JDK on RISC-V Cheng Jin (jincheng@ca.ibm.com) OpenJ9 VM Software Developer, IBM Runtime Technologies chengjin ChengJin01
  • 2. Important Disclaimers & Legal Notice • THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. • IBM AND THE IBM LOGO ARE TRADEMARKS OR REGISTERED TRADEMARKS OF IBM CORPORATION, IN THE UNITED STATES, OTHER COUNTRIES OR BOTH. • JAVA AND ALL JAVA-BASED MARKS, AMONG OTHERS, ARE TRADEMARKS OR REGISTERED TRADEMARKS OF ORACLE IN THE UNITED STATES, OTHER COUNTRIES OR BOTH. • OTHER COMPANY, PRODUCT AND SERVICE NAMES MAY BE TRADEMARKS OR SERVICE MARKS OF OTHERS. • WHILST EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. • ALL PERFORMANCE DATA INCLUDED IN THIS PRESENTATION HAVE BEEN GATHERED IN A CONTROLLED ENVIRONMENT. YOUR OWN TEST RESULTS MAY VARY BASED ON HARDWARE, SOFTWARE OR INFRASTRUCTURE DIFFERENCES. • ALL DATA INCLUDED IN THIS PRESENTATION ARE MEANT TO BE USED ONLY AS A GUIDE. • IN ADDITION, THE INFORMATION CONTAINED IN THIS PRESENTATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM, WITHOUT NOTICE. • IBM AND ITS AFFILIATED COMPANIES SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION. • NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF: • CREATING ANY WARRANT OR REPRESENTATION FROM IBM, ITS AFFILIATED COMPANIES OR ITS OR THEIR SUPPLIERS AND/OR LICENSORS
  • 3. Agenda  Background & Motivation of OpenJ9/RISC-V  A Brief History of OpenJ9  What is OpenJ9?  Porting OpenJ9 to RISC-V  Status of OpenJ9/RISC-V  Future Work  Demo
  • 4. Background & Motivation of OpenJ9/RISC-V Cloud Computing (Centralized)  Long distance from the data source  Network bottleneck for huge volume of data  Security risk for sensitive data Edge Computing (Decentralized)  Close to the data source  Fast response to real-time data  Data localization 1 “Around 10% of enterprise-generated data is created and processed outside a traditional centralized data center or cloud. By 2025, Gartner predicts this figure will reach 75%” https://www.gartner.com/smarterwithgartner/what-edge- computing-means-for-infrastructure-and-operations-leaders Cloud Computing vs Edge Computing
  • 5. Background & Motivation of OpenJ9/RISC-V (Cont.) AIoT Edge Node Runtime / Java OS Realtime Control Management Data Analysis AI processing Hardware X86 Cloud Wireless / 5G Wired / FTTX 2 A solution for AIoT & Edge with lower cost & Lower power consumption is preferable to others
  • 6. A Brief History of OpenJ9  J9 VM developed independently by IBM as Enterprise middleware over 20 years (high performance, scalability & reliability)  Transition from ENVY/Smalltalk to C/C++ in recent years to lower barrier for developers  Donated to the Eclipse Foundation in 2017 as Eclipse OpenJ9 (currently led by IBM)  Dual License: Eclipse Public License v2.0 & Apache v2.0  J9 is not Java 9 (the naming convention for the Smalltalk source code) https://en.wikipedia.org/wiki/OpenJ9 3
  • 7. o OpenJDK (https://github.com/ibmruntimes/openj9-openjdk-jdk11): Building framework/Java Class libraries) o OpenJ9 (https://github.com/eclipse/openj9): Java Virtual Machine Core (equivalent of Hotspot) o OMR (https://github.com/eclipse/omr): Split from IBM J9 & refactored for polyglot runtimes What is OpenJ9? 4 OpenJDK/OpenJ9 OMR Open JDK HotSpot OpenJDK/Hotspot Open JDK
  • 8. The Architecture of OpenJ9 VM Classloader JCL natives Verification Interpreter Thread /Port Library OMR GC OpenJ9 RAS & DDR OMR JIT/AOT OpenJ9 GC OpenJ9 JIT/AOT OMR OMR RAS/DDR OpenJ9 VM SCC • Direct Dump Reader (DDR): diagnose issues of OpenJ9 in Java stacktraces at the bytecode level https://www.slideshare.net/Dev_Events/secrets-of-building-a-debuggable-runtime-learn-how-language-implementors-solve-your-runtime-issues • Shared Classes Cache (SCC): store J9 ROM Classes & AOT code for better performance (startup time & footprint) https://developer.ibm.com/technologies/java/tutorials/j-class-sharing-openj9/ What is OpenJ9? (Cont.) 5
  • 9. Porting OpenJ9 JDK to RISC-V (1) Preparation of Software  Toolchain for cross-compilation  RISC-V GNU Compiler Toolchain at https://github.com/riscv/riscv-gnu-toolchain (compiled from source)  Emulator on the Host system  RISC-V QEMU (riscv64) > 5.0 at https://www.qemu.org/ (compiled from source)  The building instruction at https://wiki.qemu.org/Documentation/Platforms/RISCV/  Linux-based Host System  Ubuntu v19 (Fedora v32, Debian v10, etc)  Linux-based Target System (https://github.com/riscv/riscv-software-list)  64 bit Fedora/RISC-V at https://dl.fedoraproject.org/pub/alt/risc-v/repo/virt-builder-images/images/  64 bit Debian/RISC-V at https://github.com/janvrany/riscv-debian (customized to HiFive U540) 6
  • 10. Porting OpenJ9 JDK to RISC-V (2) Preparation of Hardware  HiFive Unleashed 540 (64bit U540 SoC) o Linux-capable RISC-V processor with multi-core o 8GB DDR4 RAM with ECC o MicroSD Card (Removable Storage) o MicroUSB connector o RJ45 Gigabit Ethernet port https://sifive.cdn.prismic.io/sifive/8328bc5d-b7ea-4885-a7f9-30fc108b7222_HiFive_Unleashed_Getting_Started_Guide-v1p2.pdf 7
  • 11. Porting OpenJ9 JDK to RISC-V (3) Development of OpenJ9 JDK on RISC-V 8 OpenJDK OpenJ9 OMR Building scripts & Configuration VM/Interpreter mode LibFFI-JNI/RISC-V MISC Little-Endian DDR/RISC-V Port Library Gencon GC Atomic Support/CAS MISC JIT/AOT (disabled) Java Native Interface (JNI) support  the Foreign Function Interface (FFI) library on RISC-V from https://github.com/libffi/libffi/tree/master/src/riscv
  • 12. Porting OpenJ9 JDK to RISC-V (4) Mix of local complication & cross-compilation in OpenJ9 JDK on RISC-V  Local toolchain (on the host system): /usr/bin/gcc & g++, etc  Cross-toochain (on the host system): riscv64-linux-gnu-gcc & g++, etc 9 OpenJ9 JDK Source The Host System OpenJ9 Cross-Build Cross-Compilation Local Compilation Trace Tools Trace Constant & Headers OpenJ9 bootstrap & build JDK Compilation of OpenJ9 JDK/RISC-V
  • 13. Porting OpenJ9 JDK to RISC-V (5) • OpenJ9 on RISC-V: https://github.com/eclipse/openj9/blob/master/doc/build-instructions/Build_Instructions_V11.md#riscv64 • Fedora/RISCV on U540: https://fedoraproject.org/wiki/Architectures/RISC-V/Installing 10 Debian/RISC-V Install all libraries for OpenJDK11 Mounted onto the host system WITH bootstrap & build JDK Upload the cross-build to the target system (emulator) Upload the cross-build to the target system (U540) Fedora/RISC-V Fedora/RISC-V X86_64 Steps of the cross-compilation Fedora/RISC-V Debian/RISC-V U540 Fedora/RISC-V U540
  • 14. https://adoptopenjdk.net/releases.html?variant=openjdk11&jvmVariant=openj9 Porting OpenJ9 JDK to RISC-V (6) Downloading links of bootstrap JDK at AdoptOpenJDK 11
  • 15. Status of OpenJ9 JDK on RISC-V Execution of OpenJ9 JDK (Interpreter mode) QEMU (Emulator) 1. Debian/RISC-V  Debian (Linux kernel 5.0) with Berkeley Boot Loader (BBL)  RISC-V (Linux kernel > 5.3 ) with Open Source Supervisor Binary Interface (OpenSBI) (supported since linux kernel > 5.3) 2. Fedora/RISC-V  Fedora stage4 + Linux kernel 4.19 (first bootstrap image) with BBL  Linux kernel > 5.3 with OpenSBI HiFive U540 (Dev board) 1. Debian ( Linux kernel 5.0) with BBL 2. Java exception on Fedora & Debian (Linux kernel > 5.3) with OpenSBI (under investigation) 12
  • 16. Future Work • JIT support • Various GC strategies • DDR generation via cross-compilation • Java 8 & other JDK LTS support 13
  • 17. Demo
  • 18. Want to get involved? https://github.com/eclipse/openj9/issues/5058 https://openj9.slack.com/ (channel #risc-v)

Notes de l'éditeur

  1. Hello, everyone and many thanks for join this session. My name is Cheng Jin from IBM Ottawa. I am very excited to this topic because this is the first time to bring OpenJ9 to this conference.
  2. As usual, here are a set of disclaimers and legal notice for your attention. Do not make any business decision based on my presentation in this topic. IBM has no responsibility for anything incorrect in the slides.
  3. 1) Explain the background of why we were motivated to bring OpenJ9 onto RISC-V 2) Briefly introduce the OpenJ9 project given not too many people in the RISC-V community know about OpenJ9 JDK 3) Walk through a couple of OpenJ9 components as to how it works in OpenJ9 4) Share with you the challenges we faced & how we managed to overcome these obstacles 5) Summarize what we already completed in this project 6) the next steps we expect to push forward
  4. The Cloud framework is a centralized model of analyzing & processing data with extremely powerful hardware and software capability, which is significant in many industries. But the downside of cloud is apparent especially in the current network infrastructure. the data source is far away from the Cloud in many cases which means it takes longer than expected to transmit data for result. things getting worse in the network traffic when there are bottlenecks triggered by a huge amount of data. there are accumulated concerns on the data security in the Cloud so some industries prefer data to be stored & processed locally instead of passing over to the cloud. some regulations prevent sensitive data from being transmitted across different countries or areas. The edge computing is fundamentally an extension of cloud close to the data source to make sure all data are processed where they are generated as quickly as possible. And this decentralized model also helps to save the network bandwidth & the Cloud resources which is valuable for other businesses
  5. The Cloud & Edge devices are working together to get jobs done in a more efficient way in which case part of the Cloud responsibilities is moved to the Edge so the edge devices are intelligently capable of processing data and get back to the data source for better performance & user experience. The new disruptive technologies like AIoT & 5G will speed up the data generation and transmission from the data source to the edge, which demands mass production & deployment of edge facilities. RISC-V is more likely to offer a cost-effective solution with lower cost & lower power consumption by customization than others to support AIoT & Edge computing. From the runtime perspective, there might be a mix of different languages like python, node.j, on the edge devices. It is natural for OpenJ9 to leverage our Java technologies in the Cloud to extend the RISC-V ecosystem.
  6. OpenJ9, originally called IBM J9, are developed by IBM independently for over 20 years. It is an industrial-level product with high performance, scalability & reliability. We transited Smalltalk to C & C++ to lower the barriers for external users. The whole project was donated to the Eclipse Foundation on Sept 2017 and it is still led by IBM to push technical things forward. Due licenses provides users with more flexibilities to get involved in the development of OpenJ9. Java 9 is a number of Java version while J9 named after the IBM internal K8, which is a naming convention of Smalltalk source code.
  7. There are two parts in OpenJDK/Hotspot: The OpenJDK wrapper which mainly includes the building framework and a bunch of the Java class libraries. Hotspot, the Virtual machine core. OpenJ9 JDK is composed pretty much in the same way: 1) OpenJ9 is the equivalent of Hotspot in term of functionalities. 2) OMR originally was part of J9 which mainly thread libraries and port libraries specific to platforms.
  8. This no big technical difference as compared to Hotspot in term of key components. OpenJ9 VM includes: 1) Classloader which loads class file, 2) Verifier which does bytecode verification during the stage of class loading 3) JCL natives which are native code of OpenJ9 specific Java libraries 4) Interpreter which does the cool things to execute the bytecode all the way to end 5) RAS which consists of a bunch of debugging tools & utilities 6) Garbage collector and Just-In-time Compiler, plus OMR. There are two components which are unique to OpenJ9. 1) Direct Dump Reader (DDR) generates the metadata for java stack in core dumps so as to debug the java code at the bytecode level 2) Shared Classes Cache (SCC) mainly helps to store JIT/AOT data for better performance which is important for JIT/AOT compiler
  9. 1) Cross-toolchain: compile the source code to generate the toolchain. 2) Emulator: we chose Quick EMUlator which supports many hardware platforms including RISC-V. 3) Target OS: we chose Fedora & Debian as the target systems on RISC-V, which are mainstream OS and are customized to HiFive U540, the development board for RISC-V.
  10. Here is a list of features offered by this board (necessary for this project). 1) Linux support as OpenJ9 need to cross-compile and run on this Linux-based target system. 2) a decent memory for execution. 3) To work on the RISC-V target system: [1] burn the target OS image to the miscro-SD card to boot it up on the board; [2] log into system through the microUSB connection to determine the IP address; [3] connect to the target OS with SSH via the IP address.
  11. 1) OpenJDK: [1] no code change in OpenJDK [2] a bunch of building scripts, makefile, config file, etc were modified to pick up the specified compiling options to have code compiled correctly. 2) OpenJ9: [1] JIT & AOT was turned off in OpenJ9 to let the virtual machine run in the interpreter mode given this is the first step of the project. [2] all the endian-specific code in OpenJ9 was updated to handle the data in the right order on RISC-V. [3] only the basic GC policy (Gencon) was enabled for the moment to see how it goes. [4] the open sourced Foreign Function Interface Library on RISC-V was integrated into OpenJ9 as we did on other platforms. [5] a bunch of code in DDR was added to support the dump generation with specified metadata on RISC-V. 3) OMR: The main changes in OMR include the atomic support and port library which are specific to the hardware or the operation system.
  12. The cross-compilation in OpenJ9 JDK is kind of different from what we usually see how it works. A couple of trace related tools unique to OpenJ9 that must run on the local system to generate all trace specific constant & headers to be used in the later compilation. The local toolchain and the cross-toolchain must work together to get things working in this case. To work around this, we specially designed the building scripts to split up the compilation into two parts. 1) The first part is focusing on the local compilation of the trace tools. Once the tools are generated, they just get started to generate all required artifacts. 2) The cross-toolchain takes over from there to deal with the rest of the compilation.
  13. This diagram shows how to generate a cross-build for RISC-V: 1) boot up the target system on the emulator to download & install all required libraries for OpenJ9. 2) mount this target OS image to the local system for the cross-compilation. 3) once the cross-build is created, upload it to target system on the emulator or hardware for verification. Note: the cross-build compiled with Fedora/RISC-V works good on Debian/RISC-V and vice versa.
  14. There are two ways to get the bootstrap JDK for the cross-compilation. 1) directly download the latest build of JDK11 from AdoptOpenJDK. 2) follow the building instructions to compile the source code generate a bootstrap build on the local system.
  15. 1) It works good on the emulator, whether it comes to Fedora or Debian on RISC-V with different boot loaders. 2) It works good with Debian 5.0 plus BBL on the hardware. 3) We still have problem with the latest Linux kernel plus OpenSBI on U540
  16. 1) Probably get a lightweight JIT onboard as an intermediate step and then move forward to implement the full JIT afterwards. 2) Consider to enable other GC strategies to provide users with more options in various application scenarios. 3) Seek the feasibility of generating DDR through the cross-compilation. 4) Currently support Java 11 and will extend the RISC-V support to other JDK LTS version like Java 8, etc.
  17. Demonstrate how to cross-compile an OpenJ9 build on Ubuntu
  18. I really appreciate your time to attend this session. If you have any question, concerns or suggestions on our project, please let us know. Many thanks.