* [PATCH] powerpc/vas: Limit open window failure messages in log bufffer
@ 2023-10-18 4:43 Haren Myneni
2023-10-18 10:14 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Haren Myneni @ 2023-10-18 4:43 UTC (permalink / raw)
To: linuxppc-dev; +Cc: nathanl, Haren Myneni, npiggin
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.
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));
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc/vas: Limit open window failure messages in log bufffer
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
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2023-10-18 10:14 UTC (permalink / raw)
To: Haren Myneni, linuxppc-dev; +Cc: nathanl, Haren Myneni, npiggin
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-18 10:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).