14 comments

  • ameliaquining2 hours ago
    This post comes uncomfortably close to plagiarizing <a href="https:&#x2F;&#x2F;thebuild.com&#x2F;blog&#x2F;2026&#x2F;04&#x2F;23&#x2F;preempt_none-is-dead-your-postgres-probably-doesnt-care&#x2F;" rel="nofollow">https:&#x2F;&#x2F;thebuild.com&#x2F;blog&#x2F;2026&#x2F;04&#x2F;23&#x2F;preempt_none-is-dead-yo...</a>, 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., &quot;What Linux 7.0 actually changed&quot; in Pettus&#x27;s post to &quot;What Is Preemption?&quot; in this one. I think this link should have been to Pettus&#x27;s post instead.
    • jdonaldson1 hour ago
      That post comes uncomfortably close to how Opus writes this kind of prose. It&#x27;s a good idea to acknowledge all stakeholders.
    • galkk15 minutes ago
      After your comment I went to original and it really looks like ai assisted rewrite with prompt like “give more explanations about basic concepts”…
    • teivah49 minutes ago
      I used that post as a source yes, and it’s stated explicitly but it’s not the only one. One section in particular is similar since we both present the different preemption modes. However, both audiences are different. thebuild.com has an audience composed of PostgreSQL enthusiasts (if not experts) and I don’t. So a significant part of my post was about explaining things from first principles (what’s a page, a TLB, a spinlock, etc.). I explain way more “basic” things and he goes beyond me in terms of how to cope with the problem. I don’t think the posts are closed.
  • fulafel57 minutes ago
    &gt; PREEMPT_NONE: The kernel almost never interrupts a running thread<p>This seems confused. These are options for preemptibility of the kernel, which is a relatively modern fearure. Userspace could always be preempted and these options do not change anything there. The kernel must in any case frequently interrupt threads and processes to implement preemptive multitasking which Linux of course had since the beginning.<p>Read more eg at <a href="https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;944686&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;944686&#x2F;</a> or help texts at <a href="https:&#x2F;&#x2F;github.com&#x2F;torvalds&#x2F;linux&#x2F;blob&#x2F;master&#x2F;kernel&#x2F;Kconfig.preempt" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;torvalds&#x2F;linux&#x2F;blob&#x2F;master&#x2F;kernel&#x2F;Kconfig...</a>
  • ozgrakkurt2 hours ago
    It is a crime that postgres isn&#x27;t able to allocate with 1GB huge pages by changing a config parameter in 2026<p>Also a crime that people are still running databases with 4kb pages.<p>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.
    • ldargin20 minutes ago
      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.
    • dezgeg2 hours ago
      Even worse, the actual struct page on Linux is 64 bytes, so 4x your example
    • bonzini2 hours ago
      There <i>is</i> 64 bytes of metadata per memory page indeed.
    • andrewstuart1 hour ago
      Sensible defaults would be nice.
  • buster2 hours ago
    I&#x27;d rather like to know if any real world usage broke, before coming to the conclusion that an edge case synthetic benchmark is worth changing the kernel (back or wherever) where supposedly the change that broke the benchmark had real world benefits.<p>Since we will never know it might be a good idea to feature gate the change, change the default and let users decide to change it back. This may give some feedback on the lkml or else to decide if the change is worthwhile?
    • nijave2 hours ago
      &quot;synthetic benchmark&quot; is doing some heavy lifting here. Pgbench just runs a bunch of SQL statements against a real Postgres instance.<p>It&#x27;s very close to a real world simulation of a production workload
      • buster2 hours ago
        I am not questioning the benchmark. But the benchmark is NOT measuring a real world application in a real world setting. Anyway, I am merely wondering IF there is a company out there affected, at all. I understand that this was only measured on a graviton 4 setting with very heavy lifting, without huge tables.<p>For example, this issue aside, I&#x27;d rather split such a workload into multiple smaller instances, naturally. Because the impact of a crash on this single node, heavy load, many cores, many clients scenario would be huge.
  • MBCook2 hours ago
    This only happened under a very odd configuration. Yeah it wasn’t great but it was not the normal case.<p>The headline implies it broke PG everywhere. It didn’t.
  • selckin3 hours ago
    <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=47644864">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=47644864</a>
  • fabian2k41 minutes ago
    That regression is maybe most useful as a reminder to people to configure huge pages for PostgreSQL. That&#x27;s the one recommended basic performance tuning that is just annoying enough to set up that I suspect many people with smaller DBs will skip it.<p>Though I actually don&#x27;t know how large shared buffers has to be for huge pages to make a noticeable difference.
  • ahartmetz2 hours ago
    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.<p>It only took a few decades for Linux to get a good CPU scheduler and good I&#x2F;O schedulers, too. I don&#x27;t get how such an important area can be so bad for so long. But then, bad scheduling is <i>everywhere</i>. I find it to be a pretty fun area to work in, but, judging by how much it is less than half-assed in much existing software, most developers seem to hate dealing with it?
    • AlienRobot46 minutes ago
      One thing I miss from using Windows is that the desktop didn&#x27;t just freeze completely if you ran out of RAM.<p>At first I thought that maybe Linux doesn&#x27;t have ways to give priority to the desktop environment (a.k.a. &quot;graphical shell&quot;) which is why running out of RAM means your cursor starts lagging, clicking on things stops working, etc.<p>But maybe Linux is just bad at that in general and a single process eating too much RAM can simply bring the whole system to a halt as it tries to move and compress RAM to a pagefile on an HDD (not SSD).<p>Every time it happens to me I just find it so incredible. Here I am with a PC with a multiple cores, multiple processors, and a single process eating all the RAM can bottleneck ALL of them at once? Am I misunderstanding something? Shouldn&#x27;t it, ideally, work in such way that so long as one processor is free, the system can process mouse input and render the cursor and do all the desktop stuff no matter what I&#x2F;O is happening in the background?<p>Since it&#x27;s Linux maybe it&#x27;s just my DE&#x2F;distro (Cinnamon&#x2F;Mint). Maybe it does allocations under the assumption there will always be a few free bytes in RAM available, so it halts if RAM runs out while some other DE wouldn&#x27;t. But even then you&#x27;d think there would be a way to just reserve &quot;premium&quot; memory for critical processes so they never become unresponsive.<p>I wonder if other people have the same experience as me. This part of Linux just always felt fundamentally poor for me.
      • rcxdude30 minutes ago
        This issue is much worse if you don&#x27;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&#x27;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 &#x27;just&#x27; a memory mapped file. So eventually most of the code that is actively trying to run is being pushed out of RAM and must be loaded in as it executes, slowing everything to a crawl and generally creating a death spiral. If you have swap the kernel can decide to put other pages onto disk and keep the more important stuff in memory. Or you can run something like early-oom which stops things from getting to that point in the first place (albeit in a somewhat brute-force manner).<p>Dealing with low-memory situations elegantly is pretty hard: firstly Linux uses memory overcommit by default, in part because the semantics of fork imply very large memory commitments which are almost never realised, and in part because a lot of software does the same because it&#x27;s the default. Secondly, managing allocation failures is often tricky and ill-tests, and often requires co-ordination between different systems. The DE could, though, in principle, put running applications in a container which would prevent them from using above a certain amount of memory, but the results are similar to early-oom in that the result of reaching the limit is almost certainly the termination of the process using the most memory.
      • jcgl32 minutes ago
        Same experience here. Linux admin. I’d absolutely <i>love</i> to be told I’m holding it wrong, but all I can see is that there’s no way to hold it right.<p>Your consternation is seconded.
        • baq6 minutes ago
          It’s even worse than that… you can hard lock a system with significant freeable memory left if you have insane vm.dirty_* settings (which is of course the case by default)
        • rcxdude29 minutes ago
          The two mitigations are to: - (somewhat counterintuitively) have swap enabled - run something like earlyoom to stop the system from reaching a low-RAM situation in the first place.
    • bobmcnamara1 hour ago
      Userspace spinlocks seem like a bad idea too.<p>What if it was on a VM and the core holding the lock got descheduled from the hypervisor?
  • nijave2 hours ago
    Right on the heels of 6.19 breaking tcmalloc and Mongo
    • matharmin1 hour ago
      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.<p><a href="https:&#x2F;&#x2F;jira.mongodb.org&#x2F;browse&#x2F;SERVER-121885" rel="nofollow">https:&#x2F;&#x2F;jira.mongodb.org&#x2F;browse&#x2F;SERVER-121885</a>
      • duskwuff25 minutes ago
        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.<p><a href="https:&#x2F;&#x2F;lore.kernel.org&#x2F;all&#x2F;20260126204745.GP171111@noisy.programming.kicks-ass.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lore.kernel.org&#x2F;all&#x2F;20260126204745.GP171111@noisy.pr...</a>
  • jeltz1 hour ago
    Moderators should change this headline because it is nowhere near true. It only regressed performance on some incorrect configurations.
  • ApolloFortyNine2 hours ago
    I can&#x27;t help but think of the classic XKCD example of breaking a user&#x27;s workflow [1].<p>Doing research though a spinlock actually doesn&#x27;t seem as unusual a hack as it would first seem, do drivers and the like not have similar issues because they don&#x27;t trigger a page fault I guess?<p>[1] <a href="https:&#x2F;&#x2F;xkcd.com&#x2F;1172&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;1172&#x2F;</a>
  • baq3 hours ago
    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&#x27;m not paying for RDS and auroras like that in production!)
    • Twirrim2 hours ago
      Huge pages has had a spotty history, that lead to people being paranoid about it, and no doubt a whole bunch of folks just disable it &quot;because that&#x27;s what we&#x27;ve always done&quot;. It has been stable and reliable for quite a while now, would really hope folks could move away from that perspective.
      • jeltz1 hour ago
        Are you sure you are not thinking of transparent huge pages? They have a spotty history but you are supposed to run big PostgreSQL instances with huge pages, not transparent huge pages.
      • nijave2 hours ago
        I tested it once about 2 years ago on Azure VM and got a nice 10-15% perf boost on pgbench (I want to say at least 64GB shared mem)
      • lstodd1 hour ago
        I remember when support for them just appeared and you had to LD_PRELOAD a shim IIRC to make Postgres actually use them we jumped on it, enabled them immediately and got a pretty significant boost, around 15-20%, yes.<p>That was idk, 2008-9 -ish? I don&#x27;t know what spotty history you are talking about, if you have multigigabyte address spaces floating on a machine it&#x27;s stupid not to use hugepages.
    • nijave2 hours ago
      In fairness, AWS could (and almost certainly is) using their own kernel build that does who-knows-what
    • mplanchard2 hours ago
      Also was only on ARM, wasn’t it?
    • dist-epoch2 hours ago
      Many people have desktops with 128 GB RAM. Should they enable hugepages? I&#x27;ve never heard this recommendation for a desktop.
      • nijave2 hours ago
        Huge pages is good when a single process is reserving a giant block of memory which I think isnt that common.<p>You might have transparent huge pages on by default depending on the distro
      • baq12 minutes ago
        If they’re running any sort of a vm (which they probably do with this amount of ram) they absolutely should and also should consider pre-reserving them.
  • dataflow2 hours ago
    An X% performance regression is basically a (100 - X)% feature breakage, so whatever that implies in terms of breaking userspace...
  • PunchyHamster3 hours ago
    Seems Linus needs to yell at someone again.<p>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
    • nobleach2 hours ago
      I get that folks love a good Linus rant. But as someone who&#x27;s been at the end of that style of &quot;feedback&quot;, nothing can be more humiliating or demotivating. Certainly there are contributors that are making &quot;rookie mistakes&quot;. There are folks that aren&#x27;t willing to ingest the entire context of what was tried back in 2.0.36, 2.2, 2.4... etc. And perhaps it&#x27;s wise to simply stay away until you&#x27;re completely certain you&#x27;ve got the chops to contribute. More than half the folks that enjoy that sort of abuse don&#x27;t have those chops.<p>I can defend someone who is unwilling to yield on quality. Afterall, this truly is his baby. Issuing scathing rebukes to well-intentioned contributors is like slapping my kid when he brings me the wrong type of screwdriver.
      • ecshafer2 hours ago
        I don&#x27;t think a Linus rant ever hit anyone that was a rookie, they are always AFAIK against people &quot;who should know better&quot;. Veteran developers, with multiple commits merged.
      • slackfan1 hour ago
        Code quality does not care about your feelings.
      • themafia1 hour ago
        &gt; scathing rebukes<p>Would you be able to point one out?<p>&gt; to well-intentioned contributors<p>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 &quot;good intentions&quot; but we don&#x27;t enjoy the same largess of people with &quot;good skills.&quot;
      • colechristensen2 hours ago
        If you&#x27;re at the level of delivering to Linus, I&#x27;m sorry but humiliation and demotivation are earned.<p>You don&#x27;t talk like this to junior or even senior engineers, but you do reach a level at which gently telling isn&#x27;t necessary.<p>If you don&#x27;t like it go fork Linux and try being the nice benevolent dictator and we&#x27;ll applaud your success.
    • bonzini2 hours ago
      Nope, there was and will be no yelling.