News for hackers. Stuff that matters.
Re:Reworking 30 lines of Linux code could cut power use by u... by ryao on Monday April 21, 2025 @09:33AM (#43751854)
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 it makes it sound like this would also apply to desktop workloads. The article says it is for datacenters and that is true, but it would have been better had the title ended with the words “in datacenters” to avoid confusion.

Re:Reworking 30 lines of Linux code could cut power use by u... by fnordpiglet on Monday April 21, 2025 @12:07PM (#43753537)
It’s a lot more nuanced than that. Being in a data center doesn’t imply heavy network utilization. The caveat is clearly outlined in the article being workload based not deployment based. If you have a home machine doing network routing it would absolutely benefit from this. In fact I would say probably the vast majority of Linux installs are home network devices, just people don’t know it. Embedded Linux machines doing network routing or switching or IPS or NAS or whatever would benefit a lot from this. “Energy savings” can be seen as a green washing statement but on embedded budgets it’s a primary requirement.
Re:Reworking 30 lines of Linux code could cut power use by u... by taeric on Monday April 21, 2025 @12:11PM (#43753577)
I was curious how much this would be applicable to home routers.

I confess I'm dubious on major savings for most home users, though? At least, at an absolute level. 30% of less than five percent is still not that big of a deal. No reason not to do it, but don't expect to really see the results there.

Re:Reworking 30 lines of Linux code could cut power use by u... by fnordpiglet on Monday April 21, 2025 @12:16PM (#43753637)
For embedded it’s not about saving cost it’s about saving limited on board power. The lower the power demand of the device, the smaller and the more you can dedicate to other things.
Re:Reworking 30 lines of Linux code could cut power use by u... by taeric on Monday April 21, 2025 @12:23PM (#43753704)
Again, no reason not to do this change. I'm not clear it helps in this case, though? The savings is in low use time. During high use time, it is the same, right?
Re:Reworking 30 lines of Linux code could cut power use by u... by tuetuopay on Monday April 21, 2025 @12:43PM (#43753901)
Practically none of it would be applicable (if using a commercial router). They all use hardware offloading, and traffic seldom touches the CPU. Only "logical" tasks are raised to the CPU, like ARP resolution and the likes (what’s called "trap to cpu").

If you’re doing custom routing with a NUC or a basic Linux box, however, this would gain massive power savings because that box pretty much only does networking.

Re:Reworking 30 lines of Linux code could cut power use by u... by ori_b on Monday April 21, 2025 @04:13PM (#43755953)
Only if you're using busy polling. Very little software uses it, because it's only a good fit if you think pegging a CPU to reduce latency responding to packets is a good trade.
Re:Reworking 30 lines of Linux code could cut power use by u... by tuetuopay on Monday April 21, 2025 @06:46PM (#43757330)
Yup, you’re right. I always forget this patch only applies to opted-in polling and not automatic polling for interrupt moderation.
Re:Reworking 30 lines of Linux code could cut power use by u... by mrheosuper on Monday April 21, 2025 @09:55PM (#43758403)
if you run a VPN server, i assume all the traffic will come to CPU to decrypt, right?
Re:Reworking 30 lines of Linux code could cut power use by u... by jeffbee on Monday April 21, 2025 @12:21PM (#43753683)
What home router would be busy polling?
Re:Reworking 30 lines of Linux code could cut power use by u... by sandworm101 on Monday April 21, 2025 @12:52PM (#43753969)
Someone who decided to turn their old PC into a router because a youtube video daid "recycling" an old PC is more green despite the massive power suck.
Re:Reworking 30 lines of Linux code could cut power use by u... by jeffbee on Monday April 21, 2025 @01:47PM (#43754519)
I feel like I'm repeating myself, but there are no people out there running Linux and unintentionally busy polling their network interface. This is something almost nobody does.
Re:Reworking 30 lines of Linux code could cut power use by u... by Denvercoder9 on Monday April 21, 2025 @02:00PM (#43754645)
> If you have a home machine doing network routing it would absolutely benefit from this.

It most likely won't. This patch set only affects applications that enable epoll busy poll using the EPIOCSPARAMS ioctl. It's a very specialized option that's not commonly used by applications. Furthermore, network routing in Linux happens in the kernel, not in user space, so this patch set doesn't apply to it at all.

Re:Reworking 30 lines of Linux code could cut power use by u... by p_l on Monday April 21, 2025 @04:04PM (#43755868)
NAPI is not busy poll, though, and the way the article is worded suggests it's about NAPI.

Now, NAPI already was supposed to have some adaptiveness involved, so I guess it's possibly a matter of optimizing it.

But my system is compiling for now so will look at article more in depth later :V

Re:Reworking 30 lines of Linux code could cut power use by u... by Denvercoder9 on Tuesday April 22, 2025 @02:47AM (#43759640)
The article is terrible, this doesn't affect the default NAPI behaviour. See the LWN link posted elsewhere for a more detailed, technical discussion. From the patch set itself:

> If this [new] parameter is set to a non-zero value and a user application has enabled preferred busy poll on a busy poll context (via the EPIOCSPARAMS ioctl introduced in commit 18e2bf0edf4d ("eventpoll: Add epoll ioctl for epoll_params")), then application calls to epoll_wait for that context will cause device IRQs and softirq processing to be suspended as long as epoll_wait successfully retrieves data from the NAPI. Each time data is retrieved, the irq_suspend_timeout is deferred.

Re:Reworking 30 lines of Linux code could cut power use by u... by wkat4242 on Monday April 21, 2025 @04:24PM (#43756072)
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 to BSD (well there were other reasons too of course)

Re:Reworking 30 lines of Linux code could cut power use by u... by varjag on Monday April 21, 2025 @05:46PM (#43756870)
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.

Re:Reworking 30 lines of Linux code could cut power use by u... by wkat4242 on Tuesday April 22, 2025 @12:17AM (#43759027)
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 u... by varjag on Tuesday April 22, 2025 @03:31AM (#43759876)
No it's not an issue to me, just pointed out a factual mistake.
Re:Reworking 30 lines of Linux code could cut power use by u... by Gud on Tuesday April 22, 2025 @01:19AM (#43759268)
Linux has been a corporate project for at least 20 years.
Re:Reworking 30 lines of Linux code could cut power use by u... by varjag on Tuesday April 22, 2025 @03:31AM (#43759872)
That roots part in grassroots means something.
Re:Reworking 30 lines of Linux code could cut power use by u... by Gud on Tuesday April 22, 2025 @09:19AM (#43761767)
Yes, but I don't think it means what you think it means? Just because Linux was developed by basement dwelling hackers 20+ years ago, doesn't make it a grassroots project.

Arguably, the only somewhat mainstream operating systems today that deserve that label are the *BSDs. Haiku OS gets an honorable mention but I wouldn't consider Haiku OS to be mainstream.

Re:Reworking 30 lines of Linux code could cut power use by u... by varjag on Tuesday April 22, 2025 @02:47PM (#43765087)
It quite literally makes it a grassroots project.

> Arguably, the only somewhat mainstream operating systems today that deserve that label are the *BSDs.

I think the word you're looking for is 'sidelined'.

Re:Reworking 30 lines of Linux code could cut power use by u... by wkat4242 on Tuesday April 22, 2025 @04:47PM (#43766135)
Meh not really. I'm running BSD with the very latest software. KDE, Firefox, Chrome, LibreOffice. All rolling unlike most Linux distros. I really don't care how 'big' my OS is.

But yeah grassroots was perhaps not the right term. I meant the status quo, not the origin. I don't know what the right word is then though.

Re:Reworking 30 lines of Linux code could cut power use by u... by mmooss on Monday April 21, 2025 @10:18PM (#43758513)
> I would say probably the vast majority of Linux installs are home network devices

I'm expect there are many, but the vast majority are likely massive datacenters with hundreds of thousands of machines each running multiple instances, and also Android phones are probably more common than home equipment. Edit: Also IoT, as someone else points out.

Re:Reworking 30 lines of Linux code could cut power use by u... by chasil on Wednesday April 23, 2025 @04:51PM (#43776505)
The vast majority of Linux kernels run on Android.

I would be shocked if I am incorrect.

Re:Reworking 30 lines of Linux code could cut power use by u... by mmooss on Wednesday April 23, 2025 @09:44PM (#43778531)
I could see that being right. At the same time, how many servers running Linux are there, and how many instances per server?
Re:Reworking 30 lines of Linux code could cut power use by u... by ryao on Tuesday April 22, 2025 @01:45AM (#43759371)
> It’s a lot more nuanced than that. Being in a data center doesn’t imply heavy network utilization.

I suggest you reread “software used in datacenters (e.g. by CDNs) that does use it”. This is not a reference to software in a datacenter. It is a reference to software in a datacenter that uses it, which is a subset of the former.

Re:Reworking 30 lines of Linux code could cut power use by u... by jes5199 on Monday April 21, 2025 @10:33AM (#43752455)
you don’t have to say “in datacenters” when talking about linux, that is the obvious context in the vast majority of cases
Re:Reworking 30 lines of Linux code could cut power use by u... by panzi on Monday April 21, 2025 @10:49AM (#43752631)
I'm reading this on an Android phone. The phone OS that has over 70% market share.
Re:Reworking 30 lines of Linux code could cut power use by u... by casey2 on Monday April 21, 2025 @10:19PM (#43758521)
Linux is a tiny tiny part of the OS on phones. Power usage is most certainly not handled by android or linux in the vast majority of cases.

Who in their right mind would leave something so critical to the success of their product to a general purpose OS designed for mainframes and slightly redesigned for PCs?

Re:Reworking 30 lines of Linux code could cut power use by u... by matkoniecz on Monday April 21, 2025 @10:51AM (#43752654)
Why you think so? Especially for HN readers decent chunk is using Linux.

(I typed this on Linux PC).

Re:Reworking 30 lines of Linux code could cut power use by u... by devsda on Monday April 21, 2025 @11:04AM (#43752772)
Agree. On reading the headline, I was hoping it would extend my laptop battery life.
Re:Reworking 30 lines of Linux code could cut power use by u... by tisdadd on Monday April 21, 2025 @11:14AM (#43752877)
Same here, I have used Linux as my main for a long time. Though, I would imagine that data centers do have more instances than the desktops and laptops around the world combined.
Re:Reworking 30 lines of Linux code could cut power use by u... by helij on Monday April 21, 2025 @12:43PM (#43753898)
And another one here!
Re:Reworking 30 lines of Linux code could cut power use by u... by ajross on Monday April 21, 2025 @11:21AM (#43752975)
This is a naming mistake. You're taking "Linux" in the sense of "Linux Distribution", where the various competitors have seen most of their success in the datacenter.

This is specifically a change to the Linux kernel, which is much, much more broadly successful.

Re:Reworking 30 lines of Linux code could cut power use by u... by ptero on Monday April 21, 2025 @10:38AM (#43752511)
IME majority of linux systems are laptops and desktops.
Re:Reworking 30 lines of Linux code could cut power use by u... by jolmg on Monday April 21, 2025 @10:43AM (#43752570)
Without looking at stats, I would think android phones.
Re:Reworking 30 lines of Linux code could cut power use by u... by billy99k on Monday April 21, 2025 @12:46PM (#43753925)
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.
Re:Reworking 30 lines of Linux code could cut power use by u... by hasperdi on Monday April 21, 2025 @01:08PM (#43754139)
Linux is the kernel. Android uses a forked version of the mainline Linux
Re:Reworking 30 lines of Linux code could cut power use by u... by murderfs on Monday April 21, 2025 @01:25PM (#43754312)
Everyone uses a forked version of the mainline Linux.
Re:Reworking 30 lines of Linux code could cut power use by u... by voidspark on Monday April 21, 2025 @11:16PM (#43758794)
No they don’t. Android has a fork but that is not common. 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 u... by kbolino on Monday April 21, 2025 @05:51PM (#43756916)
This means it's not GNU/Linux, but that's not the only flavor of Linux. Alpine uses busybox and musl instead of GNU userland and glibc, but few would say it's not a Linux distribution.
Re:Reworking 30 lines of Linux code could cut power use by u... by voidspark on Monday April 21, 2025 @11:14PM (#43758790)
Linux is a kernel, not an operating system.
Re:Reworking 30 lines of Linux code could cut power use by u... by panzi on Tuesday April 22, 2025 @12:36PM (#43764000)
It's Android/Linux, not GNU/Linux.
Re:Reworking 30 lines of Linux code could cut power use by u... by homarp on Monday April 21, 2025 @10:43AM (#43752572)
at least inside docker or wsl
Re:Reworking 30 lines of Linux code could cut power use by u... by jonhohle on Monday April 21, 2025 @12:30PM (#43753785)
Docker wouldn’t be affected by this, the network stack is lower. WSL would, however.
Re:Reworking 30 lines of Linux code could cut power use by u... by Tireings on Monday April 21, 2025 @11:44AM (#43753246)
Indeed he has to.
Re:Reworking 30 lines of Linux code could cut power use by u... by teeray on Monday April 21, 2025 @10:48AM (#43752624)
IoT devices would like a word
Re:Reworking 30 lines of Linux code could cut power use by u... by nottorp on Monday April 21, 2025 @01:51PM (#43754555)
So it's not even on by default, it needs to be turned on explicitly?
Re:Reworking 30 lines of Linux code could cut power use by u... by eichin on Monday April 21, 2025 @02:47PM (#43755133)
heh, will this become the equivalent of "in mice" for bio papers?
Re:Reworking 30 lines of Linux code could cut power use by u... by mmooss on Monday April 21, 2025 @10:14PM (#43758490)
> The article name is somewhat misleading, since it makes it sound like this would also apply to desktop workloads.

The article name is, Data Centers Can Slash Power Needs With One Coding Tweak: Reworking 30 lines of Linux code could cut power use by up to 30 percent

The article says, “It is sort of a best case because the 30 percent applies to the network stack or communication part of it,” Karsten explains. “If an application primarily does that, then it will see 30 percent improvement. If the application does a lot of other things and only occasionally uses the network, then the 30 percent will shrink to a smaller value.”

It seems you only read the HN title? If so, why bother to critique the article's title?

Re:Reworking 30 lines of Linux code could cut power use by u... by casey2 on Monday April 21, 2025 @10:17PM (#43758510)
But linux use outside datacenters and server farms is irrelevant in terms of power use anyways I don't think anybody would be confused in the context of power usage.
Re:Reworking 30 lines of Linux code could cut power use by u... by RachelF on Monday April 21, 2025 @11:03PM (#43758716)
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.