# Environmentalist



## andoluca (Sep 16, 2020)

what could be done to reduce energy consumption, data usage in bsd?

Because the "very computationally expensive" = data = energy = CO2 

I'm already preparing another post for this purpose: "vanilla FreeBSD"


----------



## Alain De Vos (Sep 16, 2020)

Data is not energy.Data on a non spinning hard disk does not use energy even if its terrabytes large.
And your LCD screen might consume a lot more ...,








						Chapter 13. Configuration and Tuning
					

This chapter explains much of the FreeBSD configuration process, including some of the parameters which can be set to tune a FreeBSD system.




					www.freebsd.org


----------



## George (Sep 16, 2020)

Arm based CPUs need less energy. Unplug or power down hardware components that you don't need. Turn off your pc.


----------



## kpedersen (Sep 16, 2020)

There are a number of power saving techniques you can use.





__





						TuningPowerConsumption - FreeBSD Wiki
					





					wiki.freebsd.org
				




For a laptop, the best I know is replace your existing one with one with a much smaller screen XD


----------



## ekvz (Sep 16, 2020)

Hunting bears by throwing stones at them does only use the energy of the berries you ate to accumulate the strength to pick up said stones.

Edit: OK, i feel somewhat bad about the sarcasm but seriously: Using less (or at least more power efficient - captain obvious strikes again, i know...) technology is likely your best bet if you want to save energy. Besides you can't really equal energy to CO2 unless all your energy is generated by coal plants or something like that.


----------



## kpedersen (Sep 16, 2020)

For a while I was told that me reusing my old stuff was actually less energy efficient than disposing of it and buying new (i.e more efficient hardware. etc).

However it turns out that my old kit would just be shipped off to other countries and they would end up using the inefficient hardware instead. Sure their electricity costs are likely lower but cheap costs doesn't mean less coal is being burned.

Its a hard one because the "best" solution for the environment is very weak thin clients connecting to a large central server farm where efficiency due to large numbers can be attained. However... I refuse to do that until those server farms are not run by criminals .

My solution is to ship off all my old shite to my cousins living in Danmark where a higher percentage of energy is from wind power. Yes, they keep asking me not to and telling me they don't want any more of my old crap... But I just ignore them. Saving the planet is all about making a compromise! XD


----------



## ekvz (Sep 16, 2020)

kpedersen said:


> For a while I was told that me reusing my old stuff was actually less energy efficient than disposing of it and buying new (i.e more efficient hardware. etc).



Usually that's really the case but from what i remember when looking into the energy consumption of some of my vintage devices the really old (like P2 and older old) stuff sometimes wasn't even that bad. Sure the the energy/computation power ratio is still abysmal but if they do the job it actually seemed to be way way better than letting some P4 run idle for 90%.



kpedersen said:


> However it turns out that my old kit would just be shipped off to other countries and they would end up using the inefficient hardware instead. Sure their electricity costs are likely lower but cheap costs doesn't mean less coal is being burned.



Exactly. The whole thing is way more complex than what's obvious on first glance. It's just not as simple as we-all-make-sure-to-turn-off-the-light and the overall conditions suddenly start improving. It's somewhat sad but actually most of us could seriously go back to hunting bears with stones and pollution levels would still be rising because we are really just a tiny dent in the global scale.



kpedersen said:


> Its a hard one because the "best" solution for the environment is very weak thin clients connecting to a large central server farm where efficiency due to large numbers can be attained. However... I refuse to do that until those server farms are not run by criminals .



This. Very much this.



kpedersen said:


> My solution is to ship off all my old shite to my cousins living in Danmark where a higher percentage of energy is from wind power. Yes, they keep asking me not to and telling me they don't want any more of my old crap... But I just ignore them. Saving the planet is all about making a compromise! XD



Seems reasonable. Some European/Scandinavian countries seem to be really big into green energy so why not put it to use? Those reduction efforts are paid for a good part by people that might not be in the best position to pay anyways. I think letting them have something in return at least is only fair 

Edit One more mostly obvious thing that hasn't been mentioned yet is how SSDs use less power than old fashioned rust spinners. I guess getting a shiny new SSD (to fight pollution of course!) is something noone is going to complain about. I wonder if it really pays off in the long run though. I don't know if the (i think?) lower life expectation of SSDs and the materials they are made from might not sooner or later outperform the energy saved on operating them.


----------



## kpedersen (Sep 16, 2020)

ekvz said:


> I think letting them have something in return at least is only fair



Heh exactly. They keep the world green and in return I keep their house full with technological history. I keep telling them this but sometimes I feel they are being unreasonable XD


----------



## phalange (Sep 16, 2020)

For sure there's a trade-off in buying new and presumably more efficient hardware and the reality that most cast-off hardware goes to a landfill. My guess is

(1) sane power settings
(2) with a desktop, replace just the power supply with one more efficient
(3) shut it off when you're not using it

I think getting the screen off will save vastly more power than tweaks to the OS, but perhaps others have more insight into it.


----------



## ralphbsz (Sep 16, 2020)

kpedersen said:


> Its a hard one because the "best" solution for the environment is very weak thin clients connecting to a large central server farm where efficiency due to large numbers can be attained.


For computation and storage/IO, that is the correct answer. That's because both the CPUs and disk drives in very large server farms are more efficient. Why? Two reasons. By sharing many workloads, they are kept continuously busy, so they don't have the power inefficiency of being idle. Second: for amateurishly built servers and individual desktop clients, about half the energy is wasted for cooling and power consumption (for every Watt that CPU or disk uses, you need nearly a second Watt to remove the heat, or to convert the power from the wall outlet into the various DC voltages the chips and disk use. In contrast, the big data centers typically have that overhead at 10-20%, so they are nearly twice as power efficient (1.2 compared to 2). Cooling and power conversion is a giant science, with research conferences, magazines (I get "electronics cooling" in the mail), and the big cloud companies have literally staff of hundreds working on optimizing that.

The other thing to do is to use an energy-efficient desktop machine. For laptops, that's actually pretty easy to measure: Given the same battery capacity (which is usually given pretty much by physical size of the case), use the one that has the longest battery life. The best way to reduce the power consumption of a laptop is to make all engineering decisions in a coordinated fashion. So use a laptop where hardware, OS and user-level software have all been designed by a single company, with the goal if increasing battery life. Don't piece together components from different sources.


----------



## Mjölnir (Sep 16, 2020)

andoluca said:


> what could be done to reduce energy consumption, data usage in bsd? [...]


I use the wisdom from the wiki, dpms(4) (`ServerArguments=dpms -nolisten tcp` in sddm.conf(5)) & aggressive settings for powerd(8): `sysrc powerd_flags="-a adp -n adp -i 70 -r 95"` to scale the frequency down quickly, although I learned that the C-states switching saves much more energy than frequency scaling (`sysrc economy_cx_lowest="Cmax"`, same for `performance_cx_lowest`).  Also note sysutils/gstopd & suspend to disk aka hibernation; when reasonable, I suspend my laptop, then after another 15 minutes it suspends to disk.


kpedersen said:


> [...]  Its a hard one because the "best" solution for the environment is very weak thin clients connecting to a large central server farm where efficiency due to large numbers can be attained. However... I refuse to do that until those server farms are not run by criminals ￼.


Well, you're doing already: whenever you use the internet... IIRC the vast majority of energy consumption of computers is through network equipment & internet server farms/plants.  Compared to today's servers, even advanced gamer PCs are thin clients.  Yesterday, a friend told me he's configuring a server with 3 TB of RAM...   (not in the whole rack, but in a single 2" enclosure).  Just try to guess how much energy a simple search via one of the usual internet search engines consumes.


kpedersen said:


> My solution is to ship off all my old shite to my cousins living in Danmark where a higher percentage of energy is from wind power. Yes, they keep asking me not to and telling me they don't want any more of my old crap... But I just ignore them. Saving the planet is all about making a compromise! XD


It's not gentleman-like to ignore your cousin's wish...  + the energy used by shipment...  Their local garbage disposal service should charge you a fee.  Please keep in mind that electronic waste is hazardous waste.  You'd better donate it to a local computer recycle/reuse organisation or company.


----------



## Crivens (Sep 16, 2020)

Does suspend-to-disk work for you? How??


----------



## sidetone (Sep 16, 2020)

It seems an SSD harddisk for root and custom non-user partitions/directories uses way less power than a traditional harddisk. /, /var and /usr are used often. Using a traditional harddisk for home and /usr/local has negligible consequence.

I realize then, that my old hardisk may have been bad. It always shut down my computer, even after I heard a car go by, or heard a vacuum cleaner nearby be turned on. The vacuum and computer using up a lot of power tripping the circuit breaker makes sense. The car going by, maybe a coincidence, as if electrical interference, caused something that was either faulty or power intense to make my computer lose power and reboot.

Another one is to get a motherboard of the most efficient family with its CPU's when the old motherboard goes bad. If the CPU on an older motherboard is 32 bit, upgrade that to a compatible 64 bit on that same board. AMD's IIRC Ryzen is more powerful and less power consuming than previous Intels and other AMD hardware. Previous AMDs were less efficient than Intels. I don't know if Intel has recently surpassed AMD. Make that motherboard last, by cleaning out dust, and upgrade the CPU as needed.

Using dual RAM in the correct slots, to make use of maximum bus width.

Using RAM filesystems for building ports and the kernel. Using that with harddisk space to make up for anything that potentially surpasses available RAM.

Another thing, is removing bloat that usually comes with ports that are based on Linuxisms. A lot of that has been done, but it gets more difficult to find as time goes on.

Then, I kept having to rebuild ports, and the build process broke down after over 14 HOURS for ports that needed GCC. Eventually, I made a temporary Makefile, saving the original, to make this port use LLVM/CLANG instead of GCC. This and other ports that needed GCC at that time built in 5 MINUTES without error by changing the dependency to the compiler in base. For comparison, LLVM/CLANG takes 4 hours to build. For GCC, it was pulling in operating systems of dependencies, like ALSA, every single sound system, graphics system. I mentioned this to the port maintainers, and they fixed GCC to compile in a reasonable amount of time. Linuxisms are a colossal waste of time and energy. There's still a similar flaw today in Ports that use GECKO to rebuild the latest LLVM/CLANG, even when there's no vulnerabilities. All it needs for a few ports needing GECKO and for video drivers is the build utils to be upgraded, not the entire LLVM/CLANG.

Custom building a kernel is another one, but probably minor. Rebuilding the world isn't necessary, which is more trouble than it's worth.


----------



## kpedersen (Sep 16, 2020)

ralphbsz said:


> So use a laptop where hardware, OS and user-level software have all been designed by a single company, with the goal if increasing battery life.



I highly recommend Apple for that. They will make sure to run your CPU at an artificially low clock for free 

https://arstechnica.com/tech-policy...phone-settlement-will-give-you-a-whopping-25/

You are right though. I do sometimes cringe at some gaming machines with a mish mash of randomly sourced parts. Though I guess those enthusiasts almost get a kick out of using up as much energy as possible. The more neon lights the better!



mjollnir said:


> You'd better donate it to a local computer recycle/reuse organisation or company.


As mentioned I don't trust they will dispose of it. They will end up selling it to some guy in a foreign country where he will use it and consume the same amount of energy as if I just kept using it myself .
I suppose I could purposely smash the components but I never have been one to enjoy dismantling LEGO. Every bone in my body just wants to keep on finding a use for it, even if that apparently is wasteful.


----------



## Mjölnir (Sep 16, 2020)

Crivens said:


> Does suspend-to-disk work for you? How??


Like I documented in the howto mentioned above.  I manually suspend to RAM (`zzz` or via GUI), wait 15 minutes (UEFI/BIOS knob [0min...1h?]), then it suspends to disk via UEFI/BIOS methods (no OS involved).  On battery, suspend is configured to happen automagically


----------



## Mjölnir (Sep 16, 2020)

kpedersen said:


> As mentioned I don't trust they will dispose of it. They will end up selling it to some guy in a foreign country where he will use it and consume the same amount of energy as if I just kept using it myself .
> I suppose I could purposely smash the components but I never have been one to enjoy dismantling LEGO. Every bone in my body just wants to keep on finding a use for it, even if that apparently is wasteful.


If it's not too old, usually they will refurbish it (or tinker 4 from 5 old) & sell it in a country where they can get the best price.  E.g. ReUse-Computer.org (german).  IIRC, it is forbidden to send non-working electronic hardware outside of  the EU; it must be declared as _electronic waste_ and then strict rules apply. But I don't believe that is monitored/controled; our old stuff still goes to western Africa to let the modern slaves recycle the copper, gold, rare earth elements etc.


----------



## olli@ (Sep 16, 2020)

FreeBSD users already save power, compared to Linux users. At least this has been my observation:

Most of the Linux users that I know have configured some cool 3D screen saver (probably x11/xlockmore with OpenGL modes) that don’t really “save” the screen. Conversely, most FreeBSD users (including myself) seem to prefer to use the DPMS screen saver that switches the screen off after <n> minutes of inactivity. I think this is even the Xorg default setting.

I have no idea why.


----------



## ekvz (Sep 16, 2020)

mjollnir said:


> If it's not too old, usually they will refurbish it (or tinker 4 from 5 old) & sell it in a country where they can get the best price.  E.g. ReUse-Computer.org (german).  IIRC, it is forbidden to send non-working electronic hardware outside of  the EU; it must be declared as _electronic waste_ and then strict rules apply. But I don't believe that is monitored/controled; our old stuff still goes to western Africa to let the modern slaves recycle the copper, gold, rare earth elements etc.



Yes, i also think controls on the waste exports are probably rather lax. It would be naive to think that not at least a part of those huge piles of electronics garbage came from Europe. Shipping the waste to Africa instead of recycling/dumping locally is just a way to lucrative business to be stopped by some law saying "that's bad; don't do it" unless there is a lot of enforcement behind it.



olli@ said:


> I think this is even the Xorg default setting.



It is. I am to lazy to configure anything and DPMS always works.


----------



## Mjölnir (Sep 16, 2020)

olli@ said:


> [...]  Conversely, most FreeBSD users (including myself) seem to prefer to use the DPMS screen saver that switches the screen off after <n> minutes of inactivity. I think this is even the Xorg default setting.  I have no idea why.


Maybe, but it does not work without the kernel module: `grep -i dpms /var/log/Xorg.0.log{,.old} | less`

```
/var/log/Xorg.0.log:[    39.466] (II) intel(0): No DPMS capabilities specified
/var/log/Xorg.0.log:[    39.639] (**) intel(0): DPMS enabled
/var/log/Xorg.0.log:[    39.688] (II) Initializing extension DPMS
```
And nothing in Xorg.0.log.old, when I did not have the dpms(4) kernel module loaded explicitely via `sysrc kld_list+=" dpms"`


----------



## drhowarddrfine (Sep 17, 2020)

As an individual user on a laptop, you are not using enough power to make a dent in the universe. The article states a laptop at full speed is using around 40W of power. A 20% decrease in that is 8Watts and I'm betting you couldn't achieve that without sacrifice.


----------



## ralphbsz (Sep 17, 2020)

Bingo. Doing things like turning the screen saver off or recompiling the kernel or removing "Linux bloat" will make exactly no difference in practice. If one spent the time that's needed for that simply standing up and turning one light off, it would save more energy.

I also have a real problem with the term "Linux bloat". What OS are all the big servers running? Linux. That applies to most commercial computing (where Windows has a minor market share among servers), 100% to supercomputers, and to the big internet companies (the FAANG). Those people are very fastidious about reducing energy usage, in particular supercomputers (where energy usage and cooling is now limiting how much computing can get done), and the big internet companies (for whom energy is a huge cost factor, perhaps the single biggest one). If you think that Linux means bloat means waste of energy, that makes no sense, given that the people who really study and care about energy usage of computers mostly use Linux.

One thing I find disturbing about this forum is the number of religious extremists, who seem to be mostly spouting nonsensical statements that reflect their irrational hatred for other OSes. Not a good basis for making technical decisions on.


----------



## phalange (Sep 17, 2020)

drhowarddrfine said:


> As an individual user on a laptop, you are not using enough power to make a dent in the universe. The article states a laptop at full speed is using around 40W of power. A 20% decrease in that is 8Watts and I'm betting you couldn't achieve that without sacrifice.



That's true but collectively such tweaks can add up. 200 million laptops shipped in 2020; shave even 1% power off all of them and you've got measurable results.
And who knows, maybe in 2021 FreeBSD will hit 200 million users?


----------



## shkhln (Sep 17, 2020)

ralphbsz said:


> One thing I find disturbing about this forum is the number of religious extremists, who seem to be mostly spouting nonsensical statements that reflect their irrational hatred for other OSes.



Are you implying there are places devoid of the usual circlejerk? On the Internet? With normal people?



ralphbsz said:


> Not a good basis for making technical decisions on.



Indeed. That's why this is a decision-free forum


----------



## 20-100-2fe (Sep 17, 2020)

ralphbsz said:


> One thing I find disturbing about this forum is the number of religious extremists, who seem to be mostly spouting nonsensical statements that reflect their irrational hatred for other OSes. Not a good basis for making technical decisions on.



Not only on this forum.
The "FreeBSD community" appears to be a gang of old friends who just don't want their habits to be disturbed and use most of their energy to explain newcomers how wrong they are.
That's what made me give up using FreeBSD: with such a mindset, hope is not permitted for FreeBSD to evolve in a sensible way.


----------



## hruodr (Sep 17, 2020)

I built my desktop with pieces that I carefully selected to turn down the consume, the heat, the
need of ventilators and the noise.

Of course the CPU and motherboard plays a big role, but also the power supply plays a big role.
I use in the desktop laptops 2.5'' discs, but for backups 3,5''.

Of course, other solution is to use water cooling and do not care on consume.


----------



## hruodr (Sep 17, 2020)

20-100-2fe said:


> Not only on this forum.
> The "FreeBSD community" appears to be a gang of old friends who just don't want their habits to be disturbed and use most of their energy to explain newcomers how wrong they are.



Not only in this forum, but not restricted to FreeBSD.

You speak about "FreeBSD community", judges it, but forget that users of FreeBSD are persons.

And yes, there is a lot of fanatical people. Fanaticism toward Operating System, Religion, Politics,
Football Team, etc. They need a "community" as their identity, because perhaps they are 
all identical (to the absolute nothing).


----------



## sidetone (Sep 17, 2020)

Anyone who's ever compiled anything. Will know, that then, whenever GCC or a newer version of this was pulled in as a dependency, even if 1 codec wanted it, it pulled in all kinds of unneeded stuff. GCC wasn't the only one that did this.

If you haven't compiled anything prior to FreeBSD 10, then you wouldn't know this, and think it's an exaggeration. And if you don't know this, either you were unaware, or never compiled anything, just went with packages. Actually it was over 14 hours, and using an x486, to an x586, to a 64bit prcessor made little difference in compiling times. Anyone whose started compiling it, then left for work, school, sleep, outdoors, would know they returned many times, and it was still compiling 14 hours later. Then, I compiled on Linux, it was also the same for FreeBSD, until that bloat got recognized. I don't forget that, leaving a computer for a long time, and tell people I spent that whole day installing a program.

On FreeBSD, when I say 14 hours, that's often until the build crashed. Necessity brought up the issue that, if 1 dependency can be switched out for one in base, to try that, and see if it finishes compiling without error. Sure, getting a successful install with a replacement compiler, doesn't mean it works completely, but it proves, that there's less for them to fix, and troubleshooting ALSA, Pulse audio, Potterisms and everything else under the sun. This got fixed soon after.

That's plain stupid. There were different Linux distributions, that said this was required, to build their system, and it because a tangled mismash, that wanted many different audio architectures, many different graphics systems, a graphics dependency would pull in an audio dependency, then back and forth.

Now GCC has a reasonable compile time, because they noticed why is it pulling in dependencies required by 4 different operating systems.

Depending on the port, it would compile anywhere from 15 seconds, to 15 minutes, to 2 hours to 4 hours to 8 hours. Previously, it was that, plus another >14 hours. As for GCC's binutils vs other utils, GCC's binutils actually are more capable of compiling more programs.

14 hours where the computer overheats and crashes, or the CPU makes noises doesn't waste energy, and time, where people could be learning  about the program they installed, instead of wondering how to make installs simple and install options reproducible? I used to see on the donations page, how people would ask for hardware to compile ports. Simply, getting rid of that ridiculous bloat will negate much of their needs for newer hardware to compile.

FreeBSD is a little bit guilty of that, but it didn't cause that problem. It was able to be found because of FreeBSD.

It's also not all of Linux, it's components of it, that keep unnecessarily complicating things back up at every opportunity.

"I don't care" because I use packages. "It sounds made up" but I wouldn't know because I only have used packages. Even when packages were compiled under the improvements, did they run more smoothly. Some poor guy in Central Europe needed a super computer to compile ports regularly to have packages available for everyone to use.


----------



## olli@ (Sep 17, 2020)

mjollnir said:


> Maybe, but it does not work without the kernel module: `grep -i dpms /var/log/Xorg.0.log{,.old} | less`
> 
> ```
> /var/log/Xorg.0.log:[    39.466] (II) intel(0): No DPMS capabilities specified
> ...


 
It _does_ work without that kernel module. Proof:

```
[  9060.872] (**) NVIDIA(0): DPMS enabled
[  9060.878] (II) Initializing extension DPMS
```
I do _not_ have the dpms(4) module loaded. The DPMS support is implemented by the respective Xorg driver (in my case that’s the nvidia module). The dpms(4) driver is _only_ required for putting the screen into standby via the VESA BIOS when suspending the machine, and this only works if VESA support is present (my machine does _not_ support VESA, so the dpms(4) module would not work anyway).

Just to be sure, I tried loading and unloading the dpms(4) module, and it didn’t make any difference whatsoever (I also get an error message in dmesg saying that VESA is not supported). The screen saver works fine without it. I don’t use suspend/resume on my workstation, though. By the way, I’ve got a UWQHD monitor that is rated 70 W (typ.), and in standby mode it goes down to 0.5 W. That’s quite a difference.

One final note: It was _not_ my intention to bash Linux or anything, or call Linux “bloated” (I think that word is inappropriate). I’m using Linux myself for certain things, although my OS of choice is FreeBSD. What I described in my previous post was just what I observed, no more and no less. And of course, my observations are not representative.


----------



## ekvz (Sep 17, 2020)

20-100-2fe said:


> Not only on this forum.
> The "FreeBSD community" appears to be a gang of old friends who just don't want their habits to be disturbed and use most of their energy to explain newcomers how wrong they are.
> That's what made me give up using FreeBSD: with such a mindset, hope is not permitted for FreeBSD to evolve in a sensible way.



I originally wrote a lengthy post here but i'll try to keep it short for once: I know what you mean. There sometimes are quite noticeable undertones of elitism but i wouldn't take it all that serious. It's even somewhat healthy as in preserving FreeBSDs identity and not suddenly becoming a Linux clone with a funky kernel. All in all i am not to negative about FreeBSDs overall outlook.

If one reads between the lines (when that's even required - some of the people i've spoken to were quite direct about it) a lot of people seem to be pretty welcoming in regards to the system evolving. It's just that this won't happen on it's own (for various reasons) which means there need to be people not only pushing for it but also putting in the required work to build prototypes and such. While FreeBSD is a very solid (and from what i've seen by now very easy to work with) base in my opinion with most puzzle pieces that would need to be put into place already existing any possible evolution will have to prove itself first and that's likely to happen outside of the base system (which i feel is quite sensible) so it might be a good idea to stick around and see what the future holds


----------



## drhowarddrfine (Sep 17, 2020)

20-100-2fe said:


> That's what made me give up using FreeBSD: with such a mindset


Talk about bad technical decisions--basing it on comments on a forum you disagree with! 

The problem I find, here lately, is the frequent posting by people who insist on going on about why other operating systems are better and why FreeBSD is the pits. If one were to go to any other OS forum and do the same thing, they, too, would be pounced on right away and one would whimper away with the same feeling. 

The reason I've always liked this one is that there was little of that--again till lately. The subject was always FreeBSD with little concern for anything else. If I was concerned with something else, I'd use something else. If you're concerned about something else, leave us alone and go use that.

I really, really don't want this thread to go off track now.


----------



## Mjölnir (Sep 17, 2020)

andoluca said:


> what could be done to reduce energy consumption, data usage in bsd?



Users/admins: use the wiki & confirm your setup with sysutils/powermon
developers: choose good algorithms.
Wikipedia article on Green Computing


----------



## Crivens (Sep 17, 2020)

mjollnir said:


> Like I documented in the howto mentioned above.  I manually suspend to RAM (`zzz` or via GUI), wait 15 minutes (UEFI/BIOS knob [0min...1h?]), then it suspends to disk via UEFI/BIOS methods (no OS involved).  On battery, suspend is configured to happen automagically


There needs to be some special partition for this, I presume. Since I swapped out the disk in my laptop for an SSD, and did not add the correct partition, this might fail for me. Also, no UEFI as far as I can tell. And I have *no* interest in doing all that stuff again I used to transplant one ZFS based install right over.


----------



## Mjölnir (Sep 17, 2020)

Look in your BIOS.  Search for IRST etc like what I wrote in the howto.  You can use your existing swap partition and swap to ZFS ZVOL instead.  No kernel dumps, though.  Still too lazy to work out a patch... (procrastination daemons :/ ).  BTW what happened to SirDice?


----------



## Holger (Sep 17, 2020)

20-100-2fe said:


> Not only on this forum.
> The "FreeBSD community" appears to be a gang of old friends who just don't want their habits to be disturbed and use most of their energy to explain newcomers how wrong they are.
> That's what made me give up using FreeBSD: with such a mindset, hope is not permitted for FreeBSD to evolve in a sensible way.


A community needs values in order for it to persist. In FreeBSD, these values seem to be somewhat conserverative. You dismiss these values as mere "habits". But they root in real-world experience, as far as I can see. There is nothing worse than a conservative (in the best sense of the word) community being corroded by short-lived, modern-trendy, hipster-stuff.


----------



## kpedersen (Sep 17, 2020)

I think that is why I personally like the FreeBSD community. It really is like a gang of old friends. Sure, if someone young and inexperienced comes in and starts misled arguments, they need a scolding like you would an unruly dog. It certainly doesn't mean you hate the dog, but you do need to stop it peeing on your curtains!

And if that is all that is wrong with our community I think we are doing pretty damn well 

For example, compare this to the desolate Windows communities consisting of cheap phoneys and very little actual humans or compare it to the world of Linux where it is so fragmented that very few communities are even half the size of just the FreeBSD forums. As for Apple, I think humans need to be conscious in order to class as "part of a community" so I don't believe many of them can count. XD


----------



## sidetone (Sep 18, 2020)

GNU is ok. Linux in general isn't an issue.

Linux distributions were definitely beyond bloated. It's still inefficient. Linux distributions and many sub projects in the Linux world still have a culture of bloat. I don't have faith in many Linux affiliated projects. Whenever things get more efficient, they have a tendency to recomplicate things. 

If they don't want to be called bloated, then they should make dependencies for a single features simple. 140MB for a documentation program?

Certain subsets of it still complicate things in ways that aren't efficient. I don't know if it's how they think, or if it's done on purpose.

I hope they do things better.

In the meantime, I'm going to re-study shell, and learn how to program in Rust. It may not be as useful to the FreeBSD ecosystem, but I want to start at the next thing. Then, learn C afterwards to provide lightweight replacements for some features on ports programs.


----------



## olli@ (Sep 18, 2020)

mjollnir said:


> Users/admins: use the wiki & confirm your setup with sysutils/powermon
> developers: choose good algorithms.
> Wikipedia article on Green Computing


 
Additionally, I’d like to mention powerd(8) that can be configured via rc.conf(5). It is particularly useful on battery-driven devices (notebooks, laptops), but can also be used on regular PCs to save power and keep the CPU fan quiet. These are the settings on my workstation (Ryzen-7 2700):

```
powerd_enable="YES"
powerd_flags="-a adp -b adp -n adp -i 33 -r 66"
```
To find out which frequency/power levels are supported by your processor and driver, use this command:
`sysctl dev.cpufreq.0.freq_levels`


----------



## olli@ (Sep 18, 2020)

PS: Here’s a small & simple X11 tool called xcpufreq that displays the current processor frequency (as controlled by powerd(8) and the CPU usage.

(Yes, I know, it’s a quick hack, and I should make a port from it one day. For now, just put the executable somewhere, `chmod +x` it and run it. It requires a few Xorg libraries, but they’re most probably already installed; it’s nothing special.)


----------



## msplsh (Sep 18, 2020)

20-100-2fe said:


> The "FreeBSD community" appears to be a gang of old friends who just don't want their habits to be disturbed and use most of their energy to explain newcomers how wrong they are.
> That's what made me give up using FreeBSD: with such a mindset, hope is not permitted for FreeBSD to evolve in a sensible way.



If you've given up, why are you still here?  Normally this behavior would be categorized as trolling.


----------



## Mjölnir (Sep 18, 2020)

msplsh said:


> If you've given up, why are you still here?  Normally this behavior would be categorized as trolling.


Split-brain: _This article is about the human brain condition. For the phenomenon in computing, see Split-brain (computing)._ The truth is: eventually, he likes us  he just wants to stir up a little bit...


----------



## drhowarddrfine (Sep 18, 2020)

ralphbsz said:


> One thing I find disturbing about this forum is the number of religious extremists, who seem to be mostly spouting nonsensical statements that reflect their irrational hatred for other OSes.


I remember on the original FreeBSD forum, back in 2004-200x (I don't remember exactly. What was that called?), we used to always consider Linux to be kissing cousins. There was often back-and-forth technical discussion with them and they were welcome. One day, all of a sudden, we started getting more than the occasional troll coming over. Then there was the drifting away by Linux from the Unix philosophy. Then more trolls. And on and on. This is what I remember as the change from kissing cousins to the black sheep of the family and I remember the vollies starting from their side.


----------



## bessie (Feb 10, 2021)

Stumbled late on this thread looking for hints on measuring or reducing power consumption. There's a point nobody seems to have noticed, that on laptops, battery wear depends on charge/discharge cycles, so it is desirable to reduce those. I'm off-grid, with solar powered 12volt supply. I have a 12 volt car typeC usb charger that supplies 5 volts 3 amps. Using another nameless OS I can be pottering about web browsing and editing text, and the charge increases from 30% to 80% in 3 to 4 hours. On FreeBSD the charge never goes positive, ie. the battery level just slowly goes down with a 15 watt charger connected.


----------



## Deleted member 30996 (Feb 10, 2021)

I heard a discussion like this a while back only lightbulbs were the whippingboy. That ended abruptly when I asked how many of them left their computers running 24/7, unplugged their Xbox or anything with a vampire light, etc.

Carbon based lifeforms should have a carbon footprint. Where is the flaw in that logic?


----------



## Mjölnir (Feb 10, 2021)

bessie said:


> Stumbled late on this thread looking for hints on measuring or reducing power consumption. There's a point nobody seems to have noticed, that on laptops, battery wear depends on charge/discharge cycles, so it is desirable to reduce those. I'm off-grid, with solar powered 12volt supply. I have a 12 volt car typeC usb charger that supplies 5 volts 3 amps. Using another nameless OS I can be pottering about web browsing and editing text, and the charge increases from 30% to 80% in 3 to 4 hours. On FreeBSD the charge never goes positive, ie. the battery level just slowly goes down with a 15 watt charger connected.



Did you tune your FreeBSD towards low energy consumption?  Please look into the wiki (link above).
There's a nasty bug in some old BIOS's ACPI, that results in overly high power usage on FreeBSD.  You can inspect `sysctl dev.cpu.{0,1,2,3}.cx_usage`, showing C0/C1/C2 CPU states of roughly the last ms.  With average desktop usage, the 1st value (C0) should be well below 50%, and C1/C2 will be more or less even.  If you see any abnormal values here, or a background task (e.g. plasma-desktop or kwin) has high CPU usage (check with top(1)),  check `sysctl machdep.idle_available` and set `sysctl machdep.idle=spin` (or `hlt`; default is `acpi`).  Put in sysctl.conf(5) or loader.conf(5) to persist.
Experiment with the options of powerd(8). My `sysrc powerd_flags`: `-a adp -n adp -i 75 -r 96 -p 125 -N` (-N is >= FreeBSD 12.2).  If the `-N` option is available, set the periodic(8) jobs in the system crontab(5) to run nice(1).
Load your vendor's acpi(4) modules: `ls /boot/kernel/acpi*|sed -E s'%(/boot/kernel/acpi_|\.ko)%%g'` & `sysrc kld_list+=" acpi_xyz"`.
Alas, the coretemp(4) kernel module can be helpful, and some old laptop's display require the dpms(4) kernel module to be loaded (adjust your GUI's X11 start command to load the Xorg dpms module, too).  You can control the display brightness either with graphics/intel_backlight or the acpi_video(4) kernel module.  Load the kernel modules like above, `sysrc kld_list+=" ..."`


----------



## kpedersen (Feb 10, 2021)

Trihexagonal said:


> Carbon based lifeforms should have a carbon footprint. Where is the flaw in that logic?


Luckily with COVID and the reduced aeroplane presence and fuel usage, it has basically made up for my use of slightly inefficient i386 machines in my house for the next couple of million years XD


----------



## PMc (Feb 10, 2021)

Trihexagonal said:


> I heard a discussion like this a while back only lightbulbs were the whippingboy. That ended abruptly when I asked how many of them left their computers running 24/7, unplugged their Xbox or anything with a vampire light, etc.


Yeah, it's called "fetish"; people get provided with fetishes they are supposed worry about, right here right now. And this is entirely disconnected from rational thinking; it is just ideology. In practice, things still work like the witchburns worked.
I'm wondering why indeed nobody seems to consider energy consumption of a desktop machine - all discussion is about laptop, and is only about battery consumption.

I love to run my machines 24/7 (or a least 16/7 - and anyway, when the thing is reachable from outside for smtp/http, it should actually be kept running), but then I try to care to have somehow a little more efficient hardware and config.
For instance, CPU: even a T-model (i5-3570T in this case) will continuously eat some 18W for the uncore:

```
Intel(R) Core(TM) i5-3570T CPU @ 2.30GHz
                       (Arch: Ivy Bridge, Limit: 36W)



  18.92W [===================================>                               ]



Package:           Uncore:             x86 Cores:          GPU:
Current: 18.92W    Current: 18.20W     Current: 0.72W      Current: 0.00W
```
I was told this would be fixed in Haswell/Broadwell series, so now Im looking for one of those.

Other issue: disk spindown.
Many things (like databases, etc) are used only part-time. With a proper disk layout the disks could be stopped for most of the time.
But there it gets weird: disks have features like idle/standby/sleep and APM (these are two different things!), but they are highly individual per each drive model (and sparsely, or not at all, documented) - and some decision is necessary, because spindown goes against the disk-lifetime also (something between 10'000 and 300'000 is usually supported). So, I conclude: almost nobody is actually using these, otherwise they were better documented.

But the highlight, in that regard, is Mr. Tom Lane, chief developer of the postgres database (and certainly a very good engineer, otherwise). Postgres does continuously access the filesystem every five or ten minutes, for no reason at all. Or, more precisely, the reason given by the developers is: people might accidentially swap the disk with the database files, while keeping the database program running, and that might lead to data corruption, so the program checks every few minutes that the files are still there. 
So, consequentially, for a database that is only used during business hours, disks will never spin down even if configured to do so. When I asked the developers if they really intend to achive this result, Mr. Tom Lane explained that given the decision to either protect the people from data corruption or otherwose support some moron who wants to spindown their disk, it is clear he must protect the people.
So, I don't know exactly how many sqare miles of rainforest Tom Lane kills per day, but given the popularity of postgres, and the fact that some disk manufacturers (e.g. Seagate) nowadays configure disks for auto-spindown already, I assume it figures to quite an amount...

So, thats what I mean with "fetish". "Environment" is a fetish, "CO2" is a fetish", "energy saving" is a fetish. People carry these fetishes around and think them important. But they don't spend a thought on what that actually would mean if one would apply some consequential, rational thinking. (Indeed, rational thinking is nowadays considered very nazi.) Instead, these fetishes are used for propaganda: to promote things where somebody can make real big money from: LED lights for houses, lithium batteries for cars, etc.



Trihexagonal said:


> Carbon based lifeforms should have a carbon footprint. Where is the flaw in that logic?


Indeed, they do. And Maturana+Varela (famous systems-theory scientists) have shown that self organizing systems (which nature/creation certainly is) can only exist in a context of energy abundance.

But what is also true, is that this planet can only use the energy that it receives from that nice atomic reactor up in the skies - and that is a certain, very specific amount per day. (Otherwise you would need to do fusion or fission, and how that could be done cleanly has yet to be shown.)
So, I think it was already 50 years ago, I said that it is not a wise idea to burn all the oil that is fetched out of the ground - because that is something like a bank-account, an inheritance conserved over millions of years, and burning it up just because it's there, within only a few decads, is certainly very stupid.
But nowadays people come up with the climate-lie, and that is again a fetish. And yes, I say, 'climate-lie', because it is bullshit - it's just a consequential damage. If people would have listened to what I was saying 50 years ago, that problem would not have appeared.
But then, again, people do not consider to change behaviour and fix the problem. They just decide: if it does not work out to burn all the oil for sports, then lets instead kill all the lithium for sports! And that will turn out a lot worse, because that stuff does not grow in woods at all. We will have to fetch it from the asteroid belt later on.


----------



## Jose (Feb 10, 2021)

kpedersen said:


> You are right though. I do sometimes cringe at some gaming machines with a mish mash of randomly sourced parts. Though I guess those enthusiasts almost get a kick out of using up as much energy as possible. The more neon lights the better!


Hey I resemble that remark! Except for the neon lights. I hate that crap. Never even plug it in. I've found these guys








						Optimus Advanced Water Cooling
					






					optimuspc.com
				




And I think their stuff is beautiful. I've bought a reservoir from them, and I think I'm going to buy a CPU waterblock next. Building desktop PCs is one of my hobbies. I need more victims that think they want one.

It's true that I'm old and set in my ways, but those ways are the fruit of decades of seeing fads come and go, and often having to deal with the wreckage left in their wake. When I was younger I thought I wasn't smart enough to understand why CORBA was going to solve all problems for everyone forever.

Now I live by the Nelson principle. When you do something I told you not to do and it blows up in your face, not only will I not help you, I will point and laugh.


			https://static.wikia.nocookie.net/simpsons/images/e/e9/Nelson_Ha-Ha.jpg/revision/latest?cb=20121205194057
		


I do worry that I'm missing some jewels hidden in the garbage, and do try to listen if the zealot is not too obnoxious. But it's really hard when they're really full of hubris and ignorance.


----------



## kpedersen (Feb 10, 2021)

Jose said:


> Hey I resemble that remark!


Haha. To be fair, I probably resemble that remark too. Though my stuff certainly doesn't look good. It is just old, inefficient and a mish mash of whatever I found in the bin that week 



Jose said:


> Now I live by the Nelson principle. When you do something I told you not to do and it blows up in your face, not only will I not help you, I will point and laugh.



It is a good principle to have. Only if they try to get me involved (systemd, Wayland, pulse) do I have to try to escape!


----------



## Argentum (Feb 10, 2021)

Trihexagonal said:


> Carbon based lifeforms should have a carbon footprint. Where is the flaw in that logic?


Carbon based life forms should have silicon footprint


----------



## Argentum (Feb 10, 2021)

20-100-2fe said:


> The "FreeBSD community" appears to be a gang of old friends who just don't want their habits to be disturbed and use most of their energy to explain newcomers how wrong they are.
> That's what made me give up using FreeBSD: with such a mindset, hope is not permitted for FreeBSD to evolve in a sensible way.


I understand that this is an *old post*, but I think this statement is completely wrong and should be noted. IMHO, this forum seems very friendly to newcomers and most people here are doing a great job to help them.


----------



## phalange (Feb 10, 2021)

Trihexagonal said:


> Carbon based lifeforms should have a carbon footprint. Where is the flaw in that logic?


The flaw is assuming that people discussing how to save power on their devices have any interest in your opinion that they're just wasting their time.


----------



## Argentum (Feb 10, 2021)

phalange said:


> The flaw is assuming that people discussing how to save power on their devices have any interest in your opinion that they're just wasting their time.


Agree. The main goal of the computing industry has been reducing power and increasing speed at the same time, over decades. But the reality has been that the number of systems has been increasing more rapidly than the power consumption has decreased. This is called progress in some places. Another question is, how much the overall happiness (if at all) has increased. But FreeBSD seems to be no culprit in this process at all.


----------



## PMc (Feb 10, 2021)

Argentum said:


> how much the overall happiness (if at all) has increased.


In what regard? Happiness of the users with their gadgets, the sellers with their profits, or of mankind in general? But then, who would ask such questions, and, would not that be off topic?


----------



## Snurg (Feb 10, 2021)

Apologies for chiming in.
Maybe it might be justified for environmentalist reasons.

I regularly get ridiculed and even attacked on this forum when I talk about the fact that a bug in vesa.ko prevents successful S3 resume on people using nvidia cards and sc console.
As long as the bug is not fixed, the workaround is to build a kernel without vesa.ko.
Having S3 sleep work with the GENERIC kernel on FreeBSD would not be detrimental, at least in financial and environmental regards.

Having extremely high energy prices here, I consider outright wasteful to not have my office PC sleep overnight and when not used for longer intervals.
From the $$$ savings S3 sleep gains me, I could buy at least one new PC every year.
So I hope you can refrain from ridiculing me, as I am not rich enough to consider this savings as financially irrrelevant.

Already in 2017 I PRed the bug.
Even though a fix would need only two lines of code, there didn't follow any action

So I kindly ask you to review my draft of a new PR attempt to increase chances that this bug gets fixed.
Thank you!


----------



## PMc (Feb 10, 2021)

Snurg said:


> Having S3 sleep work


Oh, that's a good topic, indeed, I mostly gave up on this as there are many possible side effects - and having some half-written document lost due to the machine not coming up again is worse than just saving it and shutting down fully. So, yes, it's a good topic, one would probably go into standby more often if that could be expected to work reliably.

Be happy if it's only two lines and that solves the matter for You. 

I just gave it a try, and the result was, well, impressive... I remember it did work suitably with Rel. 11.2 or such. But now, with 12.2, on a simple IvyBridge with the integrated GPU, no usb except mouse and printer, and not much else out of the ordinary, the behaviour is as follows.

 -> Standby: 
normal behaviour, PS and fan stops, power led now blinking.
 -> Restart: 
PS and fan start again, but no effort to activate the display signal. 
After about 60 sec. machine powers off entirely, starts again, and still no effort to activate the display.
 -> Reset button:
No effect.
After another 60 sec. machine power off entirely, starts again, and does a normal full boot. Obviousely all is crashed, filesystems are uinclean, etc.etc.

Not recommended for practical use.


----------



## Snurg (Feb 10, 2021)

Did you hit the power button to awake after sleep?
I do not recommend this because I consider this powering off directly out of the sleep [*].
I'd recommend to just hit a key (shift or ctrl, to not unintentionally inputting chars).

Then the computer powers on.
It can take up to one minute until all stuff has been initialized and is active, like drive spinup, USB init, video etc.
Thus just be patient a moment if you wonder in case you do not instantly see things happen.

_To avoid cluttering this thread, maybe we should make a specialized thread for environmentalists?
For example, "To help the environment, help me get my computer sleep and wake up reliably!"_

[*] Edit: Maybe this is also worth investigating, as this can be potentially considered as bug in the ACPI and suspend/resume framework, misinterpreting the power button event as "poweroff" event, even if it should be interpreted as "resume" event, in case the system was in the S3 state when the power button event was initiated.
This would prevent people used to the powerbutton as resume initiator (i.e. people used to non-FreeBSD-OSes) doing an unintentional poweroff...


----------



## PMc (Feb 10, 2021)

Snurg said:


> Did you hit the power button to awake after sleep?


Nope. Hit space bar.



Snurg said:


> I do not recommend this because I consider this powering off directly out of the sleep [*].


_Should_ not (except when pressing >4sec.)



Snurg said:


> Then the computer powers on.
> It can take up to one minute until all stuff has been initialized and is active, like drive spinup, USB init, video etc.
> Thus just be patient a moment if you wonder in case you do not instantly see things happen.


It didn't really. 
But there is another possibility which may be the reason: for IvyBridge GPU there seem to be an old and a new driver and both should somehow work. So, as this is rather unspecific, I decided to use neither and just stay with the kernel-included drm2 which did work with Rel.11. And it still works with Rel.12 - but maybe some things have changed with the standby, and those would likely not get adapted in that old drm driver. That _might_ be an explanation.



Snurg said:


> Maybe this is also worth investigating, as this can be potentially considered as bug in the ACPI and suspend/resume framework, misinterpreting the power button event as "poweroff" event, even if it should be interpreted as "resume" event, in case the system was in the S3 state when the power button event was initiated.


If that actually happens, I would say it's a bug (but can easily be workarounded as soon as one knows about it).


----------



## Snurg (Feb 10, 2021)

Hmm that's interesting...
would be curious to know what actually happens/goes wrong on your config.

There are some drivers which do not correctly resume, but these are usually old exotic stuff, as the suspend/resume framework was added way before Ivy Bridge iirc.
I have a laptop with HD4000, maybe I should test 12.x on it. On earlier releases, suspend/resume just worked fine.

Regarding the reliability of resume on my nvidia-equipped PCs, I can only say that I had only two resume failures, since I started to use FreeBSD as desktop again in December, doing `zzz` multiple times every day.

The first fail was when I was distracted and accidentally pressed the power button to resume, instead of a key, just to see it power down like I described in my last post. (Need to test this... might Kitty have walked over the keyboard in the night unnoticedly?)
The second fail was when I did `freebsd-update` and forgot to build and install my custom kernel directly afterwards (without vesa.ko, as workaround to make resume work).

So my personal impression is that the suspend/resume framework itself is very reliable, as I yet have to experience a "real fail" resuming after sleep, after hundreds of resumes.

*What I miss is an up-to-date overview/list of resume-blockers and fixes/workarounds.*
Such might save people a lot of time of narrowing down what prevents the successful resume.

Some can be fixed or worked around.
At least if known workaround(s) exist...
*Now I am thinking about how a thread could be named to collect all this information regarding solutions or workarounds spread around between few users, who did deep research to find one or the other resume-blocker...*
Maybe such a thread could result in thousands of saved kilowatt-hours, actually helping the environment...


----------



## PMc (Feb 11, 2021)

Snurg said:


> Hmm that's interesting...
> would be curious to know what actually happens/goes wrong on your config.


Sadly, thats not so easy to figure out. I tried it two more times, with the same behaviour. Nothing makes it to the logfiles, and not even the keyboard gets initialized (numlock no reaction) and that's not usb. Then I tried GENERIC kernel, with no X, and no drm loaded, and again the same behaviour. 
So this may be any strange parameter I might have anywhere in the bios, loader.conf or sysctl. What is definitely interesting is the reset button not being honored immediately. I have never seen that before, but that seems like the routines are not even getting properly through the mainboard-internal firmware code.
(The mainboard has slightly changed - it was ASUS P8B75-V with Rel.11, and now it is P8H77-V, the only difference should be this one has DisplayPort and so it can use WQHD).


----------



## Snurg (Feb 11, 2021)

Yes, this thing with the reset button not being honored immediately is definitely strange.
I guess the same, there are some things like the boards' firmware, AMD has their equivalent to Intels system management thing. Or it is some UEFI thing... (of which I have zero idea)
Also this self-turning off and on, and rebooting. Honestly, I don't associate such with FreeBSD.
Strange, too, that you get no acpi messages in the log. Will have check with GENERIC kernel whether it is the same here if I try broken sleep (i.e. with vesa.ko loaded).
*I think we should really make a thread to collectively find out the best approaches what to do to narrow down the problem when resume fails, **as the wiki only says "TBD" there**...*
(...and because I feel guilty for OT...)

I do not know whether vesa.ko (options VESA) still is needed on UEFI systems after that patch in 2019, which apparently transferred from vesa to vt the task to hand over control to xorg after resume.
If it is no longer needed, one could try to check whether a kernel without vesa.ko would work.

A reason to try this could be that vesa.ko relies on some esoteric antique VESA BIOS functions to work correctly, of which the outcome becomes less and less predictable, the more modern the hardware is.
I would not even rule out that the strange poweroff/poweron-rebooting could be caused by such.

Intel recently dropped a lot of support for obsolete things like Windows XP.
DOS drivers seem to have been completely purged from the Intel site now.
So there is reason to presume that DOS crud like VESA might be cut down in VGA BIOS too, or already have been in their newer reference BIOS.


----------



## Crivens (Feb 11, 2021)

Did you two try to set the suspend_bounce sysctrl for a test? And setting the define for a verbose ACPI?


----------



## Snurg (Feb 11, 2021)

Crivens said:


> Did you two try to set the suspend_bounce sysctrl for a test?


Back then when I investigated the problem on my nvidia-equipped computers, I tried all what I could find in the wiki, in the forums and in the mailing lists.
I remember there was some effect from some settings, resulting in apparently no action following the suspend command, so this didn't really help much.

Only building custom kernels, trying to narrow down potentially bad kernel modules made me find out that something is wrong with vesa.ko.
Doing this directly led to finding the culprit, as my first step was to remove from the kernel all vt and vesa-related stuff, as they were natural prime suspects.

Investigating that, I found that skipping this invalid BIOS call in vesa.c fixes the problem.
On the forums, I advised people to try the same and this usually fixed the issue for them, too.
So I believe it might be not exclusively my "insane" "vivid imagination" that makes me suspect a problem there.



Crivens said:


> And setting the define for a verbose ACPI?


Ohhh which one is that?  *wannaknow*


----------



## PMc (Feb 11, 2021)

Crivens said:


> Did you two try to set the suspend_bounce sysctrl for a test?


Ah, thats interesting. But it doesn't suspend at all then. It just switches to text console, resets the usb, then activates the usb again and switches back to X screen. No problem with that, apparently.

It seems the problem is rather the board itself not getting out of suspend state. A short glance thru the cmos config does not show anything too evil, so this seems to need a more elaborate endeavor (minimal config etc.), and I am seriousely not in the mood for such currently - there are other things I need to hack...


----------



## Crivens (Feb 11, 2021)

Some knobs and sysctrls are referenced here: https://forums.freebsd.org/threads/finally-some-success-with-suspend-resume.48754/

And, in your custom kernel, set the ACPI_DEBUG option. And then there is hw.acpi.verbose

Good luck and haia safari.


----------



## Deleted member 30996 (Feb 14, 2021)

phalange said:


> The flaw is assuming that people discussing how to save power on their devices have any interest in your opinion that they're just wasting their time.


The flaw in that logic is they are subject to it anyway, like it or not. That's their opinion.


----------



## Deleted member 30996 (Feb 14, 2021)

kpedersen said:


> Luckily with COVID and the reduced aeroplane presence and fuel usage, it has basically made up for my use of slightly inefficient i386 machines in my house for the next couple of million years XD


I gifted my i386 to a guy with ADHD I've known all my life that lives across the hall from me. He's never used a computer in his life, but once he gets the hang of typing and can enter his password correctly he's going to learn FreeBSD 11.2-RELEASE offline. 

I have it running for him and told him to leave it on 24/7 so he can fiddle with Gimp, listen to music and learn to type on leafpad. I got root and plenty of patience with. If he shows me he is trying I'll rebuild it so he can go online and Admin it.

I thought the guy with a Degree in Computer Science - Communications upstairs must have to know more about computers than me, but only when it comes to splicing cable to make an Ethernet wire. He thought I didn't know a keyboard from a surfboard. Working from the terminal to build a boxen from ground up something he couldn't begin to do, much less believe I could. He can use the Tutorial.


----------



## Turbo50 (Feb 16, 2021)

Found the topic fun to engage with. So why not have some wise words on the subject from someone that see the bigger picture.

Not sure why out of all thing one can do, one try and save on the environment on a personal computer. Like honestly any savings done here will be ruined by the countless of stuff happening around you.

Like as said above by others. First thing to check is the screen your using. (for most people) Then the computer itself. Wasted energy is HEAT. And in some ways I like some heating in my room thank you! So even that is not very wasteful here in winter time. But a computer (laptop from say 2008) not used heavily will not be very power hungry. But put a big work load on it, IT WILL be wasteful compared to a modern machine. Since trying to cope with the non intended use of the machine ruins the power usage. A modern machine evolved with the need of the heavier workload. (not true but close enough)

But monitors are always wasteful, and that is part of the design. They are converting electricity into something we humans can interact with (light) so it is very wasteful when it comes to power. And really if your compiling ports then stop doing that to XD Someone has already done that for you. Or rather spent energy on it.

It should be quite obvious. But CPU's are in essences TINY TINY mechanical things moving fast. And the waste of energy is really low due to the small size of it. But the less you use it the better. And if you need to use it then a better and more efficient CPU give more bang for the power use. As they become smaller and smaller as we progress in the tech. Less movement the less HEAT created.

Even old hardware is not bad. The power savings of getting a new board is going to be nothing when comparing the material and energy needed to create and get the new PC, and then get rid of the old computer is doing harm too.

It is just a matter of how much computing you need. The more you need the better a modern computer gets. At least in theory. But being happily using a slow but highly efficient modern ARM thing is best of both words. But do not think the OS or the Hardware is a big factor in saving the environment. It simply is better to go back to a more basic usage of tech. Like 70s and 80s. Nothing fancy but lean and fast.

Solar power made from your own panels. Now THAT will blow the environment friendliness sky high. Well compared to running on money electricity that is. Since the electricity likely is produced in a environment negative way. In the name of PROFIT. So that is a very recommended approach to feel better about computer usage.

Sell green power to buy cheap bad power. No joke this is what happens around the world. Do not trust environment nonsense from companies. They make a green good power source "for free" but opt to make money out of it instead. Since that is what they do. Big industry next to me do just this exact thing. Buy Coal power and sell Green power. Make them allot of money. They waste energy since they are being PAID for creating GREEN power. But they do not use it but exchanging it for money. There power bill is being paid off and getting a profit from it. Instead of you know.. Using the power they created for there own production on the spot.

Really that is the messed up world we live in. Waste energy and getting paid good for it too. At that place they run everything on electric, all lamps are on all year around. Not trying to conserve power in any way. They are Environment Friendly company? Yes. Just happen to create green power without them even trying. A bioproduct at it's finest. Think about that before buying a electric car running on "green" power. It is just as "green" as YOU yourself make it. Same with computers or tech in general.

Really unless you need a computer the "Environmentalist" thing to do is ditching technologies for the most part. Really only thing to use it for is to avoid traveling. And so then if that is the reason to use a computer. Well... It is more about networking that you should be concerned about and not the computer your using. Well with a intent in Environmentalist actions being the number 1 thing.

Do not just focus on what happens on your computer. Think the hole process you embark on when being online. As with everything in life. Think!

It is better being on a computer VS driving to a friend to talk with them and such. It's better watching YouTube then going on a holyday in a car or airplane. But the energy and hardware (and therefor pollution) from being online is no joke. But it dose not have to be. But anything fun or whatever draws you to being on the web is BAD for the environment. It is to avoid needing to travel that is GOOD.

But just 1 other human being on the planet not taking "Environmentalist" actions will ruin anything you do anyways. And to bring the point home fully think about this one. ANY criminal* money making scheme is going to pollute and ruin the earth so much more then a million ordinary people running a computer. At least if they are just sending email's and peer to peer data transfers.

But that's the problem. We are not peer to peer data sharing. We are feeding big servers data. That's no good for multiple reasons. As why they do not charge us for this is simple and open facts. They use our data and run computer intensive (power intensive) things on it. For as you might know already, profit. Training AI's or selling it to put ads on us. (good use of electricity ye?)

I like to give a idea of how pointless the focus on a OS or hardware really is in the big picture. So that is why I bring this stuff up. There is so much more productive things to focus on  Like not letting servers suck up power from you watching cats on the web. Do something IRL like grow your own food. Use the web to learn about that stuff. That is what I love about the internet. Knowledge.

Now instead of peer to peer data transfers (a good way to moved data around) we use Facebook, YouTube etc with a middle man server. Witch if you think about it means one extra set of power draining appliances for data transfers as a minimum. They spend more electricity on stuff on there servers then what the home computers uses do. They simply are doing so much in the background compared to if you just had talked directly with however you where interacting with online. (peer to peer computing) FreeBSD server we download files from are doing the least amount of efforts to deliver the files to us. But other servers do all kinds of crazy stuff. For what reason? Profit? Most likely. 

Literally ANY peer to peer data transfers are seen as criminal actions today. (more or less) You are going to be challenged why your sending encrypted or non encrypted messages peer to peer. Since it looks suspicious. Even now there are legit reason for it.

And it also is simply a hard thing to do. That is probably the big reason really. Much harder to learn or care about it when you can just go online on a forum like this one. Or Instagram. That is why the changes are not happening. Convenience. To really do anything worthwhile from a Environmentalist standpoint the changes to how we do things need to change. (did not see that one coming did ya all?)
A forum like this are grate! But what else do you do on the web? Might you rethink having them get more data to process?

Not just change the hardware or OS we run will do anything. It is the software and services we run on top of it. Trying to be smarter about what we do in our lives.
The big picture is difficult to grasp. But the point is to limit what actions you take and how much you rely on people with there motives being always about money.

Same with vehicle transport, food, ANYTHING really. Doing as much as you can on your own is the key. You find out what is good or bad for the Environment simply by what you can accomplice on your own or in your community close by. What dose nature support basically is the key to saving the Environment. And working together as small communities this called "internet" can still exist but for real practical reasons. Educations etc. Not Netflix...

So really to be environmentally good, limiting networking and sending and retrieving as little as possible is more important then you might expect. Meaning your basically not going to be using a computer in the way of 2020. But rather just for emails and stuff that really is just sending small files around. That is less impactful then sending snail mails or driving around in a car. So it works out as a positive thing even now it dose pollute. Agene using the computer to avoid traveling with vehicles are A GOOD THING. But that's about it. It is wasteful since it is not necessary or vital in life to be on a computer as we do now.

Avoiding internet and computers plays well in with a low powered ARM based devices. Since in essence if you only do need a low range PC, well you then have changed the way you do thing too. Still you can be online and watch a movie or YouTube. But it is so much more valuable to think about what impact it has outside of your eye sight. Same as how coal burning has such a damaging impact. It is outside of eye sight the problem occurs, always. It is not "free" being online. At least not for the Environment. The cost are huge but better then a airplane trip for "fun".

Literally a tiny ARM or RISC board will draw nearly nothing. The monitor will be the big power consumer. Then the network transfers and anything happening out there on the web. That should be the concern. What dose it take to create this tech, and keep the internet running. That is the real pollution maker.

So to be frank there are better things to look into before looking at whatever power saving measures can be done on OS level. It is more about whatever that OS is doing and what it is communicating with. (and how much)

Like look at that Pi keyboard with a built in computer. You can still watch YouTube on it. But the problem is YouTube. That is the power hungry thing. As is basically anything but the most old school internet usages. Like when we used phones to communicate peer to peer. That is the kind of data transfers that are ethical to be using. And they where SLOW. But did something useful with little impact to anything.

Like I do not even think FreeBSD is the best OS for this task of power saving. (nor Android) Efficient use of electronics are the key for a Environmentalist caring person. Just as avoiding running unnecessary lights in your home (LED ones ofc).

FreeBSD I think is to fancy. XD  But I mean sure it is not that bad. You just need to learn so much about computers to get anywhere with it. I think Linux or Pi OS is better suited. Simply more support for the goals of a OS for basic web stuff. FreeBSD is a hobby or a server OS. Or someone that likes to be more in tune with the computer and like them to be powerful and awesome.

If the question was about saving battery life and extend usage time. Then yea looking into hardware and OS is the main thing to do. Since any reason to use the battery is to get something done. For fun or work.
But that was not the question. So happy Environment saving. ?  I recommend something like a Pine phone. Mobile and can be charged by a solar panel easily. Can connect to a monitor making it a grate computer also. I really dig the idea of getting one of them. Simply for the reasons I have said in the post. It is a good device since the goals line up with so much of or mere mortals needs.
​


----------



## Snurg (Feb 16, 2021)

Yes, the cost-benefit calculation is twisted by incorrectly eco-balancing any behavior.
But this is characteristic for the Economy of Death.

For example, I just do not understand how little people talk about power consumption when they "upgrade" their networks.
I mean, what benefit does a SOHO user gain from a <3% used Gbit ethernet, of which every PHY consumes, say, 5W, when one could use "obsolete, uncool" 100Mbit ethernet instead, which only uses, say, ~0.5W, without noticeable performance loss.

So, I wish drivers had their options to set the device to a particular speed setting, and driver power.
Imho, Economically viewed, it is wasteful to power for 100m when in most installations no cable segment is longer than, say, 5m.


----------



## PMc (Feb 16, 2021)

Snurg said:


> For example, I just do not understand how little people talk about power consumption when they "upgrade" their networks.
> I mean, what benefit does a SOHO user gain from a <3% used Gbit ethernet, of which every PHY consumes, say, 5W, when one could use "obsolete, uncool" 100Mbit ethernet instead, which only uses, say, ~0.5W, without noticeable performance loss.


You don't get them anymore. Given I get my intended haswell-board, it will not have any PCI/PCI-x slots, so I cannot use my fxp 100Mbit adapters anymore. So I already bought a few used ones for PCI-e, and indeed these are running remarkably hot. But, that also differs on specifically how old they are. 
Also, on the quad card it would be desireable to power down those that aren't used, but that doesn't seem to work.

And in any case, you're oldfashioned: nowadays we talk 10GBit for SOHO *veg*



Snurg said:


> So, I wish drivers had their options to set the device to a particular speed setting, and driver power.
> Imho, Economically viewed, it is wasteful to power for 100m when in most installations no cable segment is longer than, say, 5m.


There are some switches in that device, but I didn't yet figure out how they would work. em(4):

```
hw.em.eee_setting
             Disable or enable Energy Efficient Ethernet.
     hw.em.smart_pwr_down
             Enable or disable smart power down features on newer adapters.
```


----------



## Snurg (Feb 16, 2021)

Cool... must take a look into this.
"EEE" energy efficient ethernet reduces the consumption considerably by resting the hardware in sort of sleep mode when not used, definitely worth investigation.

And yes, I know that I am old-fashioned. The energy consumption decreases as technology matures.





(Source)
And this is two times for every patch cable.

What annoys me is the lack of sort of "opt-out" for this kind of "progress".


----------



## Crivens (Feb 16, 2021)

I remember people telling me to get rid of my old TDI and buy a shiny new car, "'For the environment'. When driven carefully, I got it down to 3.7l/100km. Normally, 4.5 and when I was in a hurry still <9.
Producing a new one would consume enough energy to drive it a lot more than 150.000km. And before you ask, it had all the trimmings. The greenest thing to do was drive it as long as possible. Had to sell it at 300.000km. 

So, it should be best to use old HW for as long as possible. The energy cost at your home should not be considered but the whole 'ecological backpack'.


----------



## Snurg (Feb 16, 2021)

Crivens said:


> So, it should be best to use old HW for as long as possible. The energy cost at your home should not be considered but the whole 'ecological backpack'.


Yes, and this really depends. A 1980 car, well stored and taken care when not in use, which is used only once a fortnight for getting groceries in the village 5km away, probably is in good technical state. If it were not for the political will ("reduce pollution") that gets old cars banned, it would probably be more ecological as economical to continue using that car for some years more, instead of trashing a perfectly good item for a newly made one.

Another thing - I don't know whether it is true, but I consider it credible - I read M$ dropped support for hardware that is >10 years old.
So this is a real driver for "technological and conomical support" for the "Third World". Not sure what I should think of that...


----------



## Phishfry (Feb 16, 2021)

Turbo50 said:


> And the waste of energy is really low due to the small size of it.


OK I had to rebuff this.
Most of the wasted energy is because of leaky gates (transistors).
True that the gates are very very small and this contributes to the problem.
Most die shrinks the TDP goes down not up.





						Intel Video Showcases How a 10nm CPU Gets Built | ExtremeTech
					

Curious how Intel builds a 10nm chip? The company has published a detailed video that breaks the process down.  ...




					www.extremetech.com


----------



## Snurg (Feb 16, 2021)

PMc said:


> ... so I cannot use my fxp 100Mbit adapters anymore. So I already bought a few used ones for PCI-e, and indeed these are running remarkably hot. But, that also differs on specifically how old they are.
> Also, on the quad card it would be desireable to power down those that aren't used, but that doesn't seem to work.





Phishfry said:


> Most die shrinks the TDP goes down not up.


Yes that is one thing one usually does not get shown in the fancy marketing papers.
It can really matter whether you use an old chip or a less-old chip of the same series.
With the very old 100Mbit cards ~1995 you can almost burn your fingertip.
With the last ones, already with board shrunk that much that the slot part was 1/4 of the whole board, barely enough to hold the case slot metal, there is barely some warmth recognizable. And this seems to be the same game every ethernet incarnation.

What I really miss is data with actual energy consumption information, minimum, average, maximum not only for CPUs, but the other components, too...
So one could plan a computer or network configuration according to minimal consumption.
Does there exist any hardware database/market overview, which includes such data?


----------



## Mjölnir (Feb 16, 2021)

Phishfry said:


> OK I had to rebuff this.
> Most of the wasted energy is because of leaky gate (transistors).
> True that the gates are very very small.
> Most die shrinks the TDP goes down not up.


Yes, but the truth is that neither we (as consumers) nor the manufacturer pays the _"true"_  (fair) price for electronic goods, i.e. incl. costs for disposal and/or recycling.  That means for us consumers in the "1st world", it is often cheaper to buy new, modern & more energy efficient articles than to use existing ones until the end of their life.  The fact is that _others_ pay the price...  because the costs for waste disposal & recycling metals & rare earth elements are exorbitantly low, because these processes are built on exploiting people in the 3rd world.  Another calculation is what Crivens wrote above: we do not add the energy costs to manufacture a new article into our calculation; that's impliciltely in the article's price because the producer & vendor pay it.  But very often, these are subsidized, i.e. the true costs are hidden for political reasons.
EDIT Not to mention the conditions of mining rare earth elements in central Africa & elsewhere.  Child labour & slavery is mundane there, and the civil war lasts longer than I can think.  It seems one major reason is that we (1st world) are ok with that as long it guarantees cheap primary materials for us, because the western mining companies have arrangements with the War Lords. Newsworthy example: why are the military leaders in Myanmar so powerful? Because they're incredibly rich. Why are they so rich?  Drugs & raw materials...  Of course that doesn't mean no russian & chinese companies are involved, too./EDIT
Sytem Error (IMDB)
system Error (trailer):


----------



## PMc (Feb 16, 2021)

Snurg said:


> Yes, and this really depends. A 1980 car, well stored and taken care when not in use, which is used only once a fortnight for getting groceries in the village 5km away, probably is in good technical state. If it were not for the political will ("reduce pollution") that gets old cars banned, it would probably be more ecological as economical to continue using that car for some years more, instead of trashing a perfectly good item for a newly made one.


You miss the point. It is all about creating consumption!

We are at a point where most people have everything they need. The biggest issue for our economy is to keep up the necessary ever-increasing growth of consumption. So, the environment story is here just to make people throw away more stuff and buy new one.

This is a "double feature" scheme: on one hand the people are told that they must do something for the environment (and obviousely that is a moral imperative, so you cannot say anything against it), but then, if you look closer, those who are in power are all associated with investors, they make up these moral imperatives, while in fact they only have to provide for the profits, for "creating new markets".

Donald Trump called them the "establishment", I call it "feudal-socialism": it works like socialism when treating the people as government-owned cattle: we are unfree, we are told what to think, we are told what to do, all with moral imperatives. And it works like feudalism when securing the profits for the elite. Just like in the middle ages, when religious morals were employed by the gentry to force the people to comply with what was said to be god's will. Now it's no longer god's will, but it's still the same scheme of unquestionable morals abused to subdue the people.

The essential point is that it is the *same people*. You can complain about how bad the world is, and how endangered the environment, and how troublesome our over-consumption, and how poor the people in Africa, and so on and so on, and you will be perfectly welcome with all that sermon. But what you're not allowed to say is that it's the *same people* who actively create those problems and who tell us that we must feel guilty because of them!

The priest who talks about how sinful the world is and that we all must repent, is the *same person* who actively rapes little boys in the sacristy. The aid agencies who tell us that we must care for all the refugees are the *same persons* who actively send midwifes (instead of prevention consultants) to Africa to create more over-population. The people who complain about the climate catastrophy are the *same people* who make big money with carbondioxide certificates.  And so on and so on. But that's what you must not say - because if you say that openly, and attach the proper names, then -guess what- you are a nazi.


----------



## olli@ (Feb 17, 2021)

PMc said:


> You don't get them anymore. Given I get my intended haswell-board, it will not have any PCI/PCI-x slots, so I cannot use my fxp 100Mbit adapters anymore.


You don’t have to use 100 Mbps adapters. You can run 1 Gbps adapters at 100 Mbps, too, and this will also save power.
`ifconfig igb0 media 100baseTX mediaopt full-duplex`

Some NICs support power saving modes, for example see the tunable `hw.em.smart_pwr_down` in em(4). Also, some NICs will power down a port automatically when the interface is marked “down” (sometimes you have to disable WOL for this to work).

Another thing worth mentioning is the sysctl `hw.pci.do_power_nodriver`. It causes power to be switched off on PCI connections that have no driver loaded.


----------



## olli@ (Feb 17, 2021)

Crivens said:


> I remember people telling me to get rid of my old TDI and buy a shiny new car, "'For the environment'. When driven carefully, I got it down to 3.7l/100km. Normally, 4.5 and when I was in a hurry still <9.
> Producing a new one would consume enough energy to drive it a lot more than 150.000km. And before you ask, it had all the trimmings. The greenest thing to do was drive it as long as possible. Had to sell it at 300.000km.
> 
> So, it should be best to use old HW for as long as possible. The energy cost at your home should not be considered but the whole 'ecological backpack'.


Yes, but it’s very difficult to estimate that backpack.

For example, an older PC of mine took one to two days for transcoding a movie (I do this a lot), and consumed 280 W during all that time. My new PC takes about an hour for the same thing and consumes 120 W under load. It’s roughly a factor of 80 (!) in total power consumption per movie, i.e. 10 kWh vs. 120 Wh. This is quite a difference. But whether this makes up for the “ecological backpack”, I have no idea. But even if it didn’t, I prefer the newer machine for the fact that it makes much less noise 90 % of the time.

For me personally, quality of life is an important factor, too.


----------



## Crivens (Feb 17, 2021)

This is all in all a komplex topic.
We did this better better better race for some time. As a result, we have made progress like never before. Compare the life of you to your grandparents. And rhen their grandparents. The unemployed today can live better than the kings of the past. Ol' man Rockefeller could not talk to all the wold like we can. Queen Victoria did not get fresh produce in winter, not to mention a fridge.
That there is an even bigger gap between the unemployed today ad f.e. Elon - that is a price we need to py for this.
What it does with the planet is part of the price, and we might very well find us in a place where we cannot afford that any longer. IMHO we passed that point already. We need to drive technology ahead now, because nothing else has a potential to save us. And whoever doubts that the price is too hight when the bill comes around, I have some seafront estate in Florida you might find interesting.


----------



## PMc (Feb 17, 2021)

olli@ said:


> You don’t have to use 100 Mbps adapters. You can run 1 Gbps adapters at 100 Mbps, too, and this will also save power.
> `ifconfig igb0 media 100baseTX mediaopt full-duplex`
> 
> Some NICs support power saving modes, for example see the tunable `hw.em.smart_pwr_down` in em(4). Also, some NICs will power down a port automatically when the interface is marked “down” (sometimes you have to disable WOL for this to work).
> ...


Yes, been thru that, didn't find much that would make the device (it was some elderly intel quad-port 1G) become not so hot (I was rather bothered with possible airflow planning than with energy consumption).

What seems more intereting is this (and most pci devices have that):

```
fxp3@pci0:5:7:0:        class=0x020000 card=0xb1640e11 chip=0x12298086 rev=0x08 hdr=0x00
    cap 01[dc] = powerspec 2  supports D0 D1 D2 D3  current D0
```

How do we switch these D-states?


----------



## PMc (Feb 17, 2021)

Crivens said:


> This is all in all a komplex topic.


It is complex. It is futurology at its best, and it should be done a lot more, and with a much wider horizon.


Crivens said:


> We did this better better better race for some time. As a result, we have made progress like never before. Compare the life of you to your grandparents. And rhen their grandparents. The unemployed today can live better than the kings of the past. Ol' man Rockefeller could not talk to all the wold like we can. Queen Victoria did not get fresh produce in winter, not to mention a fridge.
> That there is an even bigger gap between the unemployed today ad f.e. Elon - that is a price we need to py for this.


Thats a problem for the socialists - they always complain as long as not all people are even. I see that only as a problem of greed and envy, i.e. no problem at all: let Elon and folks have as much as they want, and let them be happy with it - as long as I do not need to starve and freeze, thats all fine with me. The problem only starts when these guys start to take away our freedom, our freedom to live our lifes as we like it, and make us behave as puppies to their schemes.

But there is something else (it was already somewhere in Frank Herbert's Dune, in that huge amount of highly valuable side-notes and mentions): _in a highly developed economy you will get more and more fancy stuff, and you will have ever greater difficulty to get some of the basic necessary stuff._
Consider you need just a piece of metal, to fix something. Where do you get that? Usually nowhere - instead you harvest it from some scrap, because it is too simple to be on sale anywhere.
Other example: the HP5p printer. It's perfect, it works forever. And you don't get such a thing anymore. You get a "newer and more modern" printer every year (and they all do just the same: print), and you will throw them away after a few years because supplement are no longer available - but you don't get a basic solid printer that can work for some 20 years, because that is no longer on sale anywhere.
More troublesome issue: medical support. There is more and more highly delicate crap, but no longer means to properly treat people in a basic and solid fashion. Ivan Illich (research on that guy, it's valuable) said we actually need only about 25 different medications to get along. The remainder is a vastly inflated market for the only purpose to make money. We are actually laboratory rats abused by the healthcare industry for all kinds of treatments, we are kept in dependency and told that this would be improvement.



Crivens said:


> What it does with the planet is part of the price, and we might very well find us in a place where we cannot afford that any longer. IMHO we passed that point already. We need to drive technology ahead now, because nothing else has a potential to save us. And whoever doubts that the price is too hight when the bill comes around, I have some seafront estate in Florida you might find interesting.


I don't think the actual problem is that we are in a conflict with the planet - that is, with nature. Because, we ARE nature. I rather think the actual problem is that this advance we are undergoing is very difficult to stabilize in some healthy fashion. We are in a conflict not with nature or the planet, but with our own advance - it is a runaway process.
But then, this is nothing new at all: any highly developed civilisations have entered a state where they would fall apart due to inner corruption. And this again IS nature - the ancient vedic philosophers knew that and termed it Kali Yuga. And yes, this will destroy our civilisation, but this is nothing bad, it has happened before and will happen again anyway.


----------



## Crivens (Feb 17, 2021)

We once housed visitors from japan. A highly advanced nation. What did they buy for gifts to bring back home? Quality screwdrivers, swiss army knives, multitools, field glasses. Sandals. They emtied the tool shops for some cities around. Because that stuff was not available for sale back home.


----------



## olli@ (Feb 17, 2021)

PMc said:


> Yes, been thru that, didn't find much that would make the device (it was some elderly intel quad-port 1G) become not so hot (I was rather bothered with possible airflow planning than with energy consumption).
> 
> What seems more intereting is this (and most pci devices have that):
> 
> ...


You can suspend unused devices with devctl(8).


----------



## PMc (Feb 18, 2021)

olli@ said:


> You can suspend unused devices with devctl(8).


Wow, this works!
One can even suspend used devices, it's like unplugging the wire, they keep the routing when coming back. 


```
# devctl suspend alc0
# pciconf -lc alc0
alc0@pci0:3:0:0:        class=0x020000 card=0x85071043 chip=0x10911969 rev=0x10 hdr=0x00
    cap 01[40] = powerspec 3  supports D0 D3  current D3
    cap 10[58] = PCI-Express 1 endpoint max data 128(4096)
                 link x1(x1) speed 2.5(2.5) ASPM disabled(L0s/L1) ClockPM disabled
    cap 05[c0] = MSI supports 16 messages, 64 bit, vector masks
    cap 11[d8] = MSI-X supports 16 messages, enabled
                 Table in map 0x10[0x2000], PBA in map 0x10[0x3000]
    ecap 0001[100] = AER 1 0 fatal 1 non-fatal 0 corrected
    ecap 0003[180] = Serial 1 ffda320908606eff
```

Actually it seems to work nice for everything except the card where I would really like to use it. :/
This one works:
`igb1@pci0:1:0:1:        class=0x020000 card=0xa04c8086 chip=0x10c98086 rev=0x01 hdr=0x00
    cap 01[40] = powerspec 3  supports D0 D3  current D3
    cap 05[50] = MSI supports 1 message, 64 bit, vector masks
    cap 11[70] = MSI-X supports 10 messages, enabled
                 Table in map 0x1c[0x0], PBA in map 0x1c[0x2000]
    cap 10[a0] = PCI-Express 2 endpoint max data 256(512) FLR NS
                 link x4(x4) speed 2.5(2.5) ASPM disabled(L0s/L1)
    ecap 0001[100] = AER 1 0 fatal 0 non-fatal 1 corrected
    ecap 0003[140] = Serial 1 90e2baffff7e80ac
    ecap 000e[150] = ARI 1
    ecap 0010[160] = SR-IOV 1 IOV disabled, Memory Space disabled, ARI disabled
                     0 VFs configured out of 8 supported
                     First VF RID Offset 0x0180, VF RID Stride 0x0002
                     VF Device ID 0x10ca
                     Page Sizes: 4096 (enabled), 8192, 65536, 262144, 1048576, 4194304`

While this doesn't - it configures suspend, but doesn't change the D0 mode (and neither the heat dissipation):
`em3@pci0:4:0:1: class=0x020000 card=0x11bc108e chip=0x10bc8086 rev=0x06 hdr=0x00
    cap 01[c8] = powerspec 2  supports D0 D3  current D0
    cap 05[d0] = MSI supports 1 message, 64 bit enabled with 1 message
    cap 10[e0] = PCI-Express 1 endpoint max data 256(256) NS
                 link x4(x4) speed 2.5(2.5) ASPM disabled(L0s)
    ecap 0001[100] = AER 1 0 fatal 1 non-fatal 0 corrected
    ecap 0003[140] = Serial 1 001517ffffdc84ca`


----------



## Snurg (Mar 2, 2021)

There is an ongoing discussion about programming languages.

One question I never found being discussed is the energy-efficiency of programming languages.
But in terms of total cost of ownership, this might be(come) a relevant factor.
For example, I liked much how _*drhowarddrfine*_ told about his company, specialized on writing web server applications in C, mainly for speed.
What if one company has 1000 servers mainly working on PHP or other interpreting stuff? How many would be needed if the applications were written in, say, C? How big would the energy savings be financially?

I sometimes think about how much energy consumption would be needed to compensate for more man-hour-cost of developing energy-efficient software.
For rarely-used software that doesn't matter much, but for big heavy-duty services it might be relevant.

Does anybody know of research in this direction?


----------



## Mjölnir (Mar 2, 2021)

IIRC the computer scientists have a rule of thumb: _a good algorithm beats a good implementation_.


Spoiler: Tuning



Traditionally, SW engineers treat _runtime=cost_.  FMLU of tuning, it went like this:

measure the execution times in your scripted, interpreted application for your average workload.
Identify the most costly modules/routines.
For these: research if there's a better algorithm to do that. If yes, implement & go back to 1.
Have a close look on the data structures used & optimize them. Goto 1.
If it's still too slow, rewrite in the most suitable compiled language.  Whatever _"most suitable"_ means, depends... Often the choice was C/C++.



So you also want to measure energy consumption instead.  Nice idea.


Spoiler: PHP bashing



Not only PHP is ugly, it's broken by design because it mixes application data & logic, that's a no-go; using it is a criminal act against proven & reliable principles of SW engineering.  Thus the major benefit to replace that crap with a correctly designed webapp framework will be much greater than only in terms of energy.


Nowadays we have JIT compilers, which can adopt their optimization to runtime parameters, thus hand-crafted C/C++ modules are oldschool, usually inferior to JIT compilation & thus not needed, except in rare special cases.  Say what you want against JavaScript, AFAIK these _node.js_ wizzards wrote a damn good piece of SW.


----------



## Snurg (Mar 2, 2021)

Mjölnir said:


> Nowadays we have JIT compilers, which can adopt their optimization to runtime parameters, thus hand-crafted C/C++ modules are oldschool, usually inferior to JIT compilation & thus not needed, except in rare special cases.  Say what you want against JavaScript, AFAIK these _node.js_ wizzards wrote a damn good piece of SW.


Yes, but what I wonder is how efficient is it to load and run the JIT compilers gazillions of times.
No matter how efficient, this repetitive work with always the same result sums up both in energy and cost.


----------



## ralphbsz (Mar 2, 2021)

Snurg said:


> But in terms of total cost of ownership, this might be(come) a relevant factor.
> ...
> Does anybody know of research in this direction?


Lots. In the 90s and 2000s, I saw lots of work on this for the mobile (cell phone) applications, and there were lots of publications about that. I don't know whether that research is still ongoing, I have lost interest in it. And for server applications: there are lots of companies that have millions of servers. There a small improvement (like making a compiler's generated code 1% faster) have large effects. And the big companies that have thousands or tens of thousands of software engineers also measure programmer productivity. So the tradeoff between ease-of-development and efficient execution is carefully measured and managed.


----------

