Bogomips in /proc/cpuinfo refers to a calculated estimate of the CPU's processing speed, used by the Linux kernel for internal timing and calibration purposes. Here's a detailed breakdown:
Key Points:
Etymology:
"Bogo" is short for "bogus" (fake/placeholder), and MIPS stands for Millions of Instructions Per Second.
The term was humorously coined by Linus Torvalds to emphasize that it is not a true measure of actual CPU performance.
Purpose:
Kernel Timing Calibration: The Linux kernel uses Bogomips to calibrate its internal system timer during boot. This ensures accurate timing for processes and interrupts, regardless of the CPU's actual clock speed.
Legacy Metric: It provides a consistent value for the kernel to reference, especially in older systems.
Calculation:
During boot, the kernel runs a fixed loop of instructions and measures the time taken to execute it.
The formula used is: Bogomips = (Number of loops × 2) / (Time taken in seconds).
This results in a value (in millions of loops per second) that is loosely proportional to the CPU's clock speed.
Limitations:
Not a Real MIPS Measurement: It does not reflect actual instruction throughput or real-world performance. Different CPUs (even with the same Bogomips value) may perform differently in practice.
Architecture-Dependent: The loop is optimized for the CPU's architecture, so values aren’t comparable across different CPU types (e.g., ARM vs. x86).
Static Value: It is measured once at boot and doesn’t account for dynamic changes like CPU frequency scaling (e.g., in laptops with power-saving modes).
Modern Relevance:
Phasing Out: Many newer Linux kernels (post-4.0) no longer display Bogomips in /proc/cpuinfo due to advancements in CPU frequency management and better timing mechanisms.
Legacy Use: It remains present in some systems for backward compatibility or debugging purposes.
Example:
A CPU with Bogomips: 4000.00 indicates the kernel’s loop test estimated the CPU’s speed as ~4,000 million loops per second. This is not equivalent to 4,000 MIPS in real-world terms.
When to Use It:
Not for Performance Benchmarking: Avoid using Bogomips to compare CPU performance between systems.
Kernel Debugging: It can help identify issues related to clock speed or timing during kernel initialization.
Summary:
Bogomips is an internal, humorous, and outdated metric used by the Linux kernel to gauge CPU speed for timing purposes. While historically useful, it has limited practical value today and should not be confused with real performance metrics like actual MIPS, GHz, or benchmarks.