From: Michael Ellerman <mpe@ellerman.id.au>
To: Haren Myneni <haren@linux.ibm.com>, linuxppc-dev@lists.ozlabs.org
Cc: nathanl@linux.ibm.com, Haren Myneni <haren@linux.ibm.com>,
npiggin@gmail.com
Subject: Re: [PATCH] powerpc/vas: Limit open window failure messages in log bufffer
Date: Wed, 18 Oct 2023 21:14:36 +1100 [thread overview]
Message-ID: <87fs286xv7.fsf@mail.lhotse> (raw)
In-Reply-To: <20231018044308.880705-1-haren@linux.ibm.com>
Haren Myneni <haren@linux.ibm.com> writes:
> The VAS open window call prints error message and returns -EBUSY
> after the migration suspend event initiated and until the resume
> event completed on the destination system. It can cause the log
> buffer filled with these error messages if the user space issues
> continuous open window calls. Similar case even for DLPAR CPU
> remove event when no credits are available until the credits are
> freed or with the other DLPAR CPU add event.
This should probably have a Fixes: tag so it gets backported.
> So changes in the patch to use pr_err_ratelimited() instead of
> pr_err() to display open window failure and not-available credits
> error messages.
>
> Signed-off-by: Haren Myneni <haren@linux.ibm.com>
> ---
> arch/powerpc/platforms/book3s/vas-api.c | 4 ++--
> arch/powerpc/platforms/pseries/vas.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/platforms/book3s/vas-api.c b/arch/powerpc/platforms/book3s/vas-api.c
> index 77ea9335fd04..203cfc2fb8ff 100644
> --- a/arch/powerpc/platforms/book3s/vas-api.c
> +++ b/arch/powerpc/platforms/book3s/vas-api.c
> @@ -311,8 +311,8 @@ static int coproc_ioc_tx_win_open(struct file *fp, unsigned long arg)
> txwin = cp_inst->coproc->vops->open_win(uattr.vas_id, uattr.flags,
> cp_inst->coproc->cop_type);
> if (IS_ERR(txwin)) {
> - pr_err("%s() VAS window open failed, %ld\n", __func__,
> - PTR_ERR(txwin));
> + pr_err_ratelimited("%s() VAS window open failed, %ld\n",
> + __func__, PTR_ERR(txwin));
Rather than using __func__ which is a bit over specific for a user
visible error, I'd prefer something like "vas: window open failed rc = %ld".
Probably vas-api.c should use pr_fmt so that all the messages have a
consistent prefix.
cheers
> return PTR_ERR(txwin);
> }
>
> diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms/pseries/vas.c
> index b86f0db08e98..7259e6676503 100644
> --- a/arch/powerpc/platforms/pseries/vas.c
> +++ b/arch/powerpc/platforms/pseries/vas.c
> @@ -341,7 +341,7 @@ static struct vas_window *vas_allocate_window(int vas_id, u64 flags,
>
> if (atomic_inc_return(&cop_feat_caps->nr_used_credits) >
> atomic_read(&cop_feat_caps->nr_total_credits)) {
> - pr_err("Credits are not available to allocate window\n");
> + pr_err_ratelimited("Credits are not available to allocate window\n");
> rc = -EINVAL;
> goto out;
> }
> @@ -439,7 +439,7 @@ static struct vas_window *vas_allocate_window(int vas_id, u64 flags,
>
> put_vas_user_win_ref(&txwin->vas_win.task_ref);
> rc = -EBUSY;
> - pr_err("No credit is available to allocate window\n");
> + pr_err_ratelimited("No credit is available to allocate window\n");
>
> out_free:
> /*
> --
> 2.26.3
prev parent reply other threads:[~2023-10-18 10:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 4:43 [PATCH] powerpc/vas: Limit open window failure messages in log bufffer Haren Myneni
2023-10-18 10:14 ` Michael Ellerman [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=87fs286xv7.fsf@mail.lhotse \
--to=mpe@ellerman.id.au \
--cc=haren@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--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).