[PATCH] Make swap suggestions more flexible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Resolves: rhbz#815557

Simple patch making swap suggestions more flexible. However the new values are
not consistent with the documentation [1] and the user may end up with a machine
that cannot be hibernated.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=744129#c2

---
 iutil.py |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/iutil.py b/iutil.py
index f7254e2..f36ea83 100644
--- a/iutil.py
+++ b/iutil.py
@@ -455,23 +455,23 @@ def swapSuggestion(quiet=0):
 	
     #table suggested in rhbz#744129
     if mem <= 4096:
-        minswap = 2048
+        minswap = 1024
         maxswap = 2048
 
     elif 4096 < mem <= 16384:
-        minswap = 4096
+        minswap = 2048
         maxswap = 4096
 
     elif 16384 < mem <= 65536:
-        minswap = 8192
+        minswap = 4096
         maxswap = 8192
 
     elif 65536 < mem <= 262144:
-        minswap = 16384
+        minswap = 8192
         maxswap = 16384
 
     else:
-        minswap = 32768
+        minswap = 16384
         maxswap = 32768
 
     if not quiet:
@@ -488,7 +488,7 @@ def swapSameAsRam(quiet=0):
     #see #rhbz587152
     if mem <= SWAP_SIZE_LIMIT:
         log.info("Swap attempt of %sM to %sM", mem, mem)
-        return (mem, mem)
+        return (mem / 2, mem)
     else:
         log.warning("Cannot create swap of size %sM, using upper bound %sM",
                     mem, SWAP_SIZE_LIMIT)
-- 
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux