A farewell to set_fs()?
A farewell to set_fs()?
Posted Jun 9, 2017 14:43 UTC (Fri) by mkbosmans (subscriber, #65556)In reply to: A farewell to set_fs()? by fratti
Parent article: A farewell to set_fs()?
Assuming:
- 2e9 computers, phones, etc. on the world run Linux
- They are active 10% of the time
- On average they run 3e9 instructions / second
- When active, there are 1e4 syscalls / second
- When active, 30 W of power is used
Then:
- 5 instructions of overhead for each syscall results in a 5 * 1e4 / 3e9 * 30 = 0.5 mW extra power when a computer is active.
- Globally, this means an increased power usage of 0.5mW * 10% * 2e9 = 100 kW
- On a yearly basis, this amounts to 876000 kWh, which equals to about 700 tons of carbon emissions.
According to [1], the smallest countries, like Tuvalu, emit 3000 tons per year. So, although not quite there, it is reasonably close.
Posted Jun 9, 2017 23:12 UTC (Fri)
by cjr (guest, #88606)
[Link] (1 responses)
All the information I could find in a quick search is a bit outdated, but here it is anyways:
This paper has some analysis of mobile phone power consumption:
This article from Qualcomm (2013) has some stats based on the above article:
This article (behind an obtrusive advertisement FYI) says it takes ~1kWh per year to run a mobile phone:
Chris
Posted Jun 10, 2017 16:09 UTC (Sat)
by mkbosmans (subscriber, #65556)
[Link]
So the number of desktops, laptops and servers (i.e. computers with a 30W or greater power usage) combined will probably be more than 2 billion right now. Of course not all of them run Linux.
There have been sold 1.6 billion android phones to date [2]. Excluding discarded phones and including routers and other embedded devices brings the total of active low-power Linux devices probably also in the range of 1-2 billion.
Anyway, this whole exercise was more to see whether the power savings could even close to the power consumption of a small country. Even if a lot of guesses are wrong, I don't think I'm more than a factor 1000x off.
[1] http://www.reuters.com/article/us-computers-statistics-id...
Posted Jun 9, 2017 23:37 UTC (Fri)
by cjr (guest, #88606)
[Link] (1 responses)
Assuming the 30W power consumption was correct, are you sure you have the math right? I get the following:
Note .05mW rather than .5mW:
After going through this exercise, I also found that I was surprised if even an average desktop CPU would consume .05mW to execute 5000 instructions. So I looked on Wikipedia [1] to find a Core-i7 940XM, which uses 55W at 2.13GHz. 5000 instructions in that case would take ~.129mW, which means indeed it can take more power than I thought to execute those 5000 instructions. But even if all those 2e9 devices were running that hungry Core-i7, they would still be consuming roughly 4x less power than the original figures.
Thanks for provoking an interesting discussion anyways. Also please correct me if I have gotten anything wrong above.
[1] https://en.wikipedia.org/wiki/List_of_CPU_power_dissipati...
Chris
Posted Jun 10, 2017 16:13 UTC (Sat)
by mkbosmans (subscriber, #65556)
[Link]
Of course this is a really high estimate, because even when a user is actively using his computer, the average number of syscalls/second will be much lower.
Another big simplification is 1 instruction == 1 cycle. That can certainly be more or less, depending on the specific instructions and other context. But again, this whole exercise was meant as a https://en.wikipedia.org/wiki/Fermi_problem.
A farewell to set_fs()?
https://www.usenix.org/legacy/event/atc10/tech/full_paper...
https://developer.qualcomm.com/blog/mobile-apps-and-power...
https://www.forbes.com/sites/christopherhelman/2013/09/07...
A farewell to set_fs()?
[2] http://www.statisticbrain.com/android-phone-statistics/
A farewell to set_fs()?
5 * 1e4 / 3e9 * 30 = 0.00005 = 0.05 mW
0.05mW * 10% * 2e9 = 10 kW
10kW * 24 * 365 = 87600 kWh
A farewell to set_fs()?
I did this by firing up a browser under strace and looking up a website. That was 45.000 syscalls in 5.5 seconds.