Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

First step for dynticks in FreeBSD

2,590 views

Published on

  • Be the first to comment

First step for dynticks in FreeBSD

  1. 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. 2. Ticks HZ HZ time • Timer interrupt is important processing to work kernel correctly • But it is very expensive to handle periodic ticks
  3. 3. Ticks HZ HZ time • Timer interrupt is important processing to work kernel correctly • But it is very expensive to handle periodic ticks
  4. 4. Ticks HZ HZ time • Timer interrupt is important processing to work kernel correctly • But it is very expensive to handle periodic ticks
  5. 5. Ticks HZ HZ time • Timer interrupt is important processing to work kernel correctly • But it is very expensive to handle periodic ticks
  6. 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. 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. 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. 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. 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
  11. 11. Suggestion • Dynamic Ticks in FreeBSD
  12. 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. 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. 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. 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. 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. 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. 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. 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. 20. Demo
  21. 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. 22. Acknowledgements Thanks • Alexander Mortin • Hiroki Sato for advising me !! Any idea or question?

×