From: Nick Child <nnac123@linux.ibm.com>
To: nathanl@linux.ibm.com, Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
Scott Cheloha <cheloha@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/3] powerpc/pseries/memhp: Remove unbalanced dlpar_release_drc() call
Date: Wed, 15 Nov 2023 11:31:32 -0600 [thread overview]
Message-ID: <18be4145-732a-4e28-b7f1-94d367a54bd7@linux.ibm.com> (raw)
In-Reply-To: <20231114-pseries-memhp-fixes-v1-2-fb8f2bb7c557@linux.ibm.com>
Hi Nathan,
Patches 1 and 3 LGTM
Regarding this patch, dlpar_memory_remove_by_count() calls
dlpar_add_lmb() and does not free drc on add error.
dlpar_add_lmb() is called here in error recovery so probably
not a big deal.
This is all new code to me but it looks like if the requested
number of lmbs cannot be removed then it attempts to add back
the ones that were successfully removed. So if you cannot add
an lmb that WAS successfully removed, it seems sane to also
release the drc.
On 11/14/23 11:01, Nathan Lynch via B4 Relay wrote:
> From: Nathan Lynch <nathanl@linux.ibm.com>
>
> Callers of dlpar_add_lmb() are responsible for first acquiring the DRC
> and releasing it if dlpar_add_lmb() fails.
>
> However, dlpar_add_lmb() performs a dlpar_release_drc() in one error
> branch. There is no corresponding dlpar_acquire_drc() in the
> function, nor is there any stated justification. None of the other
> error paths in dlpar_add_lmb() release the DRC.
>
> This is a potential source of redundant attempts to release DRCs,
> which is likely benign, but is confusing and inconsistent. Remove it.
>
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> ---
> arch/powerpc/platforms/pseries/hotplug-memory.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
> index 6f2eebae7bee..ba883c1b9f6d 100644
> --- a/arch/powerpc/platforms/pseries/hotplug-memory.c
> +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
> @@ -575,7 +575,6 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb)
>
> rc = update_lmb_associativity_index(lmb);
> if (rc) {
> - dlpar_release_drc(lmb->drc_index);
> return rc;
> }
>
>
next prev parent reply other threads:[~2023-11-15 17:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 17:01 [PATCH 0/3] powerpc/pseries/memhp: Fix minor bugs and improve error logging Nathan Lynch via B4 Relay
2023-11-14 17:01 ` [PATCH 1/3] powerpc/pseries/memhp: Fix access beyond end of drmem array Nathan Lynch via B4 Relay
2023-11-14 17:01 ` [PATCH 2/3] powerpc/pseries/memhp: Remove unbalanced dlpar_release_drc() call Nathan Lynch via B4 Relay
2023-11-15 17:31 ` Nick Child [this message]
2023-11-28 14:21 ` Nathan Lynch
2023-11-30 20:09 ` Scott Cheloha
2023-11-14 17:01 ` [PATCH 3/3] powerpc/pseries/memhp: Log more error conditions in add path Nathan Lynch via B4 Relay
2023-12-07 12:38 ` [PATCH 0/3] powerpc/pseries/memhp: Fix minor bugs and improve error logging 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=18be4145-732a-4e28-b7f1-94d367a54bd7@linux.ibm.com \
--to=nnac123@linux.ibm.com \
--cc=aneesh.kumar@linux.ibm.com \
--cc=cheloha@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=nathanl@linux.ibm.com \
--cc=npiggin@gmail.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).