Re: [master] improve the memory checking so it reflects better the hungry architectures.

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

 



> diff --git a/iutil.py b/iutil.py
> index b2dabd1..fc22c76 100644
> --- a/iutil.py
> +++ b/iutil.py
> @@ -453,6 +453,17 @@ def swapSuggestion(quiet=0):
>  
>      return (minswap, maxswap)
>  
> +def total_memory():
> +    """
> +    Calculate how much memory this machine has in kB. Because /proc/meminfo only
> +    gives us the MemTotal (total physical RAM minus the kernel binary code), we
> +    need to round this up. Assuming every machine has the total RAM MB number
> +    divisible by 128
> +    """
> +    reported_mb = memInstalled() / 1024
> +    mem = ((reported_mb / 128) + 1) * 128
> +    return mem * 1024
> +
>  ## Create a directory path.  Don't fail if the directory already exists.
>  # @param dir The directory path to create.
>  def mkdirChain(dir):
> diff --git a/loader/loadermisc.c b/loader/loadermisc.c
> index 64e80a2..2e667f5 100644
> --- a/loader/loadermisc.c
> +++ b/loader/loadermisc.c
> @@ -144,6 +144,13 @@ int totalMemory(void) {
>          }
>      }
>  
> +    /*Because /proc/meminfo only gives us the MemTotal (total physical RAM minus
> +    the kernel binary code), we need to round this up. Assuming every machine
> +    has the total RAM MB number divisible by 128. */
> +    total /= 1024;
> +    total = (total / 128 + 1) * 128;
> +    total *= 1024;
> +
>      logMessage(INFO, "%d kB are available", total);
>  
>      return total;

This is another one of those things that would be good to have in isys
so we're not duplicating code between loader and anaconda.  I can just
see us forgetting to change one of these calcluations one day.

- Chris

_______________________________________________
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