diff options
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index 0f9abbaf618c..b12888c1b4e3 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -383,6 +383,29 @@ static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr, | |||
383 | pmd_t *pmd = pmd_offset(pud, addr); | 383 | pmd_t *pmd = pmd_offset(pud, addr); |
384 | struct address_space *mapping; | 384 | struct address_space *mapping; |
385 | pgoff_t index; | 385 | pgoff_t index; |
386 | static unsigned long resume; | ||
387 | static unsigned long nr_shown; | ||
388 | static unsigned long nr_unshown; | ||
389 | |||
390 | /* | ||
391 | * Allow a burst of 60 reports, then keep quiet for that minute; | ||
392 | * or allow a steady drip of one report per second. | ||
393 | */ | ||
394 | if (nr_shown == 60) { | ||
395 | if (time_before(jiffies, resume)) { | ||
396 | nr_unshown++; | ||
397 | return; | ||
398 | } | ||
399 | if (nr_unshown) { | ||
400 | printk(KERN_EMERG | ||
401 | "Bad page map: %lu messages suppressed\n", | ||
402 | nr_unshown); | ||
403 | nr_unshown = 0; | ||
404 | } | ||
405 | nr_shown = 0; | ||
406 | } | ||
407 | if (nr_shown++ == 0) | ||
408 | resume = jiffies + 60 * HZ; | ||
386 | 409 | ||
387 | mapping = vma->vm_file ? vma->vm_file->f_mapping : NULL; | 410 | mapping = vma->vm_file ? vma->vm_file->f_mapping : NULL; |
388 | index = linear_page_index(vma, addr); | 411 | index = linear_page_index(vma, addr); |