SlideShare a Scribd company logo
1 of 39
Download to read offline
Vincent Guittot
Linaro Power Management Working Group
Linaro Connect Q4'12
Peeking into your Linux System
Vincent Guittot <vincent.guittot@linaro.org>
Linaro Power Management Working Group
Vincent Guittot
Linaro Power Management Working Group
Tools
● Used during this sessions
● ftrace / trace-cmd
● kernelshark
● cylictest
● sysbench
● taskset
● IRQ affinity
● arm-probe
Vincent Guittot
Linaro Power Management Working Group
Hardware
● TC2 board
● Access to big and LITTLE power domain
● ARM probe
● Up to 3 channels
● 10kHz sampling rate
Vincent Guittot
Linaro Power Management Working Group
Software
● Full Ubuntu Image 12.09
● Linaro ARM Landing Team kernel
● Disable HMP task placement
● Disable load balance between cluster
● Additional patch set
Vincent Guittot
Linaro Power Management Working Group
Goals
● Spy system behavior
● Understand wake up sources
● Understand scheduling behavior
● Exercise your system
Vincent Guittot
Linaro Power Management Working Group
ftrace overview
● ftrace
● In kernel tracing utility
● Trace specific events like entering an idle state..
● Trace function call
● And more ...
● Location
● <debugfs path>/tracing/
Vincent Guittot
Linaro Power Management Working Group
ftrace overview
● Useful articles in addition to Documentation:
● http://lwn.net/Articles/366796/
● http://lwn.net/Articles/365835/
● Use trace-cmd tool
● Simplify ftrace configuration and use
Vincent Guittot
Linaro Power Management Working Group
trace-cmd overview
● trace-cmd encapsulates ftrace
● Package available for Ubuntu image
● Installed in next android image
● Graphic viewer : kernelshark
● Nice human readable interface
● Package available for Ubuntu image
Vincent Guittot
Linaro Power Management Working Group
Start to trace
● Have a look at trace-cmd
● Let make 1st traces
Vincent Guittot
Linaro Power Management Working Group
trace-cmd record
Add a snapshot of kernelshark
example0
trace-cmd record -e all -o example0.dat sleep 2
● Huge activity...
● Tracing activity...
Vincent Guittot
Linaro Power Management Working Group
●What to trace ?
● Core state:
● Idle state
● Frequency scaling
● Wake up source:
● Interruption
● Activity:
● Sched
● Timer
● Workqueue
Vincent Guittot
Linaro Power Management Working Group
Ring buffer
● ftrace uses a ring buffer
● Limited number of events
● trace-cmd record
● Periodically read the ring buffer
● -s option set the period (default is 1ms)
● Generate “spurious” activity : 1 process per core
● Trig deferrable activity
Vincent Guittot
Linaro Power Management Working Group
Sample period
trace-cmd record -s 100000 -e irq -e sched -e timer -e
workqueue -o example1.dat sleep 2
● Less activities ...
● Tracing activity ...
Vincent Guittot
Linaro Power Management Working Group
Stay quiet
● trace-cmd start / stop / extract
● No noise activity during the record
● circular buffer
● Increase the buffer's size
● Make a new trace
Vincent Guittot
Linaro Power Management Working Group
Quiet trace
trace-cmd start -b 4000 -e irq -e sched -e timer -e workqueue;
sleep 2; trace-cmd stop; trace-cmd extract -o example2.dat
● few activity...
● IRQ on big → CPU0
Vincent Guittot
Linaro Power Management Working Group
IRQ affinity
● The real wake up source
● Influence where task will run
● Use 1st CPU of the mask
● CPU0 → big core
● Change the affinity
● /proc/irq/*/smp_affinity
● irqbalance daemon
● Set default affinity on LITTLE
Vincent Guittot
Linaro Power Management Working Group
IRQ affinity
trace-cmd start -b 4000 -e irq -e sched -e timer -e workqueue;
sleep 2; trace-cmd stop; trace-cmd extract -o example3.dat
● Nearly nothing on big cores...
Vincent Guittot
Linaro Power Management Working Group
RT tasks
● On previous trace
● Only some RT tasks on big
● There is not much we can do
● Set task affinity with taskset
Vincent Guittot
Linaro Power Management Working Group
Low CPU load
● Idle is almost aligned with what we want
● Test behavior with low load tasks
● Cyclictest
● Create small tasks that wake up periodically
Vincent Guittot
Linaro Power Management Working Group
cyclictest
trace-cmd start -b 4000 -e irq -e sched -e timer -e workqueue
-e cpu_idle; cyclictest -t 7 -q -D 1; trace-cmd stop; trace-cmd
extract -o exampl4.dat
● Stay on LITTLE cores
Vincent Guittot
Linaro Power Management Working Group
Small task packing
● Most of cyclictest thread on CPU2
● Some on CPU3
● Few on CPU4
● Why ?
● Pack buddy CPU is busy
● Go back to default behavior
● Worth to parallelize in a cluster
Vincent Guittot
Linaro Power Management Working Group
Deeply in the trace
● Packing task → green line
● Spreading task → red line
Vincent Guittot
Linaro Power Management Working Group
Power consumption
● Measure power of the use case
● ARM-probe HW
● Command line SW for acquisition
– Thanks to Andy Green
● Gnuplot for displaying
● Make a measure
Vincent Guittot
Linaro Power Management Working Group
1st power result
cyclictest -t 7 -q -D 1
● Both cluster are always on and consuming !!!
Vincent Guittot
Linaro Power Management Working Group
cyclictest
● Set the cpu_dma_latency QoS
● Used by cpuidle
● -e option set the QoS value
● Make another measure
Vincent Guittot
Linaro Power Management Working Group
New power result
cyclictest -t 7 -e 1000000 -q -D 1
● Big cluster is off
● LITTLE cluster is on
Vincent Guittot
Linaro Power Management Working Group
cyclictest
● Cluster goes down iff idle duration >= 1ms
● Default cyclictest interval is 1ms
● Can't enter off state
● -i option increases the interval
● Make another measure
Vincent Guittot
Linaro Power Management Working Group
Power measure
cyclictest -t 7 -i 9000 -e 1000000 -q -D 1
● Big cluster is off
● LITTLE cluster toggles
●
●
Vincent Guittot
Linaro Power Management Working Group
Heavy task
● Small tasks are packed
● What about heavy task ?
● Sysbench
● --test=cpu : prime number computation
● --test=threads : lock thread
Vincent Guittot
Linaro Power Management Working Group
sysbench
trace-cmd start -b 4000 -e irq -e sched -e timer -e
workqueue -e cpu_idle; sysbench –test=cpu –num-
thread=1 –max-time=1 run; trace-cmd stop; trace-cmd
extract -o exampl4.dat
● Move on big core
Vincent Guittot
Linaro Power Management Working Group
sysbench
Add a snapshot of kernelshark
example8
trace-cmd start -b 4000 -e irq -e sched -e timer -e workqueue -e
cpu_idle; sysbench –test=cpu –num-thread=7 –max-time=1 run;
trace-cmd stop; trace-cmd extract -o exampl8.dat
● Move on big core
Vincent Guittot
Linaro Power Management Working Group
taskset
● Pin a task on a subset of CPU
● Check what is the best scheduling behavior
● Performance
● Fastest configuration
● Powersaving
● Most thrifty configuration
Vincent Guittot
Linaro Power Management Working Group
taskset
● Previous test
● Better to put everything on big ?
Vincent Guittot
Linaro Power Management Working Group
Real use cases
● MP3 playback
● Web browsing
Vincent Guittot
Linaro Power Management Working Group
MP3 playback
Add snapshot kernelshark
Vincent Guittot
Linaro Power Management Working Group
Web browsing
Add snapshot kernelshark
Vincent Guittot
Linaro Power Management Working Group
Question ?
Vincent Guittot
Linaro Power Management Working Group
Thank you
Vincent Guittot
Linaro Power Management Working Group
Backup slide
● MP3 sequence

More Related Content

More from Linaro

Bud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaBud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaLinaro
 
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018Linaro
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018Linaro
 
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...Linaro
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Linaro
 
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Linaro
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Linaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineLinaro
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteLinaro
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopLinaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineLinaro
 
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allHKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allLinaro
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorLinaro
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMULinaro
 
HKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MHKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MLinaro
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation Linaro
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootLinaro
 
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...Linaro
 
HKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramHKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramLinaro
 
HKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NNHKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NNLinaro
 

More from Linaro (20)

Bud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaBud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qa
 
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018
 
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
 
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening Keynote
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP Workshop
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allHKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMU
 
HKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MHKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8M
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
 
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
 
HKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramHKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready Program
 
HKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NNHKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NN
 

Recently uploaded

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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...Drew Madelung
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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...Enterprise Knowledge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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 Scriptwesley chun
 

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General 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
 

LCE12: Peeking into your Linux System

  • 1. Vincent Guittot Linaro Power Management Working Group Linaro Connect Q4'12 Peeking into your Linux System Vincent Guittot <vincent.guittot@linaro.org> Linaro Power Management Working Group
  • 2. Vincent Guittot Linaro Power Management Working Group Tools ● Used during this sessions ● ftrace / trace-cmd ● kernelshark ● cylictest ● sysbench ● taskset ● IRQ affinity ● arm-probe
  • 3. Vincent Guittot Linaro Power Management Working Group Hardware ● TC2 board ● Access to big and LITTLE power domain ● ARM probe ● Up to 3 channels ● 10kHz sampling rate
  • 4. Vincent Guittot Linaro Power Management Working Group Software ● Full Ubuntu Image 12.09 ● Linaro ARM Landing Team kernel ● Disable HMP task placement ● Disable load balance between cluster ● Additional patch set
  • 5. Vincent Guittot Linaro Power Management Working Group Goals ● Spy system behavior ● Understand wake up sources ● Understand scheduling behavior ● Exercise your system
  • 6. Vincent Guittot Linaro Power Management Working Group ftrace overview ● ftrace ● In kernel tracing utility ● Trace specific events like entering an idle state.. ● Trace function call ● And more ... ● Location ● <debugfs path>/tracing/
  • 7. Vincent Guittot Linaro Power Management Working Group ftrace overview ● Useful articles in addition to Documentation: ● http://lwn.net/Articles/366796/ ● http://lwn.net/Articles/365835/ ● Use trace-cmd tool ● Simplify ftrace configuration and use
  • 8. Vincent Guittot Linaro Power Management Working Group trace-cmd overview ● trace-cmd encapsulates ftrace ● Package available for Ubuntu image ● Installed in next android image ● Graphic viewer : kernelshark ● Nice human readable interface ● Package available for Ubuntu image
  • 9. Vincent Guittot Linaro Power Management Working Group Start to trace ● Have a look at trace-cmd ● Let make 1st traces
  • 10. Vincent Guittot Linaro Power Management Working Group trace-cmd record Add a snapshot of kernelshark example0 trace-cmd record -e all -o example0.dat sleep 2 ● Huge activity... ● Tracing activity...
  • 11. Vincent Guittot Linaro Power Management Working Group ●What to trace ? ● Core state: ● Idle state ● Frequency scaling ● Wake up source: ● Interruption ● Activity: ● Sched ● Timer ● Workqueue
  • 12. Vincent Guittot Linaro Power Management Working Group Ring buffer ● ftrace uses a ring buffer ● Limited number of events ● trace-cmd record ● Periodically read the ring buffer ● -s option set the period (default is 1ms) ● Generate “spurious” activity : 1 process per core ● Trig deferrable activity
  • 13. Vincent Guittot Linaro Power Management Working Group Sample period trace-cmd record -s 100000 -e irq -e sched -e timer -e workqueue -o example1.dat sleep 2 ● Less activities ... ● Tracing activity ...
  • 14. Vincent Guittot Linaro Power Management Working Group Stay quiet ● trace-cmd start / stop / extract ● No noise activity during the record ● circular buffer ● Increase the buffer's size ● Make a new trace
  • 15. Vincent Guittot Linaro Power Management Working Group Quiet trace trace-cmd start -b 4000 -e irq -e sched -e timer -e workqueue; sleep 2; trace-cmd stop; trace-cmd extract -o example2.dat ● few activity... ● IRQ on big → CPU0
  • 16. Vincent Guittot Linaro Power Management Working Group IRQ affinity ● The real wake up source ● Influence where task will run ● Use 1st CPU of the mask ● CPU0 → big core ● Change the affinity ● /proc/irq/*/smp_affinity ● irqbalance daemon ● Set default affinity on LITTLE
  • 17. Vincent Guittot Linaro Power Management Working Group IRQ affinity trace-cmd start -b 4000 -e irq -e sched -e timer -e workqueue; sleep 2; trace-cmd stop; trace-cmd extract -o example3.dat ● Nearly nothing on big cores...
  • 18. Vincent Guittot Linaro Power Management Working Group RT tasks ● On previous trace ● Only some RT tasks on big ● There is not much we can do ● Set task affinity with taskset
  • 19. Vincent Guittot Linaro Power Management Working Group Low CPU load ● Idle is almost aligned with what we want ● Test behavior with low load tasks ● Cyclictest ● Create small tasks that wake up periodically
  • 20. Vincent Guittot Linaro Power Management Working Group cyclictest trace-cmd start -b 4000 -e irq -e sched -e timer -e workqueue -e cpu_idle; cyclictest -t 7 -q -D 1; trace-cmd stop; trace-cmd extract -o exampl4.dat ● Stay on LITTLE cores
  • 21. Vincent Guittot Linaro Power Management Working Group Small task packing ● Most of cyclictest thread on CPU2 ● Some on CPU3 ● Few on CPU4 ● Why ? ● Pack buddy CPU is busy ● Go back to default behavior ● Worth to parallelize in a cluster
  • 22. Vincent Guittot Linaro Power Management Working Group Deeply in the trace ● Packing task → green line ● Spreading task → red line
  • 23. Vincent Guittot Linaro Power Management Working Group Power consumption ● Measure power of the use case ● ARM-probe HW ● Command line SW for acquisition – Thanks to Andy Green ● Gnuplot for displaying ● Make a measure
  • 24. Vincent Guittot Linaro Power Management Working Group 1st power result cyclictest -t 7 -q -D 1 ● Both cluster are always on and consuming !!!
  • 25. Vincent Guittot Linaro Power Management Working Group cyclictest ● Set the cpu_dma_latency QoS ● Used by cpuidle ● -e option set the QoS value ● Make another measure
  • 26. Vincent Guittot Linaro Power Management Working Group New power result cyclictest -t 7 -e 1000000 -q -D 1 ● Big cluster is off ● LITTLE cluster is on
  • 27. Vincent Guittot Linaro Power Management Working Group cyclictest ● Cluster goes down iff idle duration >= 1ms ● Default cyclictest interval is 1ms ● Can't enter off state ● -i option increases the interval ● Make another measure
  • 28. Vincent Guittot Linaro Power Management Working Group Power measure cyclictest -t 7 -i 9000 -e 1000000 -q -D 1 ● Big cluster is off ● LITTLE cluster toggles ● ●
  • 29. Vincent Guittot Linaro Power Management Working Group Heavy task ● Small tasks are packed ● What about heavy task ? ● Sysbench ● --test=cpu : prime number computation ● --test=threads : lock thread
  • 30. Vincent Guittot Linaro Power Management Working Group sysbench trace-cmd start -b 4000 -e irq -e sched -e timer -e workqueue -e cpu_idle; sysbench –test=cpu –num- thread=1 –max-time=1 run; trace-cmd stop; trace-cmd extract -o exampl4.dat ● Move on big core
  • 31. Vincent Guittot Linaro Power Management Working Group sysbench Add a snapshot of kernelshark example8 trace-cmd start -b 4000 -e irq -e sched -e timer -e workqueue -e cpu_idle; sysbench –test=cpu –num-thread=7 –max-time=1 run; trace-cmd stop; trace-cmd extract -o exampl8.dat ● Move on big core
  • 32. Vincent Guittot Linaro Power Management Working Group taskset ● Pin a task on a subset of CPU ● Check what is the best scheduling behavior ● Performance ● Fastest configuration ● Powersaving ● Most thrifty configuration
  • 33. Vincent Guittot Linaro Power Management Working Group taskset ● Previous test ● Better to put everything on big ?
  • 34. Vincent Guittot Linaro Power Management Working Group Real use cases ● MP3 playback ● Web browsing
  • 35. Vincent Guittot Linaro Power Management Working Group MP3 playback Add snapshot kernelshark
  • 36. Vincent Guittot Linaro Power Management Working Group Web browsing Add snapshot kernelshark
  • 37. Vincent Guittot Linaro Power Management Working Group Question ?
  • 38. Vincent Guittot Linaro Power Management Working Group Thank you
  • 39. Vincent Guittot Linaro Power Management Working Group Backup slide ● MP3 sequence