linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Fontenot <nfont@linux.vnet.ibm.com>
To: Aravinda Prasad <aravinda@linux.vnet.ibm.com>,
	mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org
Cc: naveen.n.rao@linux.vnet.ibm.com
Subject: Re: [PATCH] powerpc/pseries: Export maximum memory value
Date: Wed, 10 Oct 2018 11:20:40 -0500	[thread overview]
Message-ID: <0c429575-93e1-0ca9-9c75-29dec1e4105c@linux.vnet.ibm.com> (raw)
In-Reply-To: <153916697991.21165.5694207762066031403.stgit@aravinda>

On 10/10/2018 05:22 AM, Aravinda Prasad wrote:
> This patch exports the maximum possible amount of memory
> configured on the system via /proc/powerpc/lparcfg.
> 
> Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
> ---
>  arch/powerpc/platforms/pseries/lparcfg.c |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/arch/powerpc/platforms/pseries/lparcfg.c b/arch/powerpc/platforms/pseries/lparcfg.c
> index 7c872dc..aa82f55 100644
> --- a/arch/powerpc/platforms/pseries/lparcfg.c
> +++ b/arch/powerpc/platforms/pseries/lparcfg.c
> @@ -26,6 +26,7 @@
>  #include <linux/seq_file.h>
>  #include <linux/slab.h>
>  #include <linux/uaccess.h>
> +#include <linux/hugetlb.h>
>  #include <asm/lppaca.h>
>  #include <asm/hvcall.h>
>  #include <asm/firmware.h>
> @@ -36,6 +37,7 @@
>  #include <asm/vio.h>
>  #include <asm/mmu.h>
>  #include <asm/machdep.h>
> +#include <asm/drmem.h>
> 
>  #include "pseries.h"
> 
> @@ -433,6 +435,16 @@ static void parse_em_data(struct seq_file *m)
>  		seq_printf(m, "power_mode_data=%016lx\n", retbuf[0]);
>  }
> 
> +static void maxmem_data(struct seq_file *m)
> +{
> +	unsigned long maxmem = 0;
> +
> +	maxmem += drmem_info->n_lmbs * drmem_info->lmb_size;
> +	maxmem += hugetlb_total_pages() * PAGE_SIZE;
> +
> +	seq_printf(m, "MaxMem=%ld\n", maxmem);

Should this be MaxPossibleMem?

At least for the drmem memory the value calculated is the maximum possible
memory. I wonder if calling it MaxMem would lead users to think they have
that much memory available to them.

-Nathan

> +}
> +
>  static int pseries_lparcfg_data(struct seq_file *m, void *v)
>  {
>  	int partition_potential_processors;
> @@ -491,6 +503,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
>  	seq_printf(m, "slb_size=%d\n", mmu_slb_size);
>  #endif
>  	parse_em_data(m);
> +	maxmem_data(m);
> 
>  	return 0;
>  }
> 


  reply	other threads:[~2018-10-10 16:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 10:22 [PATCH] powerpc/pseries: Export maximum memory value Aravinda Prasad
2018-10-10 16:20 ` Nathan Fontenot [this message]
2018-10-10 16:49   ` Naveen N. Rao
2018-10-16  7:33     ` Aravinda Prasad
2018-10-22 10:17   ` Aravinda Prasad
2018-10-31  5:42 ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0c429575-93e1-0ca9-9c75-29dec1e4105c@linux.vnet.ibm.com \
    --to=nfont@linux.vnet.ibm.com \
    --cc=aravinda@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).