From b996ea53a59499e7c35013bc221c4c2e3d90ed41 Mon Sep 17 00:00:00 2001 From: Vinayak Menon Date: Fri, 23 Mar 2018 11:25:43 +0530 Subject: [PATCH] mm: ratelimit swap write errors Ratelimit the swap write errors to avoid logbuf getting filled up by these messages. These pages remove the useful page allocation failure messages (when zram is used as swap) from logbuf, thus making the debugging difficult. Change-Id: I9d4229a76b2551d7baca603112d53012d8722415 Signed-off-by: Vinayak Menon Signed-off-by: Charan Teja Reddy Signed-off-by: Isaac J. Manjarres --- mm/page_io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 24ee600f9131..c6463f013333 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -60,8 +60,9 @@ void end_swap_bio_write(struct bio *bio) * Also clear PG_reclaim to avoid rotate_reclaimable_page() */ set_page_dirty(page); - pr_alert("Write-error on swap-device (%u:%u:%llu)\n", - MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)), + pr_alert_ratelimited("Write-error on swap-device (%u:%u:%llu)\n", + MAJOR(bio_dev(bio)), + MINOR(bio_dev(bio)), (unsigned long long)bio->bi_iter.bi_sector); ClearPageReclaim(page); }