Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

Optane, swap ,zRAM and backing device

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
Zucca
Moderator
Moderator
User avatar
Posts: 4691
Joined: Thu Jun 14, 2007 10:31 pm
Location: Rasi, Finland
Contact:
Contact Zucca
Website

Optane, swap ,zRAM and backing device

  • Quote

Post by Zucca » Tue Apr 09, 2024 11:39 am

There's been quite a sale for optane based SSDs so I decided to bite the bullet.
I have envisioned a lot of use-cases for optane
  • filesystem cache (bcachefs and zfs could greatly benefit from it)
  • swap on low memory systems
  • zRAM backing device
... Which led me to here asking few questions regarding zRAM.
  • If I have zRAM device of size 4Gb and 4Gb size backing device, do the size add up or not? So do I get 4Gb zRAM device or 8Gb?
  • Is the data also compressed on the backing device?
Then there's the case of swap. Oh boy, do we have choices:
  • swap on optane
  • swap on optane + zswap
  • swap on zram + optane backing device
... the first would be the choice if using hibernate-to-disk, but which one's the best (in most cases)?
..: Zucca :..

Code: Select all

init=/sbin/openrc-init
-systemd -logind -elogind seatd
I am NaN! I am a man!
Top
eccerr0r
Watchman
Watchman
Posts: 10239
Joined: Thu Jul 01, 2004 6:51 pm
Location: almost Mile High in the USA
Contact:
Contact eccerr0r
Website

  • Quote

Post by eccerr0r » Thu Apr 11, 2024 4:42 pm

I don't get what the value add of "optane" is... as far as I know it's just another m.2 SSD, and you treat it as such.
Some optanes may be high endurance units so they would be good for caches and swap. But some appear to be rudimentary TLC and QLC units and wear fairly quickly.

Perhaps I've got too many aging machines and memory seems to be no longer an issue these days - swapping is rare or at least code memory is small compared to data memory - and data memory, well, the code should be smart about what needs to really be in memory and what can be kept on slow medium (versus code memory should not be swapped out whenever possible.)

As far as I know about swap on zram, seems android phones use it. How it deals with backing store I'm not sure, hearing conflicting reports on whether pages are decompressed when writing to backing store or not, might be a difference between zram or zswap or neither.. In any case a zram device uses your RAM so you can't count on adding the two together, it depends on compression ratio.

Fortunately hibernate is compressed, and seems to not write unused pages to disk.
Intel Core i7 2700K/Radeon Firepro W2100/24GB DDR3/800GB SSD
What am I supposed watching?
Top
Zucca
Moderator
Moderator
User avatar
Posts: 4691
Joined: Thu Jun 14, 2007 10:31 pm
Location: Rasi, Finland
Contact:
Contact Zucca
Website

  • Quote

Post by Zucca » Thu Apr 11, 2024 4:54 pm

I have one ThinkCentre... or was it Station... Anyways those Lenovo 1 litre units. One such which has a specifically marked place for Optane.
I guess I start experimenting with it then.
..: Zucca :..

Code: Select all

init=/sbin/openrc-init
-systemd -logind -elogind seatd
I am NaN! I am a man!
Top
eccerr0r
Watchman
Watchman
Posts: 10239
Joined: Thu Jul 01, 2004 6:51 pm
Location: almost Mile High in the USA
Contact:
Contact eccerr0r
Website

  • Quote

Post by eccerr0r » Thu Apr 11, 2024 5:16 pm

Currently I run a regular SATA SSD (MLC) as a cache for one of my arrays, it does help a bit... but not super fast as if all SSD mostly because I set up a write through policy as the array is not battery backed and would lose the benefit of journaling of the filesystem. Don't need another write hole (cache -> RAID5 -> filesystem)...
Intel Core i7 2700K/Radeon Firepro W2100/24GB DDR3/800GB SSD
What am I supposed watching?
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3530
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Thu Apr 11, 2024 5:51 pm

If you want a backing device use zswap. Having Zram + backing device will give you 8Gb of swap space but I'm not aware if you can prioritize one of them, while zswap has that by design.

Have in mind zram consumes ~10% of the declared device size only to keep the data structures up, even when the device is empty.

However I'm not sure how much sense buying a device just to make it a swap drive makes.

Best Regards,
Georgi
Top
Zucca
Moderator
Moderator
User avatar
Posts: 4691
Joined: Thu Jun 14, 2007 10:31 pm
Location: Rasi, Finland
Contact:
Contact Zucca
Website

  • Quote

Post by Zucca » Thu Apr 11, 2024 9:37 pm

Thanks for the responses, guys.

I'm not necessarily putting all of the optane to swap usage. But if my system has Optane, it is the place to put swap. Very low latency, and good endurance.
Like I stated on my first post, Optane as filesystem cache is one choice too. Other one would be zram backing device for portage temp dir.

Optane could also really help when I have several VMs running. Freeze one, have its state stored on Optane, etc etc...

I need to experiment this.
..: Zucca :..

Code: Select all

init=/sbin/openrc-init
-systemd -logind -elogind seatd
I am NaN! I am a man!
Top
Post Reply

6 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic