All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/pseries: Export maximum memory value
@ 2018-10-10 10:22 Aravinda Prasad
  2018-10-10 16:20 ` Nathan Fontenot
  2018-10-31  5:42 ` Michael Ellerman
  0 siblings, 2 replies; 6+ messages in thread
From: Aravinda Prasad @ 2018-10-10 10:22 UTC (permalink / raw)
  To: mpe, linuxppc-dev; +Cc: nfont, naveen.n.rao, aravinda

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);
+}
+
 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;
 }


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] powerpc/pseries: Export maximum memory value
  2018-10-10 10:22 [PATCH] powerpc/pseries: Export maximum memory value Aravinda Prasad
@ 2018-10-10 16:20 ` Nathan Fontenot
  2018-10-10 16:49   ` Naveen N. Rao
  2018-10-22 10:17   ` Aravinda Prasad
  2018-10-31  5:42 ` Michael Ellerman
  1 sibling, 2 replies; 6+ messages in thread
From: Nathan Fontenot @ 2018-10-10 16:20 UTC (permalink / raw)
  To: Aravinda Prasad, mpe, linuxppc-dev; +Cc: naveen.n.rao

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;
>  }
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] powerpc/pseries: Export maximum memory value
  2018-10-10 16:20 ` Nathan Fontenot
@ 2018-10-10 16:49   ` Naveen N. Rao
  2018-10-16  7:33     ` Aravinda Prasad
  2018-10-22 10:17   ` Aravinda Prasad
  1 sibling, 1 reply; 6+ messages in thread
From: Naveen N. Rao @ 2018-10-10 16:49 UTC (permalink / raw)
  To: Aravinda Prasad, linuxppc-dev, mpe, Nathan Fontenot

Nathan Fontenot wrote:
> 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.

That's a good point. This seems to be referred to as just 'maximum 
memory' in the LPAR configuration as well as in the lparstat 
documentation, but it shouldn't hurt to rename it here.

- Naveen



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] powerpc/pseries: Export maximum memory value
  2018-10-10 16:49   ` Naveen N. Rao
@ 2018-10-16  7:33     ` Aravinda Prasad
  0 siblings, 0 replies; 6+ messages in thread
From: Aravinda Prasad @ 2018-10-16  7:33 UTC (permalink / raw)
  To: Naveen N. Rao, linuxppc-dev, mpe, Nathan Fontenot



On Wednesday 10 October 2018 10:19 PM, Naveen N. Rao wrote:
> Nathan Fontenot wrote:
>> 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.
> 
> That's a good point. This seems to be referred to as just 'maximum
> memory' in the LPAR configuration as well as in the lparstat
> documentation, but it shouldn't hurt to rename it here.

As Naveen mentioned, I am using the term referred in the LPAR
configuration. But, I can rename it.

Regards,
Aravinda

> 
> - Naveen
> 

-- 
Regards,
Aravinda


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] powerpc/pseries: Export maximum memory value
  2018-10-10 16:20 ` Nathan Fontenot
  2018-10-10 16:49   ` Naveen N. Rao
@ 2018-10-22 10:17   ` Aravinda Prasad
  1 sibling, 0 replies; 6+ messages in thread
From: Aravinda Prasad @ 2018-10-22 10:17 UTC (permalink / raw)
  To: Nathan Fontenot, mpe, linuxppc-dev; +Cc: naveen.n.rao



On Wednesday 10 October 2018 09:50 PM, Nathan Fontenot wrote:
> 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,

I feel MaxMem makes more sense because, we use "Minimum memory",
"Desired memory" and "Maximum memory" in the LPAR profile configuration
and MaxMem is in fact displaying the value of this "Maximum memory"
profile value.

So I want to keep it as "MaxMem". Let me know if you think otherwise.

Regards,
Aravinda


> 
> -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;
>>  }
>>

-- 
Regards,
Aravinda


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: powerpc/pseries: Export maximum memory value
  2018-10-10 10:22 [PATCH] powerpc/pseries: Export maximum memory value Aravinda Prasad
  2018-10-10 16:20 ` Nathan Fontenot
@ 2018-10-31  5:42 ` Michael Ellerman
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2018-10-31  5:42 UTC (permalink / raw)
  To: Aravinda Prasad, linuxppc-dev; +Cc: nfont, naveen.n.rao, aravinda

On Wed, 2018-10-10 at 10:22:59 UTC, 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>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/772b039fd9a7e12d5fc80e6f649341

cheers

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-10-31  5:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-10 10:22 [PATCH] powerpc/pseries: Export maximum memory value Aravinda Prasad
2018-10-10 16:20 ` Nathan Fontenot
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.