From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752892AbeAFJl2 (ORCPT + 1 other); Sat, 6 Jan 2018 04:41:28 -0500 Received: from mx2.suse.de ([195.135.220.15]:60585 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750788AbeAFJl0 (ORCPT ); Sat, 6 Jan 2018 04:41:26 -0500 Date: Sat, 6 Jan 2018 10:41:24 +0100 From: Michal Hocko To: Sergey Senozhatsky Cc: Andrew Morton , Tetsuo Handa , Minchan Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: ratelimit end_swap_bio_write() error Message-ID: <20180106094124.GB16576@dhcp22.suse.cz> References: <20180106043407.25193-1-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180106043407.25193-1-sergey.senozhatsky@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Sat 06-01-18 13:34:07, Sergey Senozhatsky wrote: > 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. Should we print an error in such a situation at all? Write-error certainly sounds scare and it suggests something went really wrong. My understading is that zram failed swap-out is not critical and therefore the error message is not really useful. Or what should an admin do when seeing it? > Signed-off-by: Sergey Senozhatsky > --- > 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 -- Michal Hocko SUSE Labs