diff options
author | Vratislav Podzimek <vpodzime@redhat.com> | 2012-04-20 11:42:42 +0200 |
---|---|---|
committer | Vratislav Podzimek <vpodzime@redhat.com> | 2012-06-27 11:19:52 +0200 |
commit | 08440435d06deb3940b5f59ce275df3e74c76269 (patch) | |
tree | f793b097d6bb378847f1af286c1f88d15957cfd3 /pyanaconda/kickstart.py | |
parent | cc4916bbf939fc5b901c3460a0cb9462e3b0f167 (diff) | |
download | anaconda-08440435d06deb3940b5f59ce275df3e74c76269.tar.gz anaconda-08440435d06deb3940b5f59ce275df3e74c76269.tar.xz anaconda-08440435d06deb3940b5f59ce275df3e74c76269.zip |
Move swapSuggestion to storage and use a new suggested algorithm for it
We were using an algorithm that suggested the swap size as 2 GB + size of
RAM, but this resulted in huge swaps on machines with a lot of RAM. The new
algorithm comes from the discussion with other teams.
(ported 84b3444a277b73abeaddf7d4b186a79569eb56d2 from rhel6-branch)
(ported 37415063594d00c896ff3c50496582f0c4e9e3d9 from rhel6-branch)
Diffstat (limited to 'pyanaconda/kickstart.py')
-rw-r--r-- | pyanaconda/kickstart.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index 6692577e7..00dc0b8d3 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -25,6 +25,7 @@ from storage.devicelibs.mpath import MultipathConfigWriter, MultipathTopology from storage.formats import getFormat from storage.partitioning import clearPartitions from storage.partitioning import shouldClear +from storage.devicelibs import swap import storage.iscsi import storage.fcoe import storage.zfcp @@ -540,9 +541,9 @@ class LogVolData(commands.logvol.F17_LogVolData): if self.mountpoint == "swap": type = "swap" self.mountpoint = "" - if self.recommended: - (self.size, self.maxSizeMB) = iutil.swapSuggestion() - self.grow = True + if self.recommended or self.hibernation: + self.size = swap.swapSuggestion(hibernation=self.hibernation) + self.grow = False else: if self.fstype != "": type = self.fstype @@ -846,9 +847,9 @@ class PartitionData(commands.partition.F17_PartData): if self.mountpoint == "swap": type = "swap" self.mountpoint = "" - if self.recommended: - (self.size, self.maxSizeMB) = iutil.swapSuggestion() - self.grow = True + if self.recommended or self.hibernation: + self.size = swap.swapSuggestion(hibernation=self.hibernation) + self.grow = False # if people want to specify no mountpoint for some reason, let them # this is really needed for pSeries boot partitions :( elif self.mountpoint == "None": |