linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Donnellan <ajd@linux.ibm.com>
To: Daniel Henrique Barboza <danielhb413@gmail.com>,
	linuxppc-dev@lists.ozlabs.org
Cc: dja@axtens.net
Subject: Re: [PATCH v3 1/1] hotplug-cpu.c: show 'last online CPU' error in dlpar_cpu_offline()
Date: Sat, 27 Mar 2021 02:30:18 +1100	[thread overview]
Message-ID: <3155bcf5-26a5-b036-590f-02052eaacbf4@linux.ibm.com> (raw)
In-Reply-To: <20210326141954.236323-2-danielhb413@gmail.com>

On 27/3/21 1:19 am, Daniel Henrique Barboza wrote:
> One of the reasons that dlpar_cpu_offline can fail is when attempting to
> offline the last online CPU of the kernel. This can be observed in a
> pseries QEMU guest that has hotplugged CPUs. If the user offlines all
> other CPUs of the guest, and a hotplugged CPU is now the last online
> CPU, trying to reclaim it will fail. See [1] for an example.
> 
> The current error message in this situation returns rc with -EBUSY and a
> generic explanation, e.g.:
> 
> pseries-hotplug-cpu: Failed to offline CPU PowerPC,POWER9, rc: -16
> 
> EBUSY can be caused by other conditions, such as cpu_hotplug_disable
> being true. Throwing a more specific error message for this case,
> instead of just "Failed to offline CPU", makes it clearer that the error
> is in fact a known error situation instead of other generic/unknown
> cause.
> 
> This patch adds a 'last online' check in dlpar_cpu_offline() to catch
> the 'last online CPU' offline error, returning a more informative error
> message:
> 
> pseries-hotplug-cpu: Unable to remove last online CPU PowerPC,POWER9
> 
> [1] https://bugzilla.redhat.com/1911414
> 
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>

Thanks for addressing the issues in Daniel's review.

I haven't tested it, but this patch looks sensible enough to me.

Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>

-- 
Andrew Donnellan              OzLabs, ADL Canberra
ajd@linux.ibm.com             IBM Australia Limited

      reply	other threads:[~2021-03-26 15:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26 14:19 [PATCH v3 0/1] show 'last online CPU' error in dlpar_cpu_offline() Daniel Henrique Barboza
2021-03-26 14:19 ` [PATCH v3 1/1] hotplug-cpu.c: " Daniel Henrique Barboza
2021-03-26 15:30   ` Andrew Donnellan [this message]

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=3155bcf5-26a5-b036-590f-02052eaacbf4@linux.ibm.com \
    --to=ajd@linux.ibm.com \
    --cc=danielhb413@gmail.com \
    --cc=dja@axtens.net \
    --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 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).