linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>,
	"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
	Nathan Lynch <nathanl@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2] powerpc/pseries: Fix maximum memory value
Date: Thu, 4 Jul 2019 17:00:16 +0530	[thread overview]
Message-ID: <8581b7e9-f09b-c273-ca8a-c83671cde919@linux.vnet.ibm.com> (raw)
In-Reply-To: <871rz6qch5.fsf@concordia.ellerman.id.au>



On Thursday 04 July 2019 04:43 PM, Michael Ellerman wrote:
> "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> writes:
>> Nathan Lynch wrote:
>>> Aravinda Prasad <aravinda@linux.vnet.ibm.com> writes:
>>>> Calculating the maximum memory based on the number of lmbs
>>>> and lmb size does not account for the RMA region. Hence
>>>> use memory_hotplug_max(), which already accounts for the
>>>> RMA region, to fetch the maximum memory value. Thanks to
>>>> Nathan Lynch for suggesting the memory_hotplug_max()
>>>> function.
>>>
>>> Well, I hope I haven't led you astray... will it give you the desired
>>> result on a kernel configured without memory hotplug support, booted in
>>> an LPAR with some huge pages configured?
>>>
>>> If so, then
>>> Acked-by: Nathan Lynch <nathanl@linux.ibm.com>
>>>
>>> It would likely help with review and future maintenance if the semantics
>>> and intended use of the MaxMem field are made a little more
>>> explicit. For example, is it supposed to include persistent memory?
>>> Perhaps a follow-up patch could address this. Or maybe I'm overthinking
>>> it.
>>
>> This was primarily aimed to replicate what AIX lparstat does and 
>> documentation (*) just says:
>>
>>   Maximum Memory
>>       Maximum possible amount of Memory.
>>
>> I think this mirrors the maximum memory value set in the LPAR profile, 
>> and this provides a way to obtain that value from within the LPAR.
> 
> But the doc string for memory_hotplug_max() says:
> 
>  * memory_hotplug_max - return max address of memory that may be added
> 
> 
> ie. maximum *address* not maximum *amount*.
> 
> Possibly it turns out to be the same value, but that is just because you
> have no holes in your layout.
> 
> So I don't think this patch is correct.

memory_hotplug_max (in one of the cases) is taking the value from
"ibm,lrdr-capacity" and according to PAPR:

PAPR section C.6.3.1 ibm,lrdr-capacity:

"The phys (of size #address-cells) communicates the maximum address in
bytes and therefore, the most memory that can be allocated to this
partition."

On other cases memory_hotplug_max() is calculating based on the number
of lmbs assigned to the partition, so should still give max mem value


> 
> cheers
> 

-- 
Regards,
Aravinda


  reply	other threads:[~2019-07-04 11:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28  6:53 [PATCH v2] powerpc/pseries: Fix maximum memory value Aravinda Prasad
2019-06-28 17:27 ` Nathan Lynch
2019-06-28 17:38   ` Naveen N. Rao
2019-06-28 18:19     ` Nathan Lynch
2019-07-04 11:13     ` Michael Ellerman
2019-07-04 11:30       ` Aravinda Prasad [this message]
2019-07-01  4:03   ` Aravinda Prasad

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=8581b7e9-f09b-c273-ca8a-c83671cde919@linux.vnet.ibm.com \
    --to=aravinda@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=nathanl@linux.ibm.com \
    --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).