SlideShare a Scribd company logo
CPU hotplug implementation for the
multicore system running RTOS and Linux
simultaneously on separate cores
Oleksandr Shevchenko
Senior Consultant, Engineering
Agenda
1. Running RTOS and Linux simultaneously on separate
cores
2. CPU hotplug implementation
3. Questions?
3
Part 1
Running RTOS and Linux
simultaneously on separate cores
Kernel booting
Boot Sequence
NOR Flash
RTOS
Linux Kernel
(zImage)
RootFS
(rootfs.cpio.gz)
RAM
ATAGS
Kernel booting
Boot Sequence
NOR Flash
RTOS
Linux Kernel
(zImage)
RootFS
(rootfs.cpio.gz)
RAM
RTOS (core 0)
By 1-st stage bootloader
ATAGS
Kernel booting
Boot SequenceBoot Sequence
NOR Flash
Linux Kernel
(zImage)
RootFS
(rootfs.cpio.gz)
RAM
By RTOS
Linux Kernel
(zImage)
RootFS
(rootfs.cpio.gz)
ATAGS
ATAGS
RTOS
RTOS (core 0)
Kernel booting
Boot SequenceBoot SequenceBoot Sequence
NOR Flash
Linux Kernel
(zImage)
RootFS
(rootfs.cpio.gz)
RAM
Linux
Kernel
RootFS
(rootfs.cpio.gz)
RootFS
Uncompress and mount by Linux Kernel
ATAGS
Linux Kernel
(zImage)
Uncompressed by itself
ATAGS
RTOS
RTOS (core 0)
(core 1,2,3)
Kernel booting
Boot SequenceBoot SequenceBoot Sequence
NOR Flash
Linux Kernel
(zImage)
RootFS
(rootfs.cpio.gz)
RAM
Linux
Kernel
RootFS
ATAGS
User Space
Services and applications
RTOS
RTOS (core 0)
(core 1,2,3)
CPU Communication
The mutex registers can only be written when it is unused
(recognizable by reading a ‘0’). Mutexes can only be reset by writing a ‘0’.
Each ARM core should write an identifier to lock the mutex.
• ARM core 0: write ‘1’
• ARM core 1: write ‘2’
• ARM core 2: write ‘3’
• ARM core 3: write ‘4’
RTOS (core 0)
Linux Kernel
(core 2)
Linux Kernel
(core 3)
Linux Kernel
(core 1)
0 (Reset)Mutex register:
CPU Communication
The mutex registers can only be written when it is unused
(recognizable by reading a ‘0’). Mutexes can only be reset by writing a ‘0’.
Each ARM core should write an identifier to lock the mutex.
• ARM core 0: write ‘1’
• ARM core 1: write ‘2’
• ARM core 2: write ‘3’
• ARM core 3: write ‘4’
RTOS (core 0)
Linux Kernel
(core 2)
Linux Kernel
(core 3)
Linux Kernel
(core 1)
1 (Core 0)Mutex register:
Core 0 writes 1 to Mutex
Register and enters critical
section
CPU Communication
The mutex registers can only be written when it is unused
(recognizable by reading a ‘0’). Mutexes can only be reset by writing a ‘0’.
Each ARM core should write an identifier to lock the mutex.
• ARM core 0: write ‘1’
• ARM core 1: write ‘2’
• ARM core 2: write ‘3’
• ARM core 3: write ‘4’
RTOS (core 0)
Linux Kernel
(core 2)
Linux Kernel
(core 3)
Linux Kernel
(core 1)
0 (Reset)Mutex register:
Core 0 exits critical section by
writing 0 to Mutex Register
CPU Communication
The mutex registers can only be written when it is unused
(recognizable by reading a ‘0’). Mutexes can only be reset by writing a ‘0’.
Each ARM core should write an identifier to lock the mutex.
• ARM core 0: write ‘1’
• ARM core 1: write ‘2’
• ARM core 2: write ‘3’
• ARM core 3: write ‘4’
RTOS (core 0)
Linux Kernel
(core 2)
Linux Kernel
(core 3)
Linux Kernel
(core 1)
3 (Core 2)Mutex register:
Core 2 writes 3 to Mutex
Register and enters critical
section
CPU Communication
The mutex registers can only be written when it is unused
(recognizable by reading a ‘0’). Mutexes can only be reset by writing a ‘0’.
Each ARM core should write an identifier to lock the mutex.
• ARM core 0: write ‘1’
• ARM core 1: write ‘2’
• ARM core 2: write ‘3’
• ARM core 3: write ‘4’
RTOS (core 0)
Linux Kernel
(core 2)
Linux Kernel
(core 3)
Linux Kernel
(core 1)
0 (Reset)Mutex register:
Core 2 exits critical section by
writing 0 to Mutex Register
RTOS/Linux Device Driver Architecture
Physical Devices (Hardware)
Device Drivers
Virtual File System
Kernel Space
User Space
Application
Open/
Close
Read/
Write
IOCTL
Linux
RTOS/Linux Device Driver Architecture
Physical Devices (Hardware)
Device Drivers
Virtual File System
Kernel
Space
User
Space
Application
Open/
Close
Read/
Write
IOCTL
Linux
XAPI
RTOS
Application
RTOS/Linux Device Driver Architecture
Linux Driver file opsApplication
fd=open(“/dev/module_xyz”, …); modXyzOpen()
Private
data
handle
last_error
alloc
XAPI Core API
XAPI_XYZ_Open()
XAPI_XYZ_SetX()
XAPI_XYZ_GetY()
close(fd) modXyzClose()
free
XAPI_XYZ_Close()
XAPI_XYZ_Read()
XAPI_XYZ_Write()
modXyzIoctl()ioctl(fd, cmd, …)
User Space Kernel Space
modXyzRead()
modXyzWrite()
read(fd, …)
write(fd, …)
17
Part 1 Summary
1. Introduce correct boot sequence.
18
Part 1 Summary
1. Introduce correct boot sequence.
2. Provide inter-CPU synchronization mechanism.
19
Part 1 Summary
1. Introduce correct boot sequence.
2. Provide inter-CPU synchronization mechanism.
3. Implement common Hardware Abstraction Level
(HAL) for RTOS and Linux.
20
PART 2
CPU hotplug implementation
Decrease Response Time on Power On
RTOS (core 0)
Linux Kernel
(core 2)
Linux Kernel
(core 3)
RTOS (core 1)
1. Start 2 samples of RTOS on two cores.
RTOS (core 0)
Linux Kernel
(core 2)
Linux Kernel
(core 3)
1. Start 2 samples of RTOS on two cores.
2. Once time critical task is done – withdraw from one core.
RTOS (core 1)
Decrease Response Time on Power On
RTOS (core 0)
Linux Kernel
(core 2)
Linux Kernel
(core 3)
Idle (core 1)
1. Start 2 samples of RTOS on two cores.
2. Once time critical task is done – withdraw from one core.
Decrease Response Time on Power On
RTOS (core 0)
Linux Kernel
(core 2)
Linux Kernel
(core 3)
Idle (core 1)
1. Start 2 samples of RTOS on two cores.
2. Once time critical task is done – withdraw from one core.
3. Linux Hot-plugs the idle core
Decrease Response Time on Power On
RTOS (core 0)
Linux Kernel
(core 2)
Linux Kernel
(core 3)
1. Start 2 samples of RTOS on two cores.
2. Once time critical task is done – withdraw from one core.
3. Linux Hot-plugs the idle core
Linux Kernel
(core 1)
Decrease Response Time on Power On
Patching Linux Kernel SMP Init Code
main.c
kernel_init()
wakeup_secondary() is a place where the CPU state is changed
from IDLE to EXECUTE.
smp.c
smp_prepare_cpus()
arch/arm/mach-fujitsu/
smp-hd62x.c
platform_smp_prepare_cpus()
wakeup_secondary()
Patching Linux Kernel SMP Init Code
Patching Linux Kernel SMP Init Code
Patching Linux Kernel SMP Init Code
main.c
kernel_init()
__cpu_up() is the place where a new process spawn for the core #cpu
with fork_idle(cpu)
smp.c
smp_init()
cpu.c
cpu_up()
_cpu_up()
__cpu_up()
Patching Linux Kernel SMP Init Code
In __cpu_up() added functionality to skip CPU1 initialization during kernel
start-up.
+ static unsigned flag=0;
+
+ if ((cpu == 1) && (flag == 0))
+ {
+ printk(KERN_ERR "CPU%u: Skip initialization...n", cpu);
+ flag = 1;
+ return -EBUSY;
+ }
We should quit at this point during initialization phase and do not try to
spawn a new process for the core #1 with fork_idle(cpu).
We will do it later while hot-plugging.
Patching Linux Kernel SMP Init Code
Linux kernel already has built-in CPU core hot-plug functionality. To
activate CPU1 core hot-plug the following sysfs write command has
to be issued:
echo 1 > /sys/devices/system/cpu/cpu1/online
But this will only work correctly if the CPU core had been previously
initialized during the startup and then disabled by command
echo 0 > /sys/devices/system/cpu/cpu1/online
Patching Linux Kernel SMP Init Code
While writing to the cpu subsystem related sysfs file, the store_online() function from
src/drivers/base/cpu.c is called by kernel.
We added new wakeup_secondary() function to this file
+static void wakeup_secondary(void)
…
+ jump_address = virt_to_phys(fujitsu_secondary_startup);
+ writel(jump_address, BOOT_CPU_CONTROL_CPU1_JUMP);
+ control_value = __raw_readl(BOOT_CPU_CONTROL_CPU1_STATUS);
+ control_value &= ~BOOT_CPU_CONTROL_REQUEST_MASK;
+ control_value &= ~BOOT_CPU_CONTROL_STATUS_MASK;
+ control_value |= BOOT_CPU_CONTROL_REQUEST_EXECUTE;
+ writel(control_value, BOOT_CPU_CONTROL_CPU1_STATUS);
We call this function before cpu_up() function that brings the CPU core to Linux
world.
case '1':
+ wakeup_secondary();
ret = cpu_up(cpu->sysdev.id);
Patching Linux Kernel SMP Init Code
And of course before hot-plugging from Linux the RTOS should
withdraw from the core 1 and send it to POLLING state by writing
correct value to the CPU control register
BOOT_CPU_CONTROL_CPU1_STATUS
Check if it works
1. Run Linux console command:
# cat /sys/devices/system/cpu/online
0-2
2. Run CPU3 hot-plug command from Linux console:
# echo 1 > /sys/devices/system/cpu/cpu3/online
CPU3: Booted secondary processor
CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
HD62: Set local_timer Event Freq: 198000kHz Mult: 850403525 Shift: 32
CPU3: Unknown IPI message 0x1Sadf
3. Make sure that Linux is now running on 4 cores:
# cat /sys/devices/system/cpu/online
0-3
Check if it works
Check the output of
#htop
before and after hotplugging.
36
Part 2 Summary
1. Modify smp_prepare_cpus() to not put the target
CPU core to EXECUTE state.
37
Part 2 Summary
1. Modify smp_prepare_cpus() to not put the target
CPU core to EXECUTE state.
2. Modify __cpu_up to not spawn a new process for
the target core with fork_idle(cpu).
38
Part 2 Summary
1. Modify smp_prepare_cpus() to not put the target
CPU core to EXECUTE state.
2. Modify __cpu_up to not spawn a new process for
the target core with fork_idle(cpu).
3. Modify the RTOS code to put the target CPU core
to POLLING state on exit.
Questions?
Thank you!
Ad

More Related Content

What's hot (20)

Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
shimosawa
 
It's Time to ROCm!
It's Time to ROCm!It's Time to ROCm!
It's Time to ROCm!
inside-BigData.com
 
Ethernetの受信処理
Ethernetの受信処理Ethernetの受信処理
Ethernetの受信処理
Takuya ASADA
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
mukul bhardwaj
 
Linux Linux Traffic Control
Linux Linux Traffic ControlLinux Linux Traffic Control
Linux Linux Traffic Control
SUSE Labs Taipei
 
Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?
Samsung Open Source Group
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
GlobalLogic Ukraine
 
Android internals By Rajesh Khetan
Android internals By Rajesh KhetanAndroid internals By Rajesh Khetan
Android internals By Rajesh Khetan
Rajesh Khetan
 
Linux I2C
Linux I2CLinux I2C
Linux I2C
KaidenYu
 
Linux power management: are you doing it right?
Linux power management: are you doing it right?Linux power management: are you doing it right?
Linux power management: are you doing it right?
Chris Simmonds
 
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?
Pradeep Kumar
 
HKG15-107: ACPI Power Management on ARM64 Servers (v2)
HKG15-107: ACPI Power Management on ARM64 Servers (v2)HKG15-107: ACPI Power Management on ARM64 Servers (v2)
HKG15-107: ACPI Power Management on ARM64 Servers (v2)
Linaro
 
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
Vmlinux: anatomy of bzimage and how x86 64 processor is bootedVmlinux: anatomy of bzimage and how x86 64 processor is booted
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
Adrian Huang
 
Linux kernel tracing
Linux kernel tracingLinux kernel tracing
Linux kernel tracing
Viller Hsiao
 
Linux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKBLinux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKB
shimosawa
 
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
BPF  & Cilium - Turning Linux into a Microservices-aware Operating SystemBPF  & Cilium - Turning Linux into a Microservices-aware Operating System
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
Thomas Graf
 
ACPI Debugging from Linux Kernel
ACPI Debugging from Linux KernelACPI Debugging from Linux Kernel
ACPI Debugging from Linux Kernel
SUSE Labs Taipei
 
Dpdk applications
Dpdk applicationsDpdk applications
Dpdk applications
Vipin Varghese
 
Interrupt Affinityについて
Interrupt AffinityについてInterrupt Affinityについて
Interrupt Affinityについて
Takuya ASADA
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
Ray Jenkins
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
shimosawa
 
Ethernetの受信処理
Ethernetの受信処理Ethernetの受信処理
Ethernetの受信処理
Takuya ASADA
 
Linux Linux Traffic Control
Linux Linux Traffic ControlLinux Linux Traffic Control
Linux Linux Traffic Control
SUSE Labs Taipei
 
Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?
Samsung Open Source Group
 
Android internals By Rajesh Khetan
Android internals By Rajesh KhetanAndroid internals By Rajesh Khetan
Android internals By Rajesh Khetan
Rajesh Khetan
 
Linux power management: are you doing it right?
Linux power management: are you doing it right?Linux power management: are you doing it right?
Linux power management: are you doing it right?
Chris Simmonds
 
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?
Pradeep Kumar
 
HKG15-107: ACPI Power Management on ARM64 Servers (v2)
HKG15-107: ACPI Power Management on ARM64 Servers (v2)HKG15-107: ACPI Power Management on ARM64 Servers (v2)
HKG15-107: ACPI Power Management on ARM64 Servers (v2)
Linaro
 
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
Vmlinux: anatomy of bzimage and how x86 64 processor is bootedVmlinux: anatomy of bzimage and how x86 64 processor is booted
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
Adrian Huang
 
Linux kernel tracing
Linux kernel tracingLinux kernel tracing
Linux kernel tracing
Viller Hsiao
 
Linux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKBLinux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKB
shimosawa
 
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
BPF  & Cilium - Turning Linux into a Microservices-aware Operating SystemBPF  & Cilium - Turning Linux into a Microservices-aware Operating System
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
Thomas Graf
 
ACPI Debugging from Linux Kernel
ACPI Debugging from Linux KernelACPI Debugging from Linux Kernel
ACPI Debugging from Linux Kernel
SUSE Labs Taipei
 
Interrupt Affinityについて
Interrupt AffinityについてInterrupt Affinityについて
Interrupt Affinityについて
Takuya ASADA
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
Ray Jenkins
 

Similar to “Linux Kernel CPU Hotplug in the Multicore System” (20)

Linux Device Driver for Writing a real world driver for embedded Linux
Linux Device Driver for Writing a real world driver for embedded LinuxLinux Device Driver for Writing a real world driver for embedded Linux
Linux Device Driver for Writing a real world driver for embedded Linux
AchyuthShettigar2
 
[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical
Moabi.com
 
Ch04
Ch04Ch04
Ch04
Raja Waseem Akhtar
 
Ch04 system administration
Ch04 system administration Ch04 system administration
Ch04 system administration
Raja Waseem Akhtar
 
Driver_linux
Driver_linuxDriver_linux
Driver_linux
Sayanton Vhaduri
 
Kdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysisKdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysis
Buland Singh
 
Linuxdd[1]
Linuxdd[1]Linuxdd[1]
Linuxdd[1]
mcganesh
 
Linux scheduler
Linux schedulerLinux scheduler
Linux scheduler
Liran Ben Haim
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
Hao-Ran Liu
 
Linux Initialization Process (1)
Linux Initialization Process (1)Linux Initialization Process (1)
Linux Initialization Process (1)
shimosawa
 
kdump: usage and_internals
kdump: usage and_internalskdump: usage and_internals
kdump: usage and_internals
LinuxCon ContainerCon CloudOpen China
 
Hardware backdooring is practical : slides
Hardware backdooring is practical : slidesHardware backdooring is practical : slides
Hardware backdooring is practical : slides
Moabi.com
 
Linux Booting Steps
Linux Booting StepsLinux Booting Steps
Linux Booting Steps
Anando Kumar Paul
 
Shellcoding in linux
Shellcoding in linuxShellcoding in linux
Shellcoding in linux
Ajin Abraham
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Tour
samrat das
 
Genode Compositions
Genode CompositionsGenode Compositions
Genode Compositions
Vasily Sartakov
 
The-Linux-Kernel-Introduction-cs251-2001.ppt
The-Linux-Kernel-Introduction-cs251-2001.pptThe-Linux-Kernel-Introduction-cs251-2001.ppt
The-Linux-Kernel-Introduction-cs251-2001.ppt
submarinoaguadulce1
 
Beneath the Linux Interrupt handling
Beneath the Linux Interrupt handlingBeneath the Linux Interrupt handling
Beneath the Linux Interrupt handling
Bhoomil Chavda
 
Linux device driver
Linux device driverLinux device driver
Linux device driver
chatsiri
 
LINUX Device Drivers
LINUX Device DriversLINUX Device Drivers
LINUX Device Drivers
Partha Bhattacharya
 
Linux Device Driver for Writing a real world driver for embedded Linux
Linux Device Driver for Writing a real world driver for embedded LinuxLinux Device Driver for Writing a real world driver for embedded Linux
Linux Device Driver for Writing a real world driver for embedded Linux
AchyuthShettigar2
 
[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical
Moabi.com
 
Kdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysisKdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysis
Buland Singh
 
Linuxdd[1]
Linuxdd[1]Linuxdd[1]
Linuxdd[1]
mcganesh
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
Hao-Ran Liu
 
Linux Initialization Process (1)
Linux Initialization Process (1)Linux Initialization Process (1)
Linux Initialization Process (1)
shimosawa
 
Hardware backdooring is practical : slides
Hardware backdooring is practical : slidesHardware backdooring is practical : slides
Hardware backdooring is practical : slides
Moabi.com
 
Shellcoding in linux
Shellcoding in linuxShellcoding in linux
Shellcoding in linux
Ajin Abraham
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Tour
samrat das
 
The-Linux-Kernel-Introduction-cs251-2001.ppt
The-Linux-Kernel-Introduction-cs251-2001.pptThe-Linux-Kernel-Introduction-cs251-2001.ppt
The-Linux-Kernel-Introduction-cs251-2001.ppt
submarinoaguadulce1
 
Beneath the Linux Interrupt handling
Beneath the Linux Interrupt handlingBeneath the Linux Interrupt handling
Beneath the Linux Interrupt handling
Bhoomil Chavda
 
Linux device driver
Linux device driverLinux device driver
Linux device driver
chatsiri
 
Ad

More from GlobalLogic Ukraine (20)

GlobalLogic JavaScript Community Webinar #21 “Інтерв’ю без заспокійливих”
GlobalLogic JavaScript Community Webinar #21 “Інтерв’ю без заспокійливих”GlobalLogic JavaScript Community Webinar #21 “Інтерв’ю без заспокійливих”
GlobalLogic JavaScript Community Webinar #21 “Інтерв’ю без заспокійливих”
GlobalLogic Ukraine
 
Deadlocks in SQL - Turning Fear Into Understanding (by Sergii Stets)
Deadlocks in SQL - Turning Fear Into Understanding (by Sergii Stets)Deadlocks in SQL - Turning Fear Into Understanding (by Sergii Stets)
Deadlocks in SQL - Turning Fear Into Understanding (by Sergii Stets)
GlobalLogic Ukraine
 
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Ukraine
 
GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"
GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"
GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"
GlobalLogic Ukraine
 
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”
GlobalLogic Ukraine
 
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
GlobalLogic Ukraine
 
Штучний інтелект як допомога в навчанні, а не замінник.pptx
Штучний інтелект як допомога в навчанні, а не замінник.pptxШтучний інтелект як допомога в навчанні, а не замінник.pptx
Штучний інтелект як допомога в навчанні, а не замінник.pptx
GlobalLogic Ukraine
 
Задачі AI-розробника як застосовується штучний інтелект.pptx
Задачі AI-розробника як застосовується штучний інтелект.pptxЗадачі AI-розробника як застосовується штучний інтелект.pptx
Задачі AI-розробника як застосовується штучний інтелект.pptx
GlobalLogic Ukraine
 
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptxЩо треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
GlobalLogic Ukraine
 
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Ukraine
 
JavaScript Community Webinar #14 "Why Is Git Rebase?"
JavaScript Community Webinar #14 "Why Is Git Rebase?"JavaScript Community Webinar #14 "Why Is Git Rebase?"
JavaScript Community Webinar #14 "Why Is Git Rebase?"
GlobalLogic Ukraine
 
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic Ukraine
 
Страх і сила помилок - IT Inside від GlobalLogic Education
Страх і сила помилок - IT Inside від GlobalLogic EducationСтрах і сила помилок - IT Inside від GlobalLogic Education
Страх і сила помилок - IT Inside від GlobalLogic Education
GlobalLogic Ukraine
 
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic Ukraine
 
GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic QA Webinar “What does it take to become a Test Engineer”GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic Ukraine
 
“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?
GlobalLogic Ukraine
 
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Ukraine
 
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic Ukraine
 
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
GlobalLogic Ukraine
 
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
GlobalLogic Ukraine
 
GlobalLogic JavaScript Community Webinar #21 “Інтерв’ю без заспокійливих”
GlobalLogic JavaScript Community Webinar #21 “Інтерв’ю без заспокійливих”GlobalLogic JavaScript Community Webinar #21 “Інтерв’ю без заспокійливих”
GlobalLogic JavaScript Community Webinar #21 “Інтерв’ю без заспокійливих”
GlobalLogic Ukraine
 
Deadlocks in SQL - Turning Fear Into Understanding (by Sergii Stets)
Deadlocks in SQL - Turning Fear Into Understanding (by Sergii Stets)Deadlocks in SQL - Turning Fear Into Understanding (by Sergii Stets)
Deadlocks in SQL - Turning Fear Into Understanding (by Sergii Stets)
GlobalLogic Ukraine
 
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Ukraine
 
GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"
GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"
GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"
GlobalLogic Ukraine
 
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”
GlobalLogic Ukraine
 
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
GlobalLogic Ukraine
 
Штучний інтелект як допомога в навчанні, а не замінник.pptx
Штучний інтелект як допомога в навчанні, а не замінник.pptxШтучний інтелект як допомога в навчанні, а не замінник.pptx
Штучний інтелект як допомога в навчанні, а не замінник.pptx
GlobalLogic Ukraine
 
Задачі AI-розробника як застосовується штучний інтелект.pptx
Задачі AI-розробника як застосовується штучний інтелект.pptxЗадачі AI-розробника як застосовується штучний інтелект.pptx
Задачі AI-розробника як застосовується штучний інтелект.pptx
GlobalLogic Ukraine
 
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptxЩо треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
GlobalLogic Ukraine
 
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Ukraine
 
JavaScript Community Webinar #14 "Why Is Git Rebase?"
JavaScript Community Webinar #14 "Why Is Git Rebase?"JavaScript Community Webinar #14 "Why Is Git Rebase?"
JavaScript Community Webinar #14 "Why Is Git Rebase?"
GlobalLogic Ukraine
 
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic Ukraine
 
Страх і сила помилок - IT Inside від GlobalLogic Education
Страх і сила помилок - IT Inside від GlobalLogic EducationСтрах і сила помилок - IT Inside від GlobalLogic Education
Страх і сила помилок - IT Inside від GlobalLogic Education
GlobalLogic Ukraine
 
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic Ukraine
 
GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic QA Webinar “What does it take to become a Test Engineer”GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic Ukraine
 
“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?
GlobalLogic Ukraine
 
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Ukraine
 
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic Ukraine
 
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
GlobalLogic Ukraine
 
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
GlobalLogic Ukraine
 
Ad

Recently uploaded (20)

Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Working with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to ImplementationWorking with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to Implementation
Alabama Transportation Assistance Program
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning ModelsMode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Journal of Soft Computing in Civil Engineering
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
PawachMetharattanara
 
Machine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATIONMachine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATION
DarrinBright1
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
Reflections on Morality, Philosophy, and History
 
Personal Protective Efsgfgsffquipment.ppt
Personal Protective Efsgfgsffquipment.pptPersonal Protective Efsgfgsffquipment.ppt
Personal Protective Efsgfgsffquipment.ppt
ganjangbegu579
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
Uses of drones in civil construction.pdf
Uses of drones in civil construction.pdfUses of drones in civil construction.pdf
Uses of drones in civil construction.pdf
surajsen1729
 
Automatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and BeyondAutomatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and Beyond
NU_I_TODALAB
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
PawachMetharattanara
 
Machine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATIONMachine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATION
DarrinBright1
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
Personal Protective Efsgfgsffquipment.ppt
Personal Protective Efsgfgsffquipment.pptPersonal Protective Efsgfgsffquipment.ppt
Personal Protective Efsgfgsffquipment.ppt
ganjangbegu579
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
Uses of drones in civil construction.pdf
Uses of drones in civil construction.pdfUses of drones in civil construction.pdf
Uses of drones in civil construction.pdf
surajsen1729
 
Automatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and BeyondAutomatic Quality Assessment for Speech and Beyond
Automatic Quality Assessment for Speech and Beyond
NU_I_TODALAB
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 

“Linux Kernel CPU Hotplug in the Multicore System”

  • 1. CPU hotplug implementation for the multicore system running RTOS and Linux simultaneously on separate cores Oleksandr Shevchenko Senior Consultant, Engineering
  • 2. Agenda 1. Running RTOS and Linux simultaneously on separate cores 2. CPU hotplug implementation 3. Questions?
  • 3. 3 Part 1 Running RTOS and Linux simultaneously on separate cores
  • 4. Kernel booting Boot Sequence NOR Flash RTOS Linux Kernel (zImage) RootFS (rootfs.cpio.gz) RAM ATAGS
  • 5. Kernel booting Boot Sequence NOR Flash RTOS Linux Kernel (zImage) RootFS (rootfs.cpio.gz) RAM RTOS (core 0) By 1-st stage bootloader ATAGS
  • 6. Kernel booting Boot SequenceBoot Sequence NOR Flash Linux Kernel (zImage) RootFS (rootfs.cpio.gz) RAM By RTOS Linux Kernel (zImage) RootFS (rootfs.cpio.gz) ATAGS ATAGS RTOS RTOS (core 0)
  • 7. Kernel booting Boot SequenceBoot SequenceBoot Sequence NOR Flash Linux Kernel (zImage) RootFS (rootfs.cpio.gz) RAM Linux Kernel RootFS (rootfs.cpio.gz) RootFS Uncompress and mount by Linux Kernel ATAGS Linux Kernel (zImage) Uncompressed by itself ATAGS RTOS RTOS (core 0) (core 1,2,3)
  • 8. Kernel booting Boot SequenceBoot SequenceBoot Sequence NOR Flash Linux Kernel (zImage) RootFS (rootfs.cpio.gz) RAM Linux Kernel RootFS ATAGS User Space Services and applications RTOS RTOS (core 0) (core 1,2,3)
  • 9. CPU Communication The mutex registers can only be written when it is unused (recognizable by reading a ‘0’). Mutexes can only be reset by writing a ‘0’. Each ARM core should write an identifier to lock the mutex. • ARM core 0: write ‘1’ • ARM core 1: write ‘2’ • ARM core 2: write ‘3’ • ARM core 3: write ‘4’ RTOS (core 0) Linux Kernel (core 2) Linux Kernel (core 3) Linux Kernel (core 1) 0 (Reset)Mutex register:
  • 10. CPU Communication The mutex registers can only be written when it is unused (recognizable by reading a ‘0’). Mutexes can only be reset by writing a ‘0’. Each ARM core should write an identifier to lock the mutex. • ARM core 0: write ‘1’ • ARM core 1: write ‘2’ • ARM core 2: write ‘3’ • ARM core 3: write ‘4’ RTOS (core 0) Linux Kernel (core 2) Linux Kernel (core 3) Linux Kernel (core 1) 1 (Core 0)Mutex register: Core 0 writes 1 to Mutex Register and enters critical section
  • 11. CPU Communication The mutex registers can only be written when it is unused (recognizable by reading a ‘0’). Mutexes can only be reset by writing a ‘0’. Each ARM core should write an identifier to lock the mutex. • ARM core 0: write ‘1’ • ARM core 1: write ‘2’ • ARM core 2: write ‘3’ • ARM core 3: write ‘4’ RTOS (core 0) Linux Kernel (core 2) Linux Kernel (core 3) Linux Kernel (core 1) 0 (Reset)Mutex register: Core 0 exits critical section by writing 0 to Mutex Register
  • 12. CPU Communication The mutex registers can only be written when it is unused (recognizable by reading a ‘0’). Mutexes can only be reset by writing a ‘0’. Each ARM core should write an identifier to lock the mutex. • ARM core 0: write ‘1’ • ARM core 1: write ‘2’ • ARM core 2: write ‘3’ • ARM core 3: write ‘4’ RTOS (core 0) Linux Kernel (core 2) Linux Kernel (core 3) Linux Kernel (core 1) 3 (Core 2)Mutex register: Core 2 writes 3 to Mutex Register and enters critical section
  • 13. CPU Communication The mutex registers can only be written when it is unused (recognizable by reading a ‘0’). Mutexes can only be reset by writing a ‘0’. Each ARM core should write an identifier to lock the mutex. • ARM core 0: write ‘1’ • ARM core 1: write ‘2’ • ARM core 2: write ‘3’ • ARM core 3: write ‘4’ RTOS (core 0) Linux Kernel (core 2) Linux Kernel (core 3) Linux Kernel (core 1) 0 (Reset)Mutex register: Core 2 exits critical section by writing 0 to Mutex Register
  • 14. RTOS/Linux Device Driver Architecture Physical Devices (Hardware) Device Drivers Virtual File System Kernel Space User Space Application Open/ Close Read/ Write IOCTL Linux
  • 15. RTOS/Linux Device Driver Architecture Physical Devices (Hardware) Device Drivers Virtual File System Kernel Space User Space Application Open/ Close Read/ Write IOCTL Linux XAPI RTOS Application
  • 16. RTOS/Linux Device Driver Architecture Linux Driver file opsApplication fd=open(“/dev/module_xyz”, …); modXyzOpen() Private data handle last_error alloc XAPI Core API XAPI_XYZ_Open() XAPI_XYZ_SetX() XAPI_XYZ_GetY() close(fd) modXyzClose() free XAPI_XYZ_Close() XAPI_XYZ_Read() XAPI_XYZ_Write() modXyzIoctl()ioctl(fd, cmd, …) User Space Kernel Space modXyzRead() modXyzWrite() read(fd, …) write(fd, …)
  • 17. 17 Part 1 Summary 1. Introduce correct boot sequence.
  • 18. 18 Part 1 Summary 1. Introduce correct boot sequence. 2. Provide inter-CPU synchronization mechanism.
  • 19. 19 Part 1 Summary 1. Introduce correct boot sequence. 2. Provide inter-CPU synchronization mechanism. 3. Implement common Hardware Abstraction Level (HAL) for RTOS and Linux.
  • 20. 20 PART 2 CPU hotplug implementation
  • 21. Decrease Response Time on Power On RTOS (core 0) Linux Kernel (core 2) Linux Kernel (core 3) RTOS (core 1) 1. Start 2 samples of RTOS on two cores.
  • 22. RTOS (core 0) Linux Kernel (core 2) Linux Kernel (core 3) 1. Start 2 samples of RTOS on two cores. 2. Once time critical task is done – withdraw from one core. RTOS (core 1) Decrease Response Time on Power On
  • 23. RTOS (core 0) Linux Kernel (core 2) Linux Kernel (core 3) Idle (core 1) 1. Start 2 samples of RTOS on two cores. 2. Once time critical task is done – withdraw from one core. Decrease Response Time on Power On
  • 24. RTOS (core 0) Linux Kernel (core 2) Linux Kernel (core 3) Idle (core 1) 1. Start 2 samples of RTOS on two cores. 2. Once time critical task is done – withdraw from one core. 3. Linux Hot-plugs the idle core Decrease Response Time on Power On
  • 25. RTOS (core 0) Linux Kernel (core 2) Linux Kernel (core 3) 1. Start 2 samples of RTOS on two cores. 2. Once time critical task is done – withdraw from one core. 3. Linux Hot-plugs the idle core Linux Kernel (core 1) Decrease Response Time on Power On
  • 26. Patching Linux Kernel SMP Init Code main.c kernel_init() wakeup_secondary() is a place where the CPU state is changed from IDLE to EXECUTE. smp.c smp_prepare_cpus() arch/arm/mach-fujitsu/ smp-hd62x.c platform_smp_prepare_cpus() wakeup_secondary()
  • 27. Patching Linux Kernel SMP Init Code
  • 28. Patching Linux Kernel SMP Init Code
  • 29. Patching Linux Kernel SMP Init Code main.c kernel_init() __cpu_up() is the place where a new process spawn for the core #cpu with fork_idle(cpu) smp.c smp_init() cpu.c cpu_up() _cpu_up() __cpu_up()
  • 30. Patching Linux Kernel SMP Init Code In __cpu_up() added functionality to skip CPU1 initialization during kernel start-up. + static unsigned flag=0; + + if ((cpu == 1) && (flag == 0)) + { + printk(KERN_ERR "CPU%u: Skip initialization...n", cpu); + flag = 1; + return -EBUSY; + } We should quit at this point during initialization phase and do not try to spawn a new process for the core #1 with fork_idle(cpu). We will do it later while hot-plugging.
  • 31. Patching Linux Kernel SMP Init Code Linux kernel already has built-in CPU core hot-plug functionality. To activate CPU1 core hot-plug the following sysfs write command has to be issued: echo 1 > /sys/devices/system/cpu/cpu1/online But this will only work correctly if the CPU core had been previously initialized during the startup and then disabled by command echo 0 > /sys/devices/system/cpu/cpu1/online
  • 32. Patching Linux Kernel SMP Init Code While writing to the cpu subsystem related sysfs file, the store_online() function from src/drivers/base/cpu.c is called by kernel. We added new wakeup_secondary() function to this file +static void wakeup_secondary(void) … + jump_address = virt_to_phys(fujitsu_secondary_startup); + writel(jump_address, BOOT_CPU_CONTROL_CPU1_JUMP); + control_value = __raw_readl(BOOT_CPU_CONTROL_CPU1_STATUS); + control_value &= ~BOOT_CPU_CONTROL_REQUEST_MASK; + control_value &= ~BOOT_CPU_CONTROL_STATUS_MASK; + control_value |= BOOT_CPU_CONTROL_REQUEST_EXECUTE; + writel(control_value, BOOT_CPU_CONTROL_CPU1_STATUS); We call this function before cpu_up() function that brings the CPU core to Linux world. case '1': + wakeup_secondary(); ret = cpu_up(cpu->sysdev.id);
  • 33. Patching Linux Kernel SMP Init Code And of course before hot-plugging from Linux the RTOS should withdraw from the core 1 and send it to POLLING state by writing correct value to the CPU control register BOOT_CPU_CONTROL_CPU1_STATUS
  • 34. Check if it works 1. Run Linux console command: # cat /sys/devices/system/cpu/online 0-2 2. Run CPU3 hot-plug command from Linux console: # echo 1 > /sys/devices/system/cpu/cpu3/online CPU3: Booted secondary processor CPU3: thread -1, cpu 3, socket 0, mpidr 80000003 HD62: Set local_timer Event Freq: 198000kHz Mult: 850403525 Shift: 32 CPU3: Unknown IPI message 0x1Sadf 3. Make sure that Linux is now running on 4 cores: # cat /sys/devices/system/cpu/online 0-3
  • 35. Check if it works Check the output of #htop before and after hotplugging.
  • 36. 36 Part 2 Summary 1. Modify smp_prepare_cpus() to not put the target CPU core to EXECUTE state.
  • 37. 37 Part 2 Summary 1. Modify smp_prepare_cpus() to not put the target CPU core to EXECUTE state. 2. Modify __cpu_up to not spawn a new process for the target core with fork_idle(cpu).
  • 38. 38 Part 2 Summary 1. Modify smp_prepare_cpus() to not put the target CPU core to EXECUTE state. 2. Modify __cpu_up to not spawn a new process for the target core with fork_idle(cpu). 3. Modify the RTOS code to put the target CPU core to POLLING state on exit.
  翻译: