Live data from Hacker News

Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

read.thecoder.cafe

61–70 of 73 posts

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#61
post #29

Moderators should change this headline because it is nowhere near true. It only regressed performance on some incorrect configurations.

What is considered incorrect?

Edit: It may not be optimal or recommended config but I was under the impression it's very close to default config. As far as I know, most popular distros are shipping with no hugepage pool reservation and shared memory transparent hugepages disabled.

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#62
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.

No, but code quality can suffer if you piss off all the competent people and they leave

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#63
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…

> 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."

Not as scathing as some but recent

https://lore.kernel.org/all/CAHk-=wiLdmz92CCfu2+-9_UrGSn6Pu6...

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#64
post #4

TLDR of the LMKL thread: 120GB RAM postgres with hugepages=off, lock contention went from terrible to abysmal. nothing to see here except that amazon for whatever reason runs DB tests with huge pages disabled. (hope I'm not paying for RDS and auroras like that in production!)

Also was only on ARM, wasn’t it?

I think that ended up being a red herring. It just happened to be the case that the ARM test had huge pages disabled while the AMD64 test had them enabled.

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#65
post #40

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…

Same experience here. Linux admin. I’d absolutely love to be told I’m holding it wrong, but all I can see is that there’s no way to hold it right. Your consternation is seconded.

zram + no swap is a surprisingly workable workaround IME. The system slows down by a factor of 100 or so instead of 100000 or so, which allows to kill the offending process in a few seconds or have it killed by the OOM killer faster than a reboot.

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#66
post #4

TLDR of the LMKL thread: 120GB RAM postgres with hugepages=off, lock contention went from terrible to abysmal. nothing to see here except that amazon for whatever reason runs DB tests with huge pages disabled. (hope I'm not paying for RDS and auroras like that in production!)

> nothing to see here except that amazon for whatever reason runs DB tests with huge pages disabled

do you consider huge pages disabled as some discouraged config? If data doesn't fit into memory, it means single lookup will read multiple NVME pages instead of single, which could lead to significant regression.

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#67
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.

I don't think hardware page size has to match database page size. It would if Postgres was mmap'ing it. https://www.postgresql.org/docs/current/runtime-config-prese... says the database page size is 8KB by default.

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#68

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.

> It is a crime that postgres isn't able to allocate with 1GB huge pages by changing a config parameter in 2026

It is able to? Configure huge_page_size=1GB?

Support for 2MB pages was added in 2014, for larger pages 2020.

Edit: year details.

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#69
They got rid of PREEMPT_NONE? Just a while ago they got rid of slab, and the noop io scheduler. Why do they insist on removing features that don't make sense on a desktop according to some random bozo? Not everyone is running a dyntick laptop.

Re: Linux 7.0 Broke PostgreSQL: The Preemption Regression Explained

#70

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.

> It is a crime that postgres isn't able to allocate with 1GB huge pages by changing a config parameter in 2026 It is able to? Configure huge_page_size=1GB? Support for 2MB pages was added in 2014, for larger pages 2020. Edit: year details.

Didn't know that, thanks. Sorry for the wrong comment.
Post reply on HN