aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2011-10-31 20:08:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-31 20:30:47 -0400
commit77311139f364d7f71fc9ba88f59fd90e60205007 (patch)
tree5cde11d67e431781893bb0375dcae665750ed6dc /mm
parent16fb951237c2b0b28037b992ee44e7ee401c30d1 (diff)
mm/debug-pagealloc.c: use plain __ratelimit() instead of printk_ratelimit()
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>
Diffstat (limited to 'mm')
-rw-r--r--mm/debug-pagealloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/debug-pagealloc.c b/mm/debug-pagealloc.c
index a1e3324de2b..a4b6d707a31 100644
--- a/mm/debug-pagealloc.c
+++ b/mm/debug-pagealloc.c
@@ -2,6 +2,7 @@
2#include <linux/mm.h> 2#include <linux/mm.h>
3#include <linux/page-debug-flags.h> 3#include <linux/page-debug-flags.h>
4#include <linux/poison.h> 4#include <linux/poison.h>
5#include <linux/ratelimit.h>
5 6
6static inline void set_page_poison(struct page *page) 7static inline void set_page_poison(struct page *page)
7{ 8{
@@ -59,6 +60,7 @@ static bool single_bit_flip(unsigned char a, unsigned char b)
59 60
60static void check_poison_mem(unsigned char *mem, size_t bytes) 61static void check_poison_mem(unsigned char *mem, size_t bytes)
61{ 62{
63 static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 10);
62 unsigned char *start; 64 unsigned char *start;
63 unsigned char *end; 65 unsigned char *end;
64 66
@@ -74,7 +76,7 @@ static void check_poison_mem(unsigned char *mem, size_t bytes)
74 break; 76 break;
75 } 77 }
76 78
77 if (!printk_ratelimit()) 79 if (!__ratelimit(&ratelimit))
78 return; 80 return;
79 else if (start == end && single_bit_flip(*start, PAGE_POISON)) 81 else if (start == end && single_bit_flip(*start, PAGE_POISON))
80 printk(KERN_ERR "pagealloc: single bit error\n"); 82 printk(KERN_ERR "pagealloc: single bit error\n");