KernelNewbies
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Kernel Hacking

  • Frontpage

  • Kernel Hacking

  • Kernel Documentation

  • Kernel Glossary

  • FAQ

  • Found a bug?

  • Kernel Changelog

  • Upstream Merge Guide

Projects

  • KernelJanitors

  • KernelMentors

  • KernelProjects

Community

  • Why a community?

  • Regional Kernelnewbies

  • Personal Pages

  • Upcoming Events

References

  • Mailing Lists

  • Related Sites

  • Programming Links

Wiki

  • Recent Changes

  • Site Editors

  • Side Bar

  • Tips for Editors

  • Hosted by WikiWall

Navigation

  • RecentChanges
  • FindPage
  • HelpContents

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

Revision 2 as of 2017-12-30 01:30:11
KernelNewbies:
  • FAQ
  • FastpathAndSlowpath

What is the difference between terms: "Slow path" and "Fast path" ?

In general, "fast path" is the commonly run code that should finish very quickly. For example, when it comes to spinlocks the fast path is that nobody is holding the spinlock and the CPU that wants it can just take it.

Conversely, the slow path for spinlocks is that the lock is already taken by somebody else and the CPU will have to wait for the lock to be freed.

The first case is the common one that should be optimized.

The second one is not as important and does not need to be optimized much at all.

In this example, the reason for not optimizing the spinlock code for dealing with lock contention is that locks should not be contended. If they are, we need to redesign the data structures or the code to avoid contention in the first place!

You will see similar tradeoffs in the page locking code, the scheduler code (common cases are fast, unlikely things are put out of line by the compiler and are "behind a jump") and many other places in the kernel.

  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01