Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Optane, swap ,zRAM and backing device
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3348
Location: Rasi, Finland

PostPosted: Tue Apr 09, 2024 11:39 am    Post subject: Optane, swap ,zRAM and backing device Reply with quote

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 :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9680
Location: almost Mile High in the USA

PostPosted: Thu Apr 11, 2024 4:42 pm    Post subject: Reply with quote

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 R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3348
Location: Rasi, Finland

PostPosted: Thu Apr 11, 2024 4:54 pm    Post subject: Reply with quote

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 :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9680
Location: almost Mile High in the USA

PostPosted: Thu Apr 11, 2024 5:16 pm    Post subject: Reply with quote

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 R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
logrusx
Veteran
Veteran


Joined: 22 Feb 2018
Posts: 1550

PostPosted: Thu Apr 11, 2024 5:51 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3348
Location: Rasi, Finland

PostPosted: Thu Apr 11, 2024 9:37 pm    Post subject: Reply with quote

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 :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum