SlideShare une entreprise Scribd logo
1  sur  22
First step for dynticks
      in FreeBSD
               Tsuyoshi Ozawa
                Univ. of Tsukuba
          ozawa@softlab.cs.tsukuba.ac.jp
               ozawa@t-oza.net

AsiaBSDcon March 14th, 2010 Work-In-Progress talk
Ticks


               HZ       HZ         time

• Timer interrupt is important processing to
  work kernel correctly
• But it is very expensive to handle periodic
  ticks
Ticks


               HZ       HZ         time

• Timer interrupt is important processing to
  work kernel correctly
• But it is very expensive to handle periodic
  ticks
Ticks


               HZ       HZ         time

• Timer interrupt is important processing to
  work kernel correctly
• But it is very expensive to handle periodic
  ticks
Ticks


               HZ       HZ         time

• Timer interrupt is important processing to
  work kernel correctly
• But it is very expensive to handle periodic
  ticks
Dynticks


                                                          time
                    when next Timer is going to be fired



•   Timer interrupts are generated by using oneshot timer.

•   This feature is implemented in Solaris, Linux and etc.
Dynticks


                                                          time
                    when next Timer is going to be fired



•   Timer interrupts are generated by using oneshot timer.

•   This feature is implemented in Solaris, Linux and etc.
Dynticks


                                                          time
                    when next Timer is going to be fired



•   Timer interrupts are generated by using oneshot timer.

•   This feature is implemented in Solaris, Linux and etc.
Dynticks


                                                          time
                    when next Timer is going to be fired



•   Timer interrupts are generated by using oneshot timer.

•   This feature is implemented in Solaris, Linux and etc.
Benefits

• If OSes can skip needless ticks...
   •   Save power consumption

   •   OS in Virtual Machine work more lightly (e.g.
       FreeBSD as guest OS)
         VMware, “Timekeeping in VMware Virtual Machines”, http://
         www.vmware.com/pdf/vmware_timekeeping.pdf, 2008
Suggestion


• Dynamic Ticks in FreeBSD
Rough Design
• Switch mode between periodic tick mode
  & dynamic tick mode
 •   The switch trigger is when to be scheduled
     sched_idletd

 •   This function only works when CPU is idle

 •   If the cpu is idle, the CPU has no need to know
     what current time is.

• Scan callout queue & get next event
2 tick mode transition
                        after sched_idletd is scheduled




                                                     time
    HZ HZ HZ            when next Timer is going to be fired




Periodic tick mode         Dynamic tick mode
  • The idle process( sched_idletd ) trigger the
    mode transition
2 tick mode transition
                        after sched_idletd is scheduled




                                                     time
    HZ HZ HZ            when next Timer is going to be fired




Periodic tick mode         Dynamic tick mode
  • The idle process( sched_idletd ) trigger the
    mode transition
2 tick mode transition
                        after sched_idletd is scheduled




                                                     time
    HZ HZ HZ            when next Timer is going to be fired




Periodic tick mode         Dynamic tick mode
  • The idle process( sched_idletd ) trigger the
    mode transition
2 tick mode transition
                        after sched_idletd is scheduled




                                                     time
    HZ HZ HZ            when next Timer is going to be fired




Periodic tick mode         Dynamic tick mode
  • The idle process( sched_idletd ) trigger the
    mode transition
2 tick mode transition
                        after sched_idletd is scheduled




                                                     time
    HZ HZ HZ            when next Timer is going to be fired




Periodic tick mode         Dynamic tick mode
  • The idle process( sched_idletd ) trigger the
    mode transition
2 tick mode transition
                        after sched_idletd is scheduled




                                                     time
    HZ HZ HZ            when next Timer is going to be fired




Periodic tick mode         Dynamic tick mode
  • The idle process( sched_idletd ) trigger the
    mode transition
Current status

• Started to write code 11th March,
  2010(JST)
• I implemented to scan callout queue
  The routine scan when the next timer
  event come up?
Demo
Wrapping up

• I started to implement tickless kernel in
  FreeBSD.
• As first step, I implemented the routine
  which detect when the next timer fire.
Acknowledgements
Thanks
• Alexander Mortin
• Hiroki Sato        for advising me !!

         Any idea or question?

Contenu connexe

Similaire à First step for dynticks in FreeBSD

Xen in Safety-Critical Systems - Critical Summit 2022
Xen in Safety-Critical Systems - Critical Summit 2022Xen in Safety-Critical Systems - Critical Summit 2022
Xen in Safety-Critical Systems - Critical Summit 2022Stefano Stabellini
 
