Linux ACPI
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: Chen Gong <gong.chen@linux.intel.com>
Cc: linux-acpi@vger.kernel.org
Subject: Re: [PATCH] eliminate the usage of printk_ratelimit
Date: Fri, 17 Dec 2010 01:27:26 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1012170123140.20940@x980> (raw)
In-Reply-To: <1292408294-30584-2-git-send-email-gong.chen@linux.intel.com>

On Wed, 15 Dec 2010, Chen Gong wrote:

> To avoid messages to be suppressed, use __ratelimit to
> substitute printk_ratelimit.
> 
> Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
> ---
>  drivers/acpi/apei/ghes.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> index 51905d0..29d38ad 100644
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -180,13 +180,15 @@ static int ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len,
>  static int ghes_read_estatus(struct ghes *ghes, int silent)
>  {
>  	struct acpi_hest_generic *g = ghes->generic;
> +	/* Not more than 2 messages every 5 seconds */
> +	static DEFINE_RATELIMIT_STATE(ratelimit, 5*HZ, 2);
>  	u64 buf_paddr;
>  	u32 len;
>  	int rc;
>  
>  	rc = acpi_atomic_read(&buf_paddr, &g->error_status_address);
>  	if (rc) {
> -		if (!silent && printk_ratelimit())
> +		if (!silent && __ratelimit(&ratelimit))

So you want to change 10 messages/5s into 2 messages/5s?

That isn't a very big change.

Is using ratelimit better than using printk_once()?

-Len

>  			pr_warning(FW_WARN GHES_PFX
>  "Failed to read error status block address for hardware error source: %d.\n",
>  				   g->header.source_id);
> -- 
> 1.7.3.1.120.g38a18


  reply	other threads:[~2010-12-17  6:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15 10:18 (unknown), Chen Gong
2010-12-15 10:18 ` [PATCH] eliminate the usage of printk_ratelimit Chen Gong
2010-12-17  6:27   ` Len Brown [this message]
2010-12-20  1:38     ` Chen Gong

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=alpine.LFD.2.00.1012170123140.20940@x980 \
    --to=lenb@kernel.org \
    --cc=gong.chen@linux.intel.com \
    --cc=linux-acpi@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox