From Fedora Project Wiki
(creation)
 
(Add trackers)
 
(6 intermediate revisions by 3 users not shown)
Line 11: Line 11:
This should link to your home wiki page so we know who you are.  
This should link to your home wiki page so we know who you are.  
-->
-->
* Name: [[User:Zbyszek|Zbigniew Jędrzejewski-Szmek]]
* Name: [[User:Zbyszek|Zbigniew Jędrzejewski-Szmek]], [[User:jwrdegoede|Hans de Goede]]
<!-- Include you email address that you can be reached should people want to contact you about helping with your change, status is requested, or technical issues need to be resolved. If the change proposal is owned by a SIG, please also add a primary contact person. -->
<!-- Include you email address that you can be reached should people want to contact you about helping with your change, status is requested, or technical issues need to be resolved. If the change proposal is owned by a SIG, please also add a primary contact person. -->
* Email: zbyszek@in.waw.pl
* Email: zbyszek@in.waw.pl, hdegoede@redhat.com
* Name: [[User:jwrdegoede|Hans de Goede]]
* Email: hdegoede@redhat.com
<!--- UNCOMMENT only for Changes with assigned Shepherd (by FESCo)
<!--- UNCOMMENT only for Changes with assigned Shepherd (by FESCo)
* FESCo shepherd: [[User:FASAccountName| Shehperd name]] <email address>
* FESCo shepherd: [[User:FASAccountName| Shehperd name]] <email address>
Line 25: Line 23:


== Current status ==
== Current status ==
[[Category:ChangePageIncomplete]]
[[Category:ChangeAcceptedF34]]
<!-- When your change proposal page is completed and ready for review and announcement -->
<!-- When your change proposal page is completed and ready for review and announcement -->
<!-- remove Category:ChangePageIncomplete and change it to Category:ChangeReadyForWrangler -->
<!-- remove Category:ChangePageIncomplete and change it to Category:ChangeReadyForWrangler -->
Line 44: Line 42:
CLOSED as NEXTRELEASE -> change is completed and verified and will be delivered in next release under development
CLOSED as NEXTRELEASE -> change is completed and verified and will be delivered in next release under development
-->
-->
* FESCo issue: <will be assigned by the Wrangler>
* FESCo issue: [https://pagure.io/fesco/issue/2554 #2554]
* Tracker bug: <will be assigned by the Wrangler>
* Tracker bug: [https://bugzilla.redhat.com/show_bug.cgi?id=1921084 #1921084]
* Release notes tracker: <will be assigned by the Wrangler>
* Release notes tracker: [https://pagure.io/fedora-docs/release-notes/issue/644 #644]


== Detailed Description ==
== Detailed Description ==
Line 65: Line 63:


== Scope ==
== Scope ==
* Proposal owners: change the defaults in `zram-generator-defaults` package to `zram-fraction=1.0`, `max-zram-size=8096`.
* Proposal owners: change the defaults in `zram-generator-defaults` package to `zram-fraction=1.0`, `max-zram-size=8192`.


* Other developers: N/A (not a System Wide Change) <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
* Other developers: N/A (not a System Wide Change) <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
Line 99: Line 97:
                         `------ this should be approx the size of RAM
                         `------ this should be approx the size of RAM
</pre>
</pre>
(Note that the device is destroyed and recreated during restart. This means that all pages will be "swapped in", i.e. decompressed. On machines with low memory, rebooting might be a better option.)
(Note that the compressed swap device is destroyed and recreated during restart. This means that all pages will be "swapped in", i.e. decompressed. When making a zram configuration change on machines with low memory, instead of `sudo systemctl restart`, rebooting might be a better option.)


== User Experience ==
== User Experience ==

Latest revision as of 13:46, 27 January 2021


Scale ZRAM to Full Memory Size

Summary

Fedora 33 enabled zram by default. The size of the virtual swap devices was set so that the amount of memory used for compressed swap pages was limited to a quarter of physical memory in typical scenarios. That size is now increased to half of physical memory (zram-fraction becomes 1.0, max-zram-size becomes 8 GiB). This allows systems with small amounts to successfully launch the Anaconda installer and other programs.

Owner

Current status

Detailed Description

When ZRAM was enabled by default in Fedora 33, the size of the device (before compression) was limited to fraction 0.5 of RAM or 4 GiB, whichever is less. The reason to limit the fraction to less than 1.0 is that with only incompressible data in memory, whole RAM would be filled by the "compressed" pages, leaving no RAM for normal use. But this concern seems to have been overblown, and there have been no reports of compressed swap taking up too much memory. In real use, we will have at least a few hundred MiB of code in memory, which compresses quite well, so some compression will occur even when working with incompressible data. In typical usage scenarios, we get effective compression of 2:1 or 3:1, which means that the compressed pages use at most between 1/4th and 1/6th of RAM. By increasing the fraction to 1.0, we expect to consign up to half of RAM for compressed pages.

Increasing the size of the device is important for small devices. For devices with 1GB of RAM, sizing ZRAM to 1 GiB allows successful installation with Anaconda. In general, it is expected that having more compressed swap will make the device more functional after installation too. This increase is the most important for devices with small amounts of memory (< 1 GiB), but will be beneficial to systems with slightly larger systems (1–8 GiB).

Technically, this change is completely trivial, amounting to two lines of configuration. Nevertheless, there is some potential for problems with incompressible workloads. The experience with ZRAM so far makes the Change authors optimistic that no issues will be encountered, but users and other developers should be aware of the change.

Feedback

Benefit to Fedora

Fedora works better on devices with low RAM. In particular, the installer can function.

Scope

  • Proposal owners: change the defaults in zram-generator-defaults package to zram-fraction=1.0, max-zram-size=8192.
  • Other developers: N/A (not a System Wide Change)
  • Policies and guidelines: N/A (not a System Wide Change)
  • Trademark approval: N/A (not needed for this Change)
  • Alignment with Objectives:

https://docs.fedoraproject.org/en-US/project/objectives/#_fedora_internet_of_things most likely

Upgrade/compatibility impact

Default configuration is changed. Systems with local configuration will not be affected. Systems which had zram-generator disabled will not be affected.

How To Test

Install the new version of the zram-generator-defaults package, execute sudo systemctl daemon-reload && sudo systemctl restart swap-create@zram0, use zramctl to check that the device has the expected size. After some use, check that pages are compressed at least with ration 2:1:

$ zramctl
NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle       7.6G   4K   74B   12K       4 [SWAP]
                         ^       ^    ^       
                         |        \____\_______ the ratio of those values should be more than 2:1
                         |
                         `------ this should be approx the size of RAM

(Note that the compressed swap device is destroyed and recreated during restart. This means that all pages will be "swapped in", i.e. decompressed. When making a zram configuration change on machines with low memory, instead of sudo systemctl restart, rebooting might be a better option.)

User Experience

Not user visible.

Dependencies

None.

Contingency Plan

  • Contingency mechanism: Revert default configuration to previous values.
  • Contingency deadline: Final freeze, any time really.
  • Blocks release? No
  • Blocks product? No

Documentation

None.

Release Notes

The default size of compressed zram devices (/dev/zram0) has been increased to 1.0 fraction of RAM, or 8 GiB, whichever is smaller.