AOS Lab 6: Scheduling
AOS Lab 6: SchedulingAOS Lab 6: Scheduling
AOS Lab 6: SchedulingZubair Nabi
 
Dead Lock Analysis of spin_lock() in Linux Kernel (english)
Dead Lock Analysis of spin_lock() in Linux Kernel (english)Dead Lock Analysis of spin_lock() in Linux Kernel (english)
Dead Lock Analysis of spin_lock() in Linux Kernel (english)Sneeker Yeh
 
Search at Twitter: Presented by Michael Busch, Twitter
Search at Twitter: Presented by Michael Busch, TwitterSearch at Twitter: Presented by Michael Busch, Twitter
Search at Twitter: Presented by Michael Busch, TwitterLucidworks
 
Concurrency 2010
Concurrency 2010Concurrency 2010
Concurrency 2010敬倫 林
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systemsleo3004
 
Multithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdfMultithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdfHarika Pudugosula
 
Super Fast Gevent Introduction
Super Fast Gevent IntroductionSuper Fast Gevent Introduction
Super Fast Gevent IntroductionWalter Liu
 
Post Exploitation Using Meterpreter
Post Exploitation Using MeterpreterPost Exploitation Using Meterpreter
Post Exploitation Using MeterpreterShubham Mittal
 
SMP implementation for OpenBSD/sgi
SMP implementation for OpenBSD/sgiSMP implementation for OpenBSD/sgi
SMP implementation for OpenBSD/sgiTakuya ASADA
 
Linx privx privileges-sudo misconfiguration group and docker daemon privileges
Linx privx privileges-sudo misconfiguration group and docker daemon privilegesLinx privx privileges-sudo misconfiguration group and docker daemon privileges
Linx privx privileges-sudo misconfiguration group and docker daemon privilegesAliBawazeEer
 
Multi core programming 2
Multi core programming 2Multi core programming 2
Multi core programming 2Robin Aggarwal
 
Scheduler activations
Scheduler activationsScheduler activations
Scheduler activationsVin Voro
 
Considerations when implementing_ha_in_dmf
Considerations when implementing_ha_in_dmfConsiderations when implementing_ha_in_dmf
Considerations when implementing_ha_in_dmfhik_lhz
 
Diagnosing Problems in Production - Cassandra
Diagnosing Problems in Production - CassandraDiagnosing Problems in Production - Cassandra
Diagnosing Problems in Production - CassandraJon Haddad
 
Taming Pythons with ZooKeeper (Pyconfi edition)
Taming Pythons with ZooKeeper (Pyconfi edition)Taming Pythons with ZooKeeper (Pyconfi edition)
Taming Pythons with ZooKeeper (Pyconfi edition)Jyrki Pulliainen
 
Cassandra and drivers
Cassandra and driversCassandra and drivers
Cassandra and driversBen Bromhead
 

Similaire à First step for dynticks in FreeBSD (20)

Xen in Safety-Critical Systems - Critical Summit 2022
Xen in Safety-Critical Systems - Critical Summit 2022Xen in Safety-Critical Systems - Critical Summit 2022
Xen in Safety-Critical Systems - Critical Summit 2022
 
AOS Lab 6: Scheduling
AOS Lab 6: SchedulingAOS Lab 6: Scheduling
AOS Lab 6: Scheduling
 
Dead Lock Analysis of spin_lock() in Linux Kernel (english)
Dead Lock Analysis of spin_lock() in Linux Kernel (english)Dead Lock Analysis of spin_lock() in Linux Kernel (english)
Dead Lock Analysis of spin_lock() in Linux Kernel (english)
 
Jvm memory model
Jvm memory modelJvm memory model
Jvm memory model
 
Search at Twitter: Presented by Michael Busch, Twitter
Search at Twitter: Presented by Michael Busch, TwitterSearch at Twitter: Presented by Michael Busch, Twitter
Search at Twitter: Presented by Michael Busch, Twitter
 
Concurrency 2010
Concurrency 2010Concurrency 2010
Concurrency 2010
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
FreeRTOS Slides annotations.pdf
FreeRTOS Slides annotations.pdfFreeRTOS Slides annotations.pdf
FreeRTOS Slides annotations.pdf
 
Multithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdfMultithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdf
 
Super Fast Gevent Introduction
Super Fast Gevent IntroductionSuper Fast Gevent Introduction
Super Fast Gevent Introduction
 
Post Exploitation Using Meterpreter
Post Exploitation Using MeterpreterPost Exploitation Using Meterpreter
Post Exploitation Using Meterpreter
 
SMP implementation for OpenBSD/sgi
SMP implementation for OpenBSD/sgiSMP implementation for OpenBSD/sgi
SMP implementation for OpenBSD/sgi
 
Linx privx privileges-sudo misconfiguration group and docker daemon privileges
Linx privx privileges-sudo misconfiguration group and docker daemon privilegesLinx privx privileges-sudo misconfiguration group and docker daemon privileges
Linx privx privileges-sudo misconfiguration group and docker daemon privileges
 
Multi core programming 2
Multi core programming 2Multi core programming 2
Multi core programming 2
 
Scheduler activations
Scheduler activationsScheduler activations
Scheduler activations
 
Considerations when implementing_ha_in_dmf
Considerations when implementing_ha_in_dmfConsiderations when implementing_ha_in_dmf
Considerations when implementing_ha_in_dmf
 
Diagnosing Problems in Production - Cassandra
Diagnosing Problems in Production - CassandraDiagnosing Problems in Production - Cassandra
Diagnosing Problems in Production - Cassandra
 
Lect07
Lect07Lect07
Lect07
 
Taming Pythons with ZooKeeper (Pyconfi edition)
Taming Pythons with ZooKeeper (Pyconfi edition)Taming Pythons with ZooKeeper (Pyconfi edition)
Taming Pythons with ZooKeeper (Pyconfi edition)
 
Cassandra and drivers
Cassandra and driversCassandra and drivers
Cassandra and drivers
 

Plus de Tsuyoshi OZAWA

YARN: a resource manager for analytic platform
YARN: a resource manager for analytic platformYARN: a resource manager for analytic platform
YARN: a resource manager for analytic platformTsuyoshi OZAWA
 
Dynamic Resource Allocation Spark on YARN
Dynamic Resource Allocation Spark on YARNDynamic Resource Allocation Spark on YARN
Dynamic Resource Allocation Spark on YARNTsuyoshi OZAWA
 
Taming YARN @ Hadoop Conference Japan 2014
Taming YARN @ Hadoop Conference Japan 2014Taming YARN @ Hadoop Conference Japan 2014
Taming YARN @ Hadoop Conference Japan 2014Tsuyoshi OZAWA
 
Taming YARN @ Hadoop conference Japan 2014
Taming YARN @ Hadoop conference Japan 2014Taming YARN @ Hadoop conference Japan 2014
Taming YARN @ Hadoop conference Japan 2014Tsuyoshi OZAWA
 
Multilevel aggregation for Hadoop/MapReduce
Multilevel aggregation for Hadoop/MapReduceMultilevel aggregation for Hadoop/MapReduce
Multilevel aggregation for Hadoop/MapReduceTsuyoshi OZAWA
 
Memcached as a Service for CloudFoundry
Memcached as a Service for CloudFoundryMemcached as a Service for CloudFoundry
Memcached as a Service for CloudFoundryTsuyoshi OZAWA
 
第二回Bitvisor読書会 前半 Intel-VT について
第二回Bitvisor読書会 前半 Intel-VT について第二回Bitvisor読書会 前半 Intel-VT について
第二回Bitvisor読書会 前半 Intel-VT についてTsuyoshi OZAWA
 
Linux KVM のコードを追いかけてみよう
Linux KVM のコードを追いかけてみようLinux KVM のコードを追いかけてみよう
Linux KVM のコードを追いかけてみようTsuyoshi OZAWA
 

Plus de Tsuyoshi OZAWA (12)

YARN: a resource manager for analytic platform
YARN: a resource manager for analytic platformYARN: a resource manager for analytic platform
YARN: a resource manager for analytic platform
 
Dynamic Resource Allocation Spark on YARN
Dynamic Resource Allocation Spark on YARNDynamic Resource Allocation Spark on YARN
Dynamic Resource Allocation Spark on YARN
 
Taming YARN @ Hadoop Conference Japan 2014
Taming YARN @ Hadoop Conference Japan 2014Taming YARN @ Hadoop Conference Japan 2014
Taming YARN @ Hadoop Conference Japan 2014
 
Taming YARN @ Hadoop conference Japan 2014
Taming YARN @ Hadoop conference Japan 2014Taming YARN @ Hadoop conference Japan 2014
Taming YARN @ Hadoop conference Japan 2014
 
Spark shark
Spark sharkSpark shark
Spark shark
 
Fluent logger-scala
Fluent logger-scalaFluent logger-scala
Fluent logger-scala
 
Multilevel aggregation for Hadoop/MapReduce
Multilevel aggregation for Hadoop/MapReduceMultilevel aggregation for Hadoop/MapReduce
Multilevel aggregation for Hadoop/MapReduce
 
Memcached as a Service for CloudFoundry
Memcached as a Service for CloudFoundryMemcached as a Service for CloudFoundry
Memcached as a Service for CloudFoundry
 
Memory Virtualization
Memory VirtualizationMemory Virtualization
Memory Virtualization
 
第二回Bitvisor読書会 前半 Intel-VT について
第二回Bitvisor読書会 前半 Intel-VT について第二回Bitvisor読書会 前半 Intel-VT について
第二回Bitvisor読書会 前半 Intel-VT について
 
第二回KVM読書会
第二回KVM読書会第二回KVM読書会
第二回KVM読書会
 
Linux KVM のコードを追いかけてみよう
Linux KVM のコードを追いかけてみようLinux KVM のコードを追いかけてみよう
Linux KVM のコードを追いかけてみよう
 

First step for dynticks in FreeBSD

  • 1. First step for dynticks in FreeBSD Tsuyoshi Ozawa Univ. of Tsukuba ozawa@softlab.cs.tsukuba.ac.jp ozawa@t-oza.net AsiaBSDcon March 14th, 2010 Work-In-Progress talk
  • 2. Ticks HZ HZ time • Timer interrupt is important processing to work kernel correctly • But it is very expensive to handle periodic ticks
  • 3. Ticks HZ HZ time • Timer interrupt is important processing to work kernel correctly • But it is very expensive to handle periodic ticks
  • 4. Ticks HZ HZ time • Timer interrupt is important processing to work kernel correctly • But it is very expensive to handle periodic ticks
  • 5. Ticks HZ HZ time • Timer interrupt is important processing to work kernel correctly • But it is very expensive to handle periodic ticks
  • 6. Dynticks time when next Timer is going to be fired • Timer interrupts are generated by using oneshot timer. • This feature is implemented in Solaris, Linux and etc.
  • 7. Dynticks time when next Timer is going to be fired • Timer interrupts are generated by using oneshot timer. • This feature is implemented in Solaris, Linux and etc.
  • 8. Dynticks time when next Timer is going to be fired • Timer interrupts are generated by using oneshot timer. • This feature is implemented in Solaris, Linux and etc.
  • 9. Dynticks time when next Timer is going to be fired • Timer interrupts are generated by using oneshot timer. • This feature is implemented in Solaris, Linux and etc.
  • 10. Benefits • If OSes can skip needless ticks... • Save power consumption • OS in Virtual Machine work more lightly (e.g. FreeBSD as guest OS) VMware, “Timekeeping in VMware Virtual Machines”, http:// www.vmware.com/pdf/vmware_timekeeping.pdf, 2008
  • 12. Rough Design • Switch mode between periodic tick mode & dynamic tick mode • The switch trigger is when to be scheduled sched_idletd • This function only works when CPU is idle • If the cpu is idle, the CPU has no need to know what current time is. • Scan callout queue & get next event
  • 13. 2 tick mode transition after sched_idletd is scheduled time HZ HZ HZ when next Timer is going to be fired Periodic tick mode Dynamic tick mode • The idle process( sched_idletd ) trigger the mode transition
  • 14. 2 tick mode transition after sched_idletd is scheduled time HZ HZ HZ when next Timer is going to be fired Periodic tick mode Dynamic tick mode • The idle process( sched_idletd ) trigger the mode transition
  • 15. 2 tick mode transition after sched_idletd is scheduled time HZ HZ HZ when next Timer is going to be fired Periodic tick mode Dynamic tick mode • The idle process( sched_idletd ) trigger the mode transition
  • 16. 2 tick mode transition after sched_idletd is scheduled time HZ HZ HZ when next Timer is going to be fired Periodic tick mode Dynamic tick mode • The idle process( sched_idletd ) trigger the mode transition
  • 17. 2 tick mode transition after sched_idletd is scheduled time HZ HZ HZ when next Timer is going to be fired Periodic tick mode Dynamic tick mode • The idle process( sched_idletd ) trigger the mode transition
  • 18. 2 tick mode transition after sched_idletd is scheduled time HZ HZ HZ when next Timer is going to be fired Periodic tick mode Dynamic tick mode • The idle process( sched_idletd ) trigger the mode transition
  • 19. Current status • Started to write code 11th March, 2010(JST) • I implemented to scan callout queue The routine scan when the next timer event come up?
  • 20. Demo
  • 21. Wrapping up • I started to implement tickless kernel in FreeBSD. • As first step, I implemented the routine which detect when the next timer fire.
  • 22. Acknowledgements Thanks • Alexander Mortin • Hiroki Sato for advising me !! Any idea or question?

Notes de l'éditeur