diff mbox series

powerpc/vas: Limit open window failure messages in log bufffer

Message ID 20231018044308.880705-1-haren@linux.ibm.com (mailing list archive)
State Changes Requested
Headers show
Series powerpc/vas: Limit open window failure messages in log bufffer | expand

Checks

Context Check Description
snowpatch_ozlabs/github-powerpc_ppctests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_selftests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_sparse success Successfully ran 4 jobs.
snowpatch_ozlabs/github-powerpc_clang success Successfully ran 6 jobs.
snowpatch_ozlabs/github-powerpc_kernel_qemu success Successfully ran 23 jobs.

Commit Message

Haren Myneni Oct. 18, 2023, 4:43 a.m. UTC
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(-)

Comments

Michael Ellerman Oct. 18, 2023, 10:14 a.m. UTC | #1
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
diff mbox series

Patch

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:
 	/*