Skip to content

Commit

Permalink
mm/debug-pagealloc.c: use plain __ratelimit() instead of printk_ratel…
Browse files Browse the repository at this point in the history
…imit()

printk_ratelimit() should not be used, because it shares ratelimiting
state with all other unrelated printk_ratelimit() callsites.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed Nov 1, 2011
1 parent 16fb951 commit 7731113
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mm/debug-pagealloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <linux/mm.h>
#include <linux/page-debug-flags.h>
#include <linux/poison.h>
#include <linux/ratelimit.h>

static inline void set_page_poison(struct page *page)
{
Expand Down Expand Up @@ -59,6 +60,7 @@ static bool single_bit_flip(unsigned char a, unsigned char b)

static void check_poison_mem(unsigned char *mem, size_t bytes)
{
static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 10);
unsigned char *start;
unsigned char *end;

Expand All @@ -74,7 +76,7 @@ static void check_poison_mem(unsigned char *mem, size_t bytes)
break;
}

if (!printk_ratelimit())
if (!__ratelimit(&ratelimit))
return;
else if (start == end && single_bit_flip(*start, PAGE_POISON))
printk(KERN_ERR "pagealloc: single bit error\n");
Expand Down

0 comments on commit 7731113

Please sign in to comment.