61 comments

[ 3.0 ms ] story [ 109 ms ] thread
Nice, they have reinvented virtual memory and paging to disk.
Indeed. The side describes TMO in bombastic terms, but this is just an incremental improvement to zram and swapping.

Yet, a smarter algorithm to swap intelligently was long due.

did you even read this?
I get that this comment might have struck a nerve with you, but the site guidelines specifically recommend not asking if the commenter read the article.

> Please don't comment on whether someone read an article. "Did you even read the article? It mentions that" can be shortened to "The article mentions that."

FWIW I don’t think that the parent comment is wrong, but rather over-generalizing. If you’re close to the project, I’d love to hear a proper rebuttal to what seems to be a common question.

That's fair, I apologize. It struck a nerve because of how blase it was with dismissal, but I too am guilty of that at times, I suppose.

Also, I am not close to the project at all - learned about it here.

No this is obviously something supposed to improve on virtual memory and paging to disk. It uses things like that but is supposed to work across a data center with a bunch of different stuff. Improvement for a specific case is not "reinvent".
or "Meta re-invents swap disk"
You should read the whole article, because TMO does differ from traditional swapping. Notably, swapping usually occurs during periods of extreme memory pressure, where as TMO will offload memory much sooner and more intelligently.
So… paging then? Slightly improved paging?
If only there was some way to know! Some kind of... hyperlink, with text, where the answers you seek were available in a language you know, English, perhaps?
The linked article practically goes out of its way to obscure how much this work is incrementally building on Linux’s existing paging design versus designing their own solution. Sure there’s a couple places that mention Linux defaults don’t work for them, but it isn’t all that clear how difficult it was to change things
Thanks for stating my opinion with such clarity. :)

Why come up with these weird acronyms and try to sell it like it’s some entirely new idea? Why not just start that page with “We improved the virtual memory subsystem of the Linux kernel...” and take it from there? That would be both comprehensible and impressive.

Everybody wants to come up with their own terminology from scratch nowadays, even for things that already have well established terminology. For those of us who understand a lot and want to systematize knowledge in our heads it’s such a drag.

Nope.

Paging algorithms have been "pre-swapping" for ages in order to keep the free page reserve high (or preferably a purgeable page reserve).

Ahhh, but they compress the memory!

Anyone else remember Ram Doubler for pre OSX Macs?

