All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Dufour <ldufour@linux.ibm.com>
To: Daniel Henrique Barboza <danielhb413@gmail.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 1/3] powerpc/pseries: skip reserved LMBs in dlpar_memory_add_by_count()
Date: Thu, 24 Jun 2021 10:39:10 +0200	[thread overview]
Message-ID: <4146d67e-c606-e5c9-229d-310c05498684@linux.ibm.com> (raw)
In-Reply-To: <20210622133923.295373-2-danielhb413@gmail.com>

Le 22/06/2021 à 15:39, Daniel Henrique Barboza a écrit :
> The function is counting reserved LMBs as available to be added, but
> they aren't. This will cause the function to miscalculate the available
> LMBs and can trigger errors later on when executing dlpar_add_lmb().

Indeed I'm wondering if dlpar_add_lmb() would fail in that case, so that's even 
better to check for that flag earlier.

Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>

> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> ---
>   arch/powerpc/platforms/pseries/hotplug-memory.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
> index 36f66556a7c6..28a7fd90232f 100644
> --- a/arch/powerpc/platforms/pseries/hotplug-memory.c
> +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
> @@ -683,6 +683,9 @@ static int dlpar_memory_add_by_count(u32 lmbs_to_add)
>   
>   	/* Validate that there are enough LMBs to satisfy the request */
>   	for_each_drmem_lmb(lmb) {
> +		if (lmb->flags & DRCONF_MEM_RESERVED)
> +			continue;
> +
>   		if (!(lmb->flags & DRCONF_MEM_ASSIGNED))
>   			lmbs_available++;
>   
> 


  reply	other threads:[~2021-06-24  8:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 13:39 [PATCH 0/3] powerpc/pseries: cleanups for dlpar_memory_add* functions Daniel Henrique Barboza
2021-06-22 13:39 ` [PATCH 1/3] powerpc/pseries: skip reserved LMBs in dlpar_memory_add_by_count() Daniel Henrique Barboza
2021-06-24  8:39   ` Laurent Dufour [this message]
2021-06-22 13:39 ` [PATCH 2/3] powerpc/pseries: break early in dlpar_memory_add_by_count() loops Daniel Henrique Barboza
2021-06-24  8:45   ` Laurent Dufour
2021-06-25  6:21   ` Michael Ellerman
2021-06-22 13:39 ` [PATCH 3/3] powerpc/pseries: fail quicker in dlpar_memory_add_by_ic() Daniel Henrique Barboza
2021-06-24  8:48   ` Laurent Dufour
2021-06-25  6:21 ` [PATCH 0/3] powerpc/pseries: cleanups for dlpar_memory_add* functions 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=4146d67e-c606-e5c9-229d-310c05498684@linux.ibm.com \
    --to=ldufour@linux.ibm.com \
    --cc=danielhb413@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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 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.