File:  [NetBSD Developer Wiki] / wikisrc / projects / project / tickless.mdwn
Revision 1.6: download - view: text, annotated - select for diffs
Tue Mar 1 10:38:49 2022 UTC (5 months, 2 weeks ago) by martin
Branches: MAIN
CVS tags: HEAD
Adapt open gsoc project suggestion to new gsoc rules, mark as 175/350h

    1: [[!template id=project
    3: title="Tickless NetBSD with high-resolution timers (350h)"
    5: contact="""
    6: [tech-kern](
    7: """
    9: mentors="""
   10: [Taylor R Campbell](
   11: """
   13: category="kernel"
   14: difficulty="hard"
   15: duration="350h"
   17: description="""
   18: NetBSD configures a timer device to deliver a periodic timer interrupt,
   19:  usually every 10 ms, in order to count time, wake threads that are
   20:  sleeping, etc.
   21: This made sense when timer devices were expensive to program and CPUs
   22:  ran at MHz.
   23: But today, CPUs run at GHz; timers on modern x86, arm, mips,
   24:  etc. hardware are cheap to reprogram; programs expect greater than
   25:  10 ms resolution for sleep times; and mandatory periodic activity on
   26:  idle machines wastes power.
   28: There are four main milestones to this project:
   30: 1. Choose a data structure for high-resolution timers, and a way to
   31:  request high-resolution vs low-resolution sleeps, and adapt the
   32:  various timeout functions (`cv_timedwait`, etc.) to use it.
   33: The current call wheel data structure for callouts provides good
   34:  performance, but only for low-resolution sleeps.
   35: We need another data structure that provides good performance for
   36:  high-resolution sleeps without hurting the performance of the existing
   37:  call wheel for existing applications.
   39: 2. Design a machine-independent high-resolution timer device API,
   40:  implement it on a couple machines, and develop tests to confirm that
   41:  it works.
   42: This might be done by adapting the `struct timecounter` interface to
   43:  arm it for an interrupt, or might be done another way.
   45: 3. Convert all the functions of the periodic 10 ms timer, `hardclock`,
   46:  to schedule activity only when needed.
   48: 4. Convert the various software subsystems that rely on periodic timer
   49:  interrupts every tick, or every second, via
   50:  [[!template id=man name="callout" section="9"]],
   51:  either to avoid periodic work altogether, or to batch it up only when
   52:  the machine is about to go idle, in order to reduce the number of
   53:  wakeups and thereby reduce power consumption.
   54: """
   55: ]]
   57: [[!tag gsoc]]
   58: [[!tag gsoc350h]]

CVSweb for NetBSD wikisrc <> software: FreeBSD-CVSweb