Oh yes. Mac OS X started doing that in Mavericks as well
Darwin does it, NT does it, and Linux can do it (I use swap on zram, there's also zswap). Nice to see it widely (if quietly) used:)
(comment deleted)
IBM once had a main-memory interface that did LZW compression (so compressing between L2 and main memory).
>Using a compressed-memory back end, TMO saves 7 percent to12 percent of resident memory across five applications. Multiple applications’ data have poor compressibility, such that offloading to an SSD proves far more effective.

that in general sounds strange. My experience across different application types over more than 2 decades has been very different (not about SSD, i mean the compression in memory have been always a very efficient approach).

> Specifically, machine learning models used for Ads prediction commonly use quantized byte-encoded values that exhibit a compression ratio of 1.3-1.4x.

yep, i haven't used compression for that. That though calls for a question - how many of those models do FB have in memory. Any chance FB instantiates such a model for every user/request? :)

> …i mean the compression in memory have been always a very efficient approach.

It’s quite possible that a large amount of stuff FB handles is already compressed (e.g. photos, video, and audio) and thus doesn’t offer much opportunity for further compression. Though I wonder how much of that stuff would be memory resident in the back end in the first place.

The inevitable, albeit cynic response: Imagine how much DRAM could be saved if Facebook was shut down!

Or put differently: I have only the greatest respect for the Facebook engineers who come up with innovations like this. This one seems to save cost, lowers power use and improves performance all at the same time. If only this engineering talent could be steered to better causes. Facebook is a net negative for society. Here is hoping that emerging “ethical” technology startups eventually have as great of success as surveillance juggernauts Facebook and Google enjoy today.

>Facebook is a net negative for society

Bold claim, Cotton. I personally have a hard time imagining a world where if Facebook didn't exist, something like it wouldn't either. There were plenty of companies vying for the same idea. Or is the suggestion that all usage of the internet to allow people to connect with each other are bad.

You haven’t paid much attention in the last 10 years if you still think that Facebook is about connecting people.
You haven’t paid much attention to the internet if you still think that allowing people a worldwide platform doesn’t have inevitable downsides.

The internet is the same as the other mass media when it was newly invented. The printing press didn’t change how people were, it just allowed them to reach wider audiences. Without the printing press, Martin Luther is just a guy. Without Twitter, Trump is also just a guy.

Facebook does connect people. Billions of people log in every day to see what their friends and family are up to. You might find that far fetched because you don’t know anyone who does, but that’s just your bubble.

The issue with Facebook is that making communication free has consequences. Those consequences are what Facebook gets blamed for. But this would happen regardless because it’s a direct consequence of the internet making communication free.

“see what their friends and family are up to” isn’t actually connecting with people.

I can see what some people are up to by watching reality TV, but that’s not connecting with them.

How about you let people connect how they want to, and you connect how you want to? You don’t need to tell us if these billions of people are living up to your standards. They just need to live up to theirs.
Wanting doesn’t make it so.

The issue is Facebook is built on people wanting to connect with others and Facebook is actively preventing this. Lonely people simply make better customers.

Sure there would be something else similiar to Facebook but that doesn't make the critisism against Facebook wrong or invalid.

The critisism would then go to Bookface.

Independent of it, look what Facebook left: Nothing of importance.

> Or is the suggestion that all usage of the internet to allow people to connect with each other are bad.

False equivocation. Monopolizing the social graph and using it to manipulate people isn't the same as having links exist on the internet.

A sane world would have it legislated out of existence and replaced with protocols anyone could implement with no central control.

Apparently you don't use Tiktok. Facebook is bad but TikTok is next level bad. It damages a whole new generation's dopamine system and their mental health and who knows what. FB is a declining empire which is less relevant day by day . Time will take care of it. But TikTok is the real bad boy. If you put chinese communist government into equation , then it is even worse.
Oh absolutely. They copied what Facebook did and turned it up to 11. Their CCP ties give TikTok its own evil spin. The Chinese basically planted a mental health bomb among American teenagers.

That doesn’t make Facebook the good guy though. In fact, they made it ridiculously easy for TikTok to come up with an even more addictive product.

Are Chinese teens immune to it?
(comment deleted)
Funny. At first I laughed and the googled [0]. The response would suggest that either chinese teens are immune or china is blocking it in most of china. Or something else, but we know that the users are not in china.

0: https://www.statista.com/statistics/1299807/number-of-monthl...

I mean… why would they be on TikTok? China has its own clone (named Douyin) as they usually do. AFAIK it's very popular there.
Calling it a clone feels misleading to me. They're both made by ByteDance. It's more akin to two instances of a product (with some customizations on each).
(comment deleted)
Thats not the point. China controls it much more so that they have to make the algo addictive different.

Instead of promoting sex, they need to show helpfull videos (in theory)

Facebook, Tiktok, Twitter, et. al provide an ad-sponsored eugenic function throughout the modern world. As much as we may groan under the burden, future generations will benefit.

And if the concern is state surveillance / narrative control, social media is a lightweight compared to the print / broadcast monocultures it replaced.

Personally, I want to see PCIe x16 devices (or U2 NVMe) where you can plug a few sticks of RAM to get a temporary volume.

It would be ideal for caching!

What would be the advantage vs DIMMs?
In a server, you're more limited by DIMM slots than by PCIe ports, especially on EPYC considering the number of lanes available.

With the shift towards DDR5, DDR4 could be repurposed as old servers are decommissioned.

I'm not convinced of the limited slots point - 16 (AMD) / 24 (Intel) DIMM slots in commodity single cpu socket server mobos, it gets you a few TB of RAM. 48 sockets in multi CPU socket mobos if you need more.

I can see "recycling refurbished previous-gen DIMMs" working for certain cases but it sounds a bit niche unless someone productises it really well.

If you are interested in Pressure Stall Information mentioned in the post, be sure to check LWN article on it, Tracking pressure-stall information: https://lwn.net/Articles/759781/
This was added in back 2018, so we've had a while to start using it.. anyone have experiences of other tools using this information?
We added it to the Prometheus node_exporter ages ago. It's extremely useful in detecting system stalls.

What I really need now is to have this information at the container level in cgroups v2.

https://github.com/google/cadvisor/issues/3052

This metric will really help with measuring the impact of workload CPU bursting.

This is far less impressive than they think it is, but I guess that's just how it is nowadays.
I wonder if there's public writeups / research into compressibility of web browser RSS, eg if there's a lot of JS objects they should exhibit a lot of regularity.
I'm confused. They invented a swap partition?
It seems kind of, but better because memory can be compressed and/or paged out using a more advanced algorithm than before which assumes fast NVME's available to inform it's decisions.
Compressed swap has also been around for ages.

There's also been swapping to GPU memory (if free).

There are also advanced page replacement algorithms.

One interesting algorithm I read about a while back was using LZW not to compress swap, but to predict future page usage from past patterns.

etc. etc.

It's all still paging/swapping.

The interesting bit (to me) is the algorithm. They automatically detect how slow each available swap space is, and how sensitive a workload is to memory latency and then swap memory pages into compressed dram or nvme storage in an optimal way.

So yes, it's "just swap space" but highly optimized.

(comment deleted)
This is an important step for having better RAM overcommitment in Linux (avoiding OOM and having less latency spikes). I hope more effort is put in this line. /cc Google, Amazon, Red Hat, SUSE, Canonical