From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: Srikar Dronamraju <srikar@linux.ibm.com>
Cc: "Thomas Gleixner" <tglx@linutronix.de>,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Tyrel Datwyler" <tyreld@linux.ibm.com>,
linux-kernel@vger.kernel.org,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
"Madhavan Srinivasan" <maddy@linux.ibm.com>,
"Michael Ellerman" <mpe@ellerman.id.au>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Christophe Leroy" <christophe.leroy@csgroup.eu>,
"Naveen N Rao" <naveen@kernel.org>
Subject: Re: [PATCH] pseries/lparcfg: Add resource group monitoring
Date: Wed, 6 Aug 2025 19:49:13 +0530 [thread overview]
Message-ID: <b2e88230-84ed-4b2a-b097-1b813fb42e2a@linux.ibm.com> (raw)
In-Reply-To: <aJGZ5_Sf4c1ByCeb@linux.ibm.com>
On 8/5/25 11:13, Srikar Dronamraju wrote:
> * Shrikanth Hegde <sshegde@linux.ibm.com> [2025-08-01 19:27:22]:
>
>>
>> Could you please add a link to patch on power utils on how it is being consumed?
>
> I am not sure I understood your query, it looks a bit ambiguous.
>
> If your query is on how lparcfg data is being consumed.
> All tools that are consuming lparcfg will continue to use the same way.
> Since this is not changing the way lparcfg is being consumed, I think it is
> redundant information that need not be carried in all the changes/commits to
> lparcfg. Such an information would be required when lparcfg file was
> created.
I was saying you could point to power utils patch that you have sent which says how
one would consume this.
https://groups.google.com/g/powerpc-utils-devel/c/8b2Ixk8vk2w
>
> If your query is on how resource group data is being consumed by users.
>>
>> Does MODULE_VERS need to increased?
>
> All tools that are consuming lparcfg will continue to use the same way.
> If there was some conditional changes that need to be done by the tools,
> then we should have updated the same.
> Hence there is not need to update MODULE_VERS.
>
Since there are two new fields user scripts might need change is why i was suggesting
we might need to increase MODULE_VERS
>>
>>> @@ -78,6 +78,8 @@ struct hvcall_ppp_data {
>>> u8 capped;
>>> u8 weight;
>>> u8 unallocated_weight;
>>> + u8 resource_group_index;
>>> + u16 active_procs_in_resource_group;
>>> u16 active_procs_in_pool;
>>> u16 active_system_procs;
>>> u16 phys_platform_procs;
>>> @@ -86,7 +88,7 @@ struct hvcall_ppp_data {
>>> };
>>> /*
>>> - * H_GET_PPP hcall returns info in 4 parms.
>>> + * H_GET_PPP hcall returns info in 5 parms.
>>> * entitled_capacity,unallocated_capacity,
>>> * aggregation, resource_capability).
>>> *
>>> @@ -94,11 +96,11 @@ struct hvcall_ppp_data {
>>> * R5 = Unallocated Processor Capacity Percentage.
>>> * R6 (AABBCCDDEEFFGGHH).
>>> * XXXX - reserved (0)
>>> - * XXXX - reserved (0)
>>> + * XXXX - Active Cores in Resource Group
>>> * XXXX - Group Number
>>> * XXXX - Pool Number.
>>> * R7 (IIJJKKLLMMNNOOPP).
>>> - * XX - reserved. (0)
>>> + * XX - Resource group Number
>>> * XX - bit 0-6 reserved (0). bit 7 is Capped indicator.
>>> * XX - variable processor Capacity Weight
>>> * XX - Unallocated Variable Processor Capacity Weight.
>>> @@ -120,9 +122,11 @@ static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data)
>>> ppp_data->entitlement = retbuf[0];
>>> ppp_data->unallocated_entitlement = retbuf[1];
>>> + ppp_data->active_procs_in_resource_group = (retbuf[2] >> 4 * 8) & 0xffff;
>>> ppp_data->group_num = (retbuf[2] >> 2 * 8) & 0xffff;
>>> ppp_data->pool_num = retbuf[2] & 0xffff;
>>> + ppp_data->resource_group_index = (retbuf[3] >> 7 * 8) & 0xff;
>>> ppp_data->capped = (retbuf[3] >> 6 * 8) & 0x01;
>>> ppp_data->weight = (retbuf[3] >> 5 * 8) & 0xff;
>>> ppp_data->unallocated_weight = (retbuf[3] >> 4 * 8) & 0xff;
>>> @@ -236,6 +240,13 @@ static void parse_ppp_data(struct seq_file *m)
>>> seq_printf(m, "unallocated_capacity=%lld\n",
>>> ppp_data.unallocated_entitlement);
>>> + if (ppp_data.active_procs_in_resource_group) {
>>
>> ppp_data.active_procs_in_resource_group can ever be zero?
>>
>> If the entry is absent in lparcfg, then lparstat will print it as 0 (which happens to be
>> default RG, while default RG may have processors)
>
> If active_procs_in_resource_group is 0, then we are not printing the
> resource group information. If active_procs_in_resource_group is non-zero
> and resource_group_index is wrong, we need to report a bug to the firmware
> to update it. Kernel is very transparent with respect to this information.
> It can neither verify the information received nor should we even be doing
> this.
>
>>
The comment was more on the necessity of if statement there.
+ if (ppp_data.active_procs_in_resource_group) {
If one runs lparstat in the LPAR, that means ppp_data.active_procs_in_resource_group is non zero. and when
ppp_data.active_procs_in_resource_group is zero, i don't think one can run lparstat in any of such LPAR.
btw, ppp_data.active_procs_in_resource_group can be fraction between 0,1 or is it always an integer number?
next prev parent reply other threads:[~2025-08-06 14:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-16 10:45 Srikar Dronamraju
2025-08-01 13:57 ` Shrikanth Hegde
2025-08-05 5:43 ` Srikar Dronamraju
2025-08-06 14:19 ` Shrikanth Hegde [this message]
2025-08-07 7:04 ` Srikar Dronamraju
2025-08-04 7:01 ` Venkat
2025-11-21 2:54 ` Madhavan Srinivasan
2025-07-29 9:21 Venkat
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=b2e88230-84ed-4b2a-b097-1b813fb42e2a@linux.ibm.com \
--to=sshegde@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=naveen@kernel.org \
--cc=npiggin@gmail.com \
--cc=srikar@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=thomas.weissschuh@linutronix.de \
--cc=tyreld@linux.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
all inboxes | Powered by JetHome®