powerpc/vas: Limit open window failure messages in log bufffer
PATCH 1/1 powerpc/vas: Limit open window failure messages in log bufffer
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.
--- arch/powerpc/platforms/book3s/vas-api.c | 4 ++-- arch/powerpc/platforms/pseries/vas.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/platforms/book3s/vas-api.c +2 -2
@@ -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); }
arch/powerpc/platforms/pseries/vas.c +2 -2
@@ -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:/*
Signature · 1 line
2.26.3
Michael Ellerman
reviewerQuoted 7 lines · Haren Myneni
The VAS open window call prints error message and returns
-EBUSYafter 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.
Quoted 15 lines
So changes in the patch to use
pr_err_ratelimited()instead ofpr_err()to display open window failure and not-available credits error messages.Signed-off-by Haren Myneni <[email protected]>--- arch/powerpc/platforms/book3s/vas-api.c | 4 ++-- arch/powerpc/platforms/pseries/vas.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)arch/powerpc/platforms/book3s/vas-api.c +0
-0
arch/powerpc/platforms/book3s/vas-api.c static int coproc_ioc_tx_win_open(struct file *fp, unsigned long arg) · line 315
Quoted 7 lines
arch/powerpc/platforms/book3s/vas-api.c +2
-2@@ -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
Quoted 27 lines
arch/powerpc/platforms/book3s/vas-api.c +0
-0return PTR_ERR (txwin); }arch/powerpc/platforms/pseries/vas.c +2
-2@@ -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:/* Signature · 1 line
2.26.3