linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: ratelimit end_swap_bio_write() error
@ 2018-01-06  4:34 Sergey Senozhatsky
  2018-01-06  9:41 ` Michal Hocko
  0 siblings, 1 reply; 9+ messages in thread
From: Sergey Senozhatsky @ 2018-01-06  4:34 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Michal Hocko, Tetsuo Handa, Minchan Kim, linux-mm, linux-kernel,
	Sergey Senozhatsky

Use the ratelimited printk() version for swap-device write error
reporting. We can use ZRAM as a swap-device, and the tricky part
here is that zsmalloc() stores compressed objects in memory, thus
it has to allocates pages during swap-out. If the system is short
on memory, then we begin to flood printk() log buffer with the
same "Write-error on swap-device XXX" error messages and sometimes
simply lockup the system.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
 mm/page_io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index e93f1a4cacd7..422cd49bcba8 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -63,7 +63,7 @@ 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",
+		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);
-- 
2.15.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-01-12 12:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-06  4:34 [PATCH] mm: ratelimit end_swap_bio_write() error Sergey Senozhatsky
2018-01-06  9:41 ` Michal Hocko
2018-01-06 10:03   ` Sergey Senozhatsky
2018-01-06 13:34     ` Michal Hocko
2018-01-08  1:58       ` Sergey Senozhatsky
2018-01-08  8:37         ` Michal Hocko
2018-01-08 10:22           ` Sergey Senozhatsky
2018-01-12  4:41             ` Sergey Senozhatsky
2018-01-12 12:27               ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).