Live data from Hacker News

Reworking 30 lines of Linux code could cut power use by up to 30 percent

spectrum.ieee.org

101–110 of 123 posts

Re: Reworking 30 lines of Linux code could cut power use by up to 30 percent

#101
post #76

Does this mean that "adaptive interrupt mitigation" is no longer a thing in the kernel? I haven't really messed with it in ~15+ years, but it used to be that the kernel would adapt, if network rate was low it would use interrupts, but then above a certain point it would switch to turning off interrupts and using polling instead. The issue I was trying to resolve was sudden, dramatic changes in traffic. Think: a loop…

Adaptive IRQ moderation is a hardware feature. https://edc.intel.com/content/www/us/en/design/products/ethe...

Which most networking hardware supports.

Re: Reworking 30 lines of Linux code could cut power use by up to 30 percent

#102

One thing I didn’t see mentioned here yet: a lot of high-performance data center workloads don’t actually go through the Linux kernel’s network stack at all. Instead, they use DPDK, XDP, or userspace stacks like Onload or VMA—often with SmartNICs doing hardware offload. In those cases, this patch wouldn’t apply, since packet processing happens entirely outside the kernel. That doesn’t mean the patch isn’t valuable—it…

There are a whole lot of commodity 1-2U rack mount boxes running RHEL or CentOS or the like out there that are mostly idle, and which don’t do anything fancier in hardware than maybe checksum or VLAN offload.

Re: Reworking 30 lines of Linux code could cut power use by up to 30 percent

#103
post #5

Linux added a busy polling feature for high performance networking. Most Linux software does not use it, but software used in datacenters (e.g. by CDNs) that does use it makes the system very energy inefficient when things are not busy. This patch gives the the kernel the ability to turn that off when not busy to regain energy efficiency until things become busy again. The article name is somewhat misleading, since i…

I appears that this academic is very good at public relations.

They mix interrupts and polling depending on the load. The interrupt service routine and user-kernel context-switch overhead is tiny computationally and hence in power usage.

Also, most network hardware in the last twenty years has had buffer coalescing, reducing interrupt rates.

Re: Reworking 30 lines of Linux code could cut power use by up to 30 percent

#104
post #14

Earlier quoted context omitted.

Without looking at stats, I would think android phones.

Android isn't Linux. While Android uses the Linux kernel, it's not a standard Linux distribution. It has its own user space and libraries, making it a distinct operating system.

Linux is a kernel, not an operating system.

Re: Reworking 30 lines of Linux code could cut power use by up to 30 percent

#105

Earlier quoted context omitted.

Linux is the kernel. Android uses a forked version of the mainline Linux

Everyone uses a forked version of the mainline Linux.

Some distributions apply patches to the kernel but they don’t fork it.

Re: Reworking 30 lines of Linux code could cut power use by up to 30 percent

#106
post #51
post #38

Earlier quoted context omitted.

Absolutely. It is unfortunate that many software engineers continue to dismiss this as "premature optimization". But as soon as I see resources or server costs gradually rising every month (even on idle usage) costing into the tens of thousands which is a common occurrence as the system scale, then it becomes unacceptable to ignore.

When you achieve expertise you know when to break the rules. Until then it is wise to avoid premature optimization. In many cases understandable code is far more important. I was working with a peer on a click handler for a web button. The code ran in 5-10ms. You have nearly 200ms budget before a user notices sluggishness. My peer "optimized" the 10ms click handler to the point of absolute illegibility. It was doubtf…

Depending on your spend on infrastructure and the business revenue, if the problem is not causing the business to increase spending on infrastructure each month or if there’s little to no rise in user complaints over slow downs, then the “optimization” isn’t worth it and is then premature.

Most commonly, If the costs increase as the users increase it then becomes an issue with efficiency and the scaling is not good nor sustainable which can easily destroy a startup.

In this case, the Linux kernel is directly critical for applications in AI, real time systems, networking, databases, etc and performance optimizations and makes a massive difference.

This article is a great example of properly using compiler optimizations to significantly improve performance of the service. [0]

[0] https://medium.com/@utsavmadaan823/how-we-slashed-api-respon...

Re: Reworking 30 lines of Linux code could cut power use by up to 30 percent

#107
post #86

Earlier quoted context omitted.

There should have been an off switch from the beginning though IMO, though perhaps there already is? But the number of corporates messing with the kernel for their own purposes greatly outnumbers the number of independent developers. That gives big tech a big influence. And the Linux Foundation is there to cement that influence. I much prefer grassroots projects. Made by and for people like me <3 That's why I moved t…

Uh Linux is a grassroots project, quite unlike Berkley Software Distribution. Also no you are entirely unaffected by this unless you use a very specific and uncommon syscall.

It was originally, yes. There's a lot of corporate influence now (just look at the monthly kernel submissions). https://news.itsfoss.com/huawei-kernel-contribution/

Like others have mentioned, it's just a huge deal in the data center now. With that comes a lot of influence by corporates interests.

Whereas BSD has gone the opposite way. Started by Berkeley but abandoned to the community. Business is not really interested in that because anything they contribute can be used by anyone for anything (even their competitors can use it in closed source code). Netflix was the biggest user but I don't think they contribute anymore either. WhatsApp used it until Facebook acquired them. That leaves netgate and ix systems which are small. Netgate pushed a really terrible wireguard once but it was nipped in the bud luckily. https://arstechnica.com/gadgets/2021/03/buffer-overruns-lice... It also highlighted many trust issues which have been improved since.

Of course whether this is an issue for you is very personal. For me it is but clearly for a lot more people it isn't, as Linux is s lot more popular.

Re: Reworking 30 lines of Linux code could cut power use by up to 30 percent

#108
post #22

The flip side of this is meta having a hack that keeps their GPUs busy so that the power draw is more stable during llm training (eg don't want a huge power drop when synchronizing batches)

That goes against separation of concerns. A separate utility must be created for that specific purpose, not hidden in some other part of the system

Re: Reworking 30 lines of Linux code could cut power use by up to 30 percent

#110
post #86

Earlier quoted context omitted.

There should have been an off switch from the beginning though IMO, though perhaps there already is? But the number of corporates messing with the kernel for their own purposes greatly outnumbers the number of independent developers. That gives big tech a big influence. And the Linux Foundation is there to cement that influence. I much prefer grassroots projects. Made by and for people like me <3 That's why I moved t…

Uh Linux is a grassroots project, quite unlike Berkley Software Distribution. Also no you are entirely unaffected by this unless you use a very specific and uncommon syscall.

Linux has been a corporate project for at least 20 years.
Post reply on HN