3

Meta: Transparent memory offloading

 1 year ago
source link: https://lwn.net/Articles/898454/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Meta: Transparent memory offloading

[Posted June 20, 2022 by corbet]
This Meta blog post by Johannes Weiner and Dan Schatzberg describes a set of memory-management changes used there that they call "transparent memory offloading".
Transparent Memory Offloading (TMO) is Meta’s solution for heterogeneous data center environments. It introduces a new Linux kernel mechanism that measures the lost work due to resource shortage across CPU, memory, and I/O in real time. Guided by this information and without any prior application knowledge, TMO automatically adjusts the amount of memory to offload to a heterogeneous device, such as compressed memory or an SSD.

The article doesn't say where to find the relevant code, not all of which is in the mainline kernel (and some of which runs in user space).


(Log in to post comments)

Meta: Transparent memory offloading

Posted Jun 20, 2022 22:47 UTC (Mon) by ssmith32 (subscriber, #72404) [Link]

"more fundamental solution entails the kernel managing a hierarchy of offload back ends "

If this means what I think it means, I wonder why they didn't start with this approach?

Up until I got to the end I kept wondering why they didn't just adjust the swap algorithm instead of building another layer that seems to just be second-guessing the original swap algorithm.. and/or tweak the file cache to not cache aggressively on fast storage..

Meta: Transparent memory offloading

Posted Jun 21, 2022 0:36 UTC (Tue) by MattBBaker (subscriber, #28651) [Link]

It really feels like a large part of the problem is that many of these systems like what Facebook and Google runs are bigger than what a 'mere' single machine kernel can manage. So the local kernel is great at stashing memory on local disks and local compressed memory for local operations, but once you have a large distributed system suddenly the app has better information of the global system state than the local kernel does. Suddenly the app has better information about the working set than the kernel does.

Historically the kernel has been able to ignore local apps since the kernel had more complete information about the state of the system, but once the app runtime has better information about the state of a cluster, the local kernel needs to made to mind the larger picture.

Meta: Transparent memory offloading

Posted Jun 21, 2022 4:02 UTC (Tue) by wahern (subscriber, #37304) [Link]

I've always tended to think it was performance. macOS and Windows automatically grow swap. Perhaps not coincidentally, they've never been known for their speedy VM subsystems. Architecting and optimizing your VM subsystem in a manner that is exceptionally optimistic about memory pressure scenarios, and then assuming that when your expectations fail all bets are off and nobody is allowed to complain when you just start randomly killing processes, has traditionally worked exceptionally well for Linux, especially when it comes to general performance and in niches where Linux has come to dominate. But this approach is a serious buzz kill in some scenarios, especially for large cloud computing nodes with many different apps running (IOW, cases where processes *are* *not* coordinating resource allocation amongst themselves, outside the kernel), and unfortunately these scenarios are becoming difficult to ignore.

I guess another way to put it, perhaps some other OSs are trading away performance for reliability, and the strategy of trading away reliability for performance is finally catching up with Linux.

FaceBook (Meta)

Posted Jun 21, 2022 19:00 UTC (Tue) by Felix_the_Mac (guest, #32242) [Link]

I would suggest that from an editorial standpoint LWN doesn't endorse Facebook's rebranding attempt and refers to them as Facebook (Meta).

I don't believe it is necessary to my position but I will point out that the linked article is on fb.com, is headed by a picture of an Facebook data centre and has a cookie policy in the name of facebook.

FaceBook (Meta)

Posted Jun 22, 2022 2:49 UTC (Wed) by flussence (subscriber, #85566) [Link]

Yes please, for consistency's sake if nothing else. We don't talk about Alphabet's software...

FaceBook (Meta)

Posted Jun 22, 2022 3:21 UTC (Wed) by jake (editor, #205) [Link]

> We don't talk about Alphabet's software...

because Alphabet doesn't talk about Alphabet's software ... Google blogs still call themselves that ... should that change at some point, so will we ...

we like to use the names that people or organizations choose for themselves ...

FaceBook (Meta)

Posted Jun 22, 2022 13:26 UTC (Wed) by scientes (subscriber, #83068) [Link]

> we like to use the names that people or organizations choose for themselves ...

How meta of you.

And initially meta just just meant after until it's the famous title "metaphysics" in Aristotle gave it a special meaning.

Perhaps you should still clarify that Meta Inc. runs Facebook, because their overly generic branding of "Messenger" (which they then claim trademark over) is really an afront to the English language.

FaceBook (Meta)

Posted Jun 22, 2022 15:31 UTC (Wed) by ballombe (subscriber, #9523) [Link]

Sorry, but in this instance, they do not: the site name is engineering.fb.com, etc.

At least replace 'meta' by 'meta (the social media company formally known as facebook)' so there is no confusion to the preexisting usages of meta.

We all know the renaming goal is to sow confusion and distract of facebook trouble. LWN role is to reduce confusion, not amplify it.

FaceBook (Meta)

Posted Jun 22, 2022 18:07 UTC (Wed) by rgmoore (✭ supporter ✭, #75) [Link]

Sorry, but in this instance, they do not: the site name is engineering.fb.com, etc.

The website is indeed engineering.fb.com, but the blog calls itself "Engineering at Meta", not "Engineering at Facebook". The post talks about technologies being used at Meta, not technologies used at Facebook. This makes sense, because they are probably using the same technology across their platforms. This is part of the reason they renamed the parent: they're a single big social media company with a bunch of different brands that are making use of a lot of the same technology under the surface. When talking about that technology, it makes more sense to talk about the corporation (Meta) rather than the product (Facebook) because it's not just one product using it.

FaceBook (Meta)

Posted Jun 22, 2022 20:55 UTC (Wed) by klindsay (subscriber, #7459) [Link]

> We all know ...

If an entity (person, organization, corporation, city, country, etc.) changes their name, it makes sense to me to refer to the entity by the name that they've chosen for themselves. To not do so, based on one's perception of the entity's intent, and how that perceived intent aligns with you own values, seems to me like a recipe for inconsistency and disrespect.

FaceBook (Meta)

Posted Jun 22, 2022 22:02 UTC (Wed) by mpr22 (subscriber, #60784) [Link]

I see no harm in referring to a large for-profit shareholder corporation that has a very prominent and still-active brand identity, and that brand used to be the company name, by that brand for as long as I please.

(And yes, I do distinguish between that class of entity, and the other collective entities on your list.)

Meta: Transparent memory offloading

Posted Jun 22, 2022 13:45 UTC (Wed) by dschatzberg (subscriber, #130997) [Link]

Hi, I'm an author on this work.

> The article doesn't say where to find the relevant code, not all of which is in the mainline kernel (and some of which runs in user space).

The vast majority of the code (PSI, reclaim improvements) has been upstreamed in the Linux kernel. The only piece which hasn't been (and isn't critical) is the memory.reclaim interface (one can use memory.high instead). We have ongoing discussions about upstreaming memory.reclaim as well: https://lwn.net/Articles/892328/

Our userspace logic (Senpai) is a bit tied to our internal infrastructure, but we've published a reference implementation here: https://github.com/facebookincubator/senpai - it works on upstream kernels.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK