Live data from Hacker News

Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

read.thecoder.cafe

51–60 of 73 posts

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#51
post #45

This post comes uncomfortably close to plagiarizing https://thebuild.com/blog/2026/04/23/preempt_none-is-dead-yo... , which it cites as a source; almost all the technical explanation is in there and some of the wording is extremely similar. Compare, e.g., "What Linux 7.0 actually changed" in Pettus's post to "What Is Preemption?" in this one. I think this link should have been to Pettus's post instead.

After your comment I went to original and it really looks like ai assisted rewrite with prompt like “give more explanations about basic concepts”…

[deleted]

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#52
post #44

It is a crime that postgres isn't able to allocate with 1GB huge pages by changing a config parameter in 2026 Also a crime that people are still running databases with 4kb pages. To put it in perspective, this means you will have more than 30 million pages on a server with 128GB RAM. As an example, if there is 16bytes of metadata for memory page. The metadata itself would take more than half a gigabyte.

Database systems lock pages when writing to them, to maintain integrity. Using 1GB pages would cause excessive blocking in many if not most transactional databases.

In database engines that use page locks, the locked page size can be different from the file/mapped/allocated page sizes. If you still have excessive locking while using smaller page locks, there are other ways to reduce contention as well, such as CoW to protect concurrent reads, deferred write-merging to assist concurrent writes, and the storage equivalent of RCU.

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#53
post #6

Earlier quoted context omitted.

I get that folks love a good Linus rant. But as someone who's been at the end of that style of "feedback", nothing can be more humiliating or demotivating. Certainly there are contributors that are making "rookie mistakes". There are folks that aren't willing to ingest the entire context of what was tried back in 2.0.36, 2.2, 2.4... etc. And perhaps it's wise to simply stay away until you're completely certain you've…

Code quality does not care about your feelings.

[deleted]

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#54
post #41

Earlier quoted context omitted.

One thing I miss from using Windows is that the desktop didn't just freeze completely if you ran out of RAM. At first I thought that maybe Linux doesn't have ways to give priority to the desktop environment (a.k.a. "graphical shell") which is why running out of RAM means your cursor starts lagging, clicking on things stops working, etc. But maybe Linux is just bad at that in general and a single process eating too mu…

This issue is much worse if you don't have swap. What happens, I think, is that as memory allocated by processes grows to fill the available RAM, it starts to push out memory that doesn't technically need to be in RAM, like cached file pages. Which accounts for some of the slowdown, until it reaches the code itself, which is 'just' a memory mapped file. So eventually most of the code that is actively trying to run is…

Yes, but the problem, I feel, is the priority of what gets pushed out to RAM on Linux.

You could split the processes into 2 categories:

1: applications that are doing tasks the user wants.

2: OS processes that the user needs to interact with in order to terminate applications.

There is an argument for applications taking priority: the user wants to do a task, if you move application out of RAM, the task is going to take longer.

But to me OS processes, including the graphical shell (taskbar, windowing system, etc.), should have priority: if an application hangs on I/O, the user NEEDS to be able to use the taskbar in order to terminate the application, otherwise they're going to have to wait who knows how long for the application to finish its task (or just hard reset the computer).

I don't know anything about how Linux handles memory, but the impression I have is that it has its priorities wrong, or it may not even have a way to configure priorities (unlikely), or maybe there is a to prioritize what is kept in memory but it only splits kernel/userspace memory so DE's that sit in userspace don't get priority (i.e. it's inadequate for a graphical operating system).

To be frank, as a desktop Linux user my biggest fear is that the Linux kernel is perfectly capable of prioritizing kernel/userspace memory, but it has no way to prioritize DE's. In other words, that the "graphical OS" use case of Linux is a second-class citizen, a feature bolted on top of GNU/Linux/Systemd. Because that would mean a lot of things are considered only from the perspective of a Linux server. This is only my imagination talking, since I'm not really involved with how Linux works. But to be fair I was never involved with how Windows worked either, and I never doubted it considered desktop a primary use case.

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#55

I can't help but think of the classic XKCD example of breaking a user's workflow [1]. Doing research though a spinlock actually doesn't seem as unusual a hack as it would first seem, do drivers and the like not have similar issues because they don't trigger a page fault I guess? [1] https://xkcd.com/1172/

From what I understand userspace spinlocks are particularly hazardous whereas in-kernel spinlocks are the norm

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#56

Seems Linus needs to yell at someone again. Especially with containers around you might very well hit the case of running new kernel but older version of PostgreSQL with no code mitigation for the problem

This was my first thought. How long was the Linus rant.

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#57

PREEMPT_LAZY triggering on page faults seems like a bad idea in light of this. It is probably not a good idea to suspend processes right when they get unexpectedly bogged down. The logic makes a little more sense for syscalls that are expected to take long compared to a scheduling quantum (a few milliseconds). But page faults are mostly invisible and unplannable. It only took a few decades for Linux to get a good CPU…

One thing I miss from using Windows is that the desktop didn't just freeze completely if you ran out of RAM. At first I thought that maybe Linux doesn't have ways to give priority to the desktop environment (a.k.a. "graphical shell") which is why running out of RAM means your cursor starts lagging, clicking on things stops working, etc. But maybe Linux is just bad at that in general and a single process eating too mu…

More aggressive oomkiller and cgroups have helped in recent years

Edit: systemd-oomd is what I was thinking of

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#58
post #49

Earlier quoted context omitted.

> scathing rebukes Would you be able to point one out? > to well-intentioned contributors This is a system used and relied upon by billions of people around the world. Your intentions, while good, are not material to the problem. Put another way we have an endless supply of people with "good intentions" but we don't enjoy the same largess of people with "good skills."

https://lwn.net/Articles/343828/ describes Alan Cox trying to fix the TTY layer, being trashed by Linus, and removing himself from the maintainer page.

I find it hard to call this a "scathing rebuke:"

https://lkml.org/lkml/2009/7/28/373

It also didn't just happen out of the blue. It's also true that Alan had already been working on the kernel for 15 years, was an employee of RedHat at the time, and his Wife's health was starting to fail.

If you follow the thread it goes back and forth across quite a few messages with frustration building on both sides with Alan ultimately deciding to step away from a single (and very hairy) subsystem.

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#59

Earlier quoted context omitted.

Yup - interesting to see so much written about Postgres having a performance regression on Linux 7.0, in a scenario that affects almost no-one in practice. Meanwhile MongoDB refuses to run at all on Linux 7.0 due to some issue with tcmalloc. https://jira.mongodb.org/browse/SERVER-121885

The underlying tcmalloc issue is interesting - the library was relying on an implementation detail of the rseq kernel API which was never guaranteed, and which already generated warnings in previous versions. https://lore.kernel.org/all/20260126204745.GP171111@noisy.pr...

Implemented behavior of the interface vs documented behavior of the interface

I thought the warnings were only generated when you turned on a kernel config "that no one uses in practice"

Post reply on HN