diff options
-rw-r--r-- | mm/debug-pagealloc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/debug-pagealloc.c b/mm/debug-pagealloc.c index a1e3324de2b5..a4b6d707a31f 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 | ||
6 | static inline void set_page_poison(struct page *page) | 7 | static 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 | ||
60 | static void check_poison_mem(unsigned char *mem, size_t bytes) | 61 | static 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"); |