# /proc/cpuinfo

## midnite

i would like to ask if /proc/cpuinfo updates dynamically?

i bet not, but why not?

----------

## CrankyPenguin

The proc filesystem in general does not hold files.  All of the contents of proc are dynamically generated by the system, much like the contents of sys.  This is part of the "everything is a file" metaphor that Eric S. Raymond writes about (http://www.catb.org/~esr/writings/taoup/).  So, in general yes it is "dynamically generated" in that it is produced by the OS at runtime.  However it is not "dynamically generated" in that it changes much as your physical CPU does not, usually, change once the system has started, unless you run BeOS.

----------

## midnite

i see.... thanks!

but i used watch --differences=cumulative cat /proc/cpuinfo to examine it for a prologned period. it really does not change. i know my CPU does not have a step-hopping feature. But will those CPU's cpuinfo change? And also, for my cpu MHz : 1496.248, it is precise to a Hz. i found that this reading will be a bit different everytime i boot it up. But it will not change after boot. Is it because the hardware keep on giving the initial reading to the OS?

----------

## doctork

The "cpu MHz" fiield my change if you depending on the frequency governor being used.  For example on my AMD Phenom system, when running the "ondemand" governor I see:

```
fino ~ # grep MHz /proc/cpuinfo

cpu MHz         : 1100.000

cpu MHz         : 1100.000

cpu MHz         : 1100.000

cpu MHz         : 1100.000

```

And when running the "performance" governor I see:

```
fino ~ # grep MHz /proc/cpuinfo

cpu MHz         : 2200.000

cpu MHz         : 2200.000

cpu MHz         : 2200.000

cpu MHz         : 2200.000

```

--

doc

----------

## poly_poly-man

 *midnite wrote:*   

> i see.... thanks!
> 
> but i used watch --differences=cumulative cat /proc/cpuinfo to examine it for a prologned period. it really does not change. i know my CPU does not have a step-hopping feature. But will those CPU's cpuinfo change? And also, for my cpu MHz : 1496.248, it is precise to a Hz. i found that this reading will be a bit different everytime i boot it up. But it will not change after boot. Is it because the hardware keep on giving the initial reading to the OS?

 either it's only programmed to provide new values on cpufreq changes, or your hardware got fixed at that frequency (at least relative to what's measuring it).

the stuff in /proc is dynamically generated, so to speak... as you access it (read, write), it directly calls kernel functions relevant... so, when you read /proc/cpuinfo, it's calling all those functions to check the speeds, capabilities, etc.

----------

