All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Edmondson <david.edmondson@oracle.com>
To: John Levon <john.levon@nutanix.com>, john.levon@nutanix.com
Cc: jasowang@redhat.com, kvm@vger.kernel.org,
	levon@movementarian.org, mst@redhat.com,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH v2] use pr_warn_ratelimited() for vq_err()
Date: Tue, 23 Feb 2021 08:15:31 +0000	[thread overview]
Message-ID: <cun7dmzw670.fsf@oracle.com> (raw)
In-Reply-To: <20210222112947.3697927-1-john.levon@nutanix.com>

On Monday, 2021-02-22 at 11:29:47 GMT, John Levon wrote:

> vq_err() is used to report various failure states in vhost code, but by
> default uses pr_debug(), and as a result doesn't record anything unless
> enabled via dynamic debug. We'll change this so we get something recorded
> in the log in these failure cases. Guest VMs (and userspace) can trigger
> some of these messages, so we want to use the pr_warn_ratelimited()
> variant. However, on DEBUG kernels, we'd like to get everything, so we use
> pr_warn() then.
>
> Signed-off-by: John Levon <john.levon@nutanix.com>

Reviewed-by: David Edmondson <david.edmondson@oracle.com>

> ---
> v2: use pr_warn() for DEBUG kernels
> ---
>  drivers/vhost/vhost.h | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
> index b063324c7669..10007bd49f84 100644
> --- a/drivers/vhost/vhost.h
> +++ b/drivers/vhost/vhost.h
> @@ -228,10 +228,16 @@ int vhost_init_device_iotlb(struct vhost_dev *d, bool enabled);
>  void vhost_iotlb_map_free(struct vhost_iotlb *iotlb,
>  			  struct vhost_iotlb_map *map);
>  
> -#define vq_err(vq, fmt, ...) do {                                  \
> -		pr_debug(pr_fmt(fmt), ##__VA_ARGS__);       \
> -		if ((vq)->error_ctx)                               \
> -				eventfd_signal((vq)->error_ctx, 1);\
> +#ifdef DEBUG
> +#define vq_pr_warn pr_warn
> +#else
> +#define vq_pr_warn pr_warn_ratelimited
> +#endif
> +
> +#define vq_err(vq, fmt, ...) do {                                \
> +		vq_pr_warn(pr_fmt(fmt), ##__VA_ARGS__);          \
> +		if ((vq)->error_ctx)                             \
> +			eventfd_signal((vq)->error_ctx, 1);      \
>  	} while (0)
>  
>  enum {
> -- 
> 2.25.1

dme.
-- 
Slow me down, it's getting away from me.

      reply	other threads:[~2021-02-23  8:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15 17:37 [PATCH] use pr_warn_ratelimited() for vq_err() John Levon
2021-01-18  2:55 ` Jason Wang
2021-01-18  2:55   ` Jason Wang
2021-02-22 11:29 ` [PATCH v2] " John Levon
2021-02-23  8:15   ` David Edmondson [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=cun7dmzw670.fsf@oracle.com \
    --to=david.edmondson@oracle.com \
    --cc=jasowang@redhat.com \
    --cc=john.levon@nutanix.com \
    --cc=kvm@vger.kernel.org \
    --cc=levon@movementarian.org \